]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
AArch64: Relax regexps in tests to let them pass with -fweb master trunk
authorChristopher Bazley <chris.bazley@arm.com>
Tue, 19 May 2026 15:07:26 +0000 (15:07 +0000)
committerChristopher Bazley <chris.bazley@arm.com>
Thu, 30 Jul 2026 17:21:17 +0000 (17:21 +0000)
The -fweb option changes the way that GCC allocates
registers.  -fweb is not enabled by default, so we
have never previously noticed that some AArch64 tests
have unreasonably strict expectations about register
allocation.  This patch relaxes those expectations.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/ffs.c: Relax test expectations.
* gcc.target/aarch64/frecpe_1.c: As above.
* gcc.target/aarch64/frecpe_2.c: As above.

gcc/testsuite/gcc.target/aarch64/ffs.c
gcc/testsuite/gcc.target/aarch64/frecpe_1.c
gcc/testsuite/gcc.target/aarch64/frecpe_2.c

index a303bee5fd47df82bd82e83e5b8b0a0c62103b30..59e55eefcc0d74ae9e804a50420e9bce6aecb46e 100644 (file)
@@ -9,9 +9,9 @@
 /*
 ** ffsw1:
 **     cmp     w1, 0
-**     rbit    w0, w1
-**     clz     w0, w0
-**     csinc   w0, wzr, w0, eq
+**     rbit    (w[0-9]+), w1
+**     clz     (w[0-9]+), \1
+**     csinc   w0, wzr, \2, eq
 **     ret
 */
 
@@ -23,9 +23,9 @@ int ffsw1 (int y, uint32_t x)
 /*
 ** ffsx1:
 **     cmp     x1, 0
-**     rbit    x0, x1
-**     clz     x0, x0
-**     csinc   x0, xzr, x0, eq
+**     rbit    (x[0-9]+), x1
+**     clz     (x[0-9]+), \1
+**     csinc   x0, xzr, \2, eq
 **     ret
 */
 
@@ -39,8 +39,8 @@ int ffsx1 (int y, uint64_t x)
 /*
 ** ffsw2:
 **     cmp     w1, 0
-**     ctz     w0, w1
-**     csinc   w0, wzr, w0, eq
+**     ctz     (w[0-9]+), w1
+**     csinc   w0, wzr, \1, eq
 **     ret
 */
 
@@ -52,8 +52,8 @@ int ffsw2 (int y, uint32_t x)
 /*
 ** ffsx2:
 **     cmp     x1, 0
-**     ctz     x0, x1
-**     csinc   x0, xzr, x0, eq
+**     ctz     (x[0-9]+), x1
+**     csinc   x0, xzr, \1, eq
 **     ret
 */
 
index e79f80d3ead5dbfb52d5c04c06a9e2f26a0e265f..321d820a0f328a8092f2c7f1cd762edb75418bb1 100644 (file)
@@ -15,4 +15,4 @@ f2 (double x)
   return 1 / x;
 }
 
-/* { dg-final { scan-assembler {\tfrecpe\t(d[0-9]+), d0\n\tfrecps\t(d[0-9]+), \1, d0\n\tfmul\t\1, \1, \2\n\tfrecps\t\2, \1, d0\n\tfmul\td0, \1, \2\n} } } */
+/* { dg-final { scan-assembler {\tfrecpe\t(d[0-9]+), d0\n\tfrecps\t(d[0-9]+), \1, d0\n\tfmul\t(d[0-9]+), \1, \2\n\tfrecps\t(d[0-9]+), \1, d0\n\tfmul\td0, \3, \4\n} } } */
index 233817c26b26df6335f9cebd7f91c239de427768..907181d53e7eeb80affb7c95484417f47a372eb5 100644 (file)
@@ -7,7 +7,7 @@ f1 (float x, float y)
   return y / x;
 }
 
-/* { dg-final { scan-assembler {\tfrecpe\t(s[0-9]+), s0\n\tfrecps\t(s[0-9]+), \1, s0\n\tfmul\t\1, \1, s1\n\tfmul\ts0, \1, \2\n} } } */
+/* { dg-final { scan-assembler {\tfrecpe\t(s[0-9]+), s0\n\tfrecps\t(s[0-9]+), \1, s0\n\tfmul\t(s[0-9]+), \1, s1\n\tfmul\ts0, \3, \2\n} } } */
 
 double
 f2 (double x, double y)
@@ -15,4 +15,4 @@ f2 (double x, double y)
   return y / x;
 }
 
-/* { dg-final { scan-assembler {\tfrecpe\t(d[0-9]+), d0\n\tfrecps\t(d[0-9]+), \1, d0\n\tfmul\t\1, \1, \2\n\tfrecps\t\2, \1, d0\n\tfmul\t\1, \1, d1\n\tfmul\td0, \1, \2\n} } } */
+/* { dg-final { scan-assembler {\tfrecpe\t(d[0-9]+), d0\n\tfrecps\t(d[0-9]+), \1, d0\n\tfmul\t(d[0-9]+), \1, \2\n\tfrecps\t(d[0-9]+), \3, d0\n\tfmul\t(d[0-9]+), \3, d1\n\tfmul\td0, \5, \4\n} } } */