]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
RISC-V: Fix the test case bug-3.c failure
authorPan Li <pan2.li@intel.com>
Mon, 3 Mar 2025 06:51:21 +0000 (14:51 +0800)
committerPan Li <pan2.li@intel.com>
Tue, 4 Mar 2025 01:38:59 +0000 (09:38 +0800)
The bug-3.c would like to check the slli a[0-9]+, a[0-9]+, 33 for the
big poly int handling.  But the underlying insn may change to slli 1
+ slli 32 with sorts of optimization.  Thus, update the asm check to
function body check with above slli 1 + slli 32 series.

The below test suites are passed for this patch.
* The rv64gcv fully regression test.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/bug-3.c: Update asm check to
function body check.

Signed-off-by: Pan Li <pan2.li@intel.com>
gcc/testsuite/gcc.target/riscv/rvv/autovec/bug-3.c

index 05ac2e54cbed2ba43949289bee0fa46b22546753..2d5f4c2e0de0f4f7b559d957d2d2e543d21a31f3 100644 (file)
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-march=rv64gcv_zvl512b -mabi=lp64d -mrvv-max-lmul=m8 -mrvv-vector-bits=scalable -fno-vect-cost-model -O2 -ffast-math" } */
+/* { dg-final { check-function-bodies "**" "" } } */
 
 #define N 16
 
@@ -25,7 +26,15 @@ _Complex float res[N] =
       -740.0F + 2488.0iF, -760.0F + 2638.0iF,
       -780.0F + 2792.0iF, -800.0F + 2950.0iF };
 
-
+/*
+** foo:
+** ...
+** csrr\s+[atx][0-9]+,\s*vlenb
+** slli\s+[atx][0-9]+,\s*[atx][0-9],\s*1
+** ...
+** slli\s+[atx][0-9]+,\s*[atx][0-9],\s*32
+** ...
+*/
 void
 foo (void)
 {
@@ -36,4 +45,3 @@ foo (void)
 }
 
 /* { dg-final { scan-assembler-not {li\s+[a-x0-9]+,\s*0} } } */
-/* { dg-final { scan-assembler-times {slli\s+[a-x0-9]+,\s*[a-x0-9]+,\s*33} 1 } } */