]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
RISC-V: Fix gather_load_run-12.c test
authorJuzhe-Zhong <juzhe.zhong@rivai.ai>
Wed, 23 Aug 2023 02:21:22 +0000 (10:21 +0800)
committerPan Li <pan2.li@intel.com>
Wed, 23 Aug 2023 02:22:39 +0000 (10:22 +0800)
FAIL: gcc.target/riscv/rvv/autovec/gather-scatter/gather_load_run-12.c

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/gather-scatter/gather_load_run-12.c:
Add vsetvli asm.

gcc/testsuite/gcc.target/riscv/rvv/autovec/gather-scatter/gather_load_run-12.c

index b4e2ead8ca9b0cf0e6f2ae15317d71d6ca6e7ec3..2fb525d8ffcafb63f25593206581ef7d8b36124c 100644 (file)
@@ -7,6 +7,12 @@
 int
 main (void)
 {
+  /* FIXME: The purpose of this assembly is to ensure that the vtype register is
+     initialized befor instructions such as vmv1r.v are executed. Otherwise you
+     will get illegal instruction errors when running with spike+pk. This is an
+     interim solution for reduce unnecessary failures and a unified solution
+     will come later. */
+  asm volatile("vsetivli x0, 0, e8, m1, ta, ma");
 #define RUN_LOOP(DATA_TYPE, INDEX_TYPE)                                        \
   DATA_TYPE dest_##DATA_TYPE##_##INDEX_TYPE[202] = {0};                        \
   DATA_TYPE src_##DATA_TYPE##_##INDEX_TYPE[202] = {0};                         \