aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAlexandre Oliva <oliva@adacore.com>2024-06-26 02:08:18 -0300
committerAlexandre Oliva <oliva@gnu.org>2024-06-26 02:08:18 -0300
commit54d2339c9f87f702e02e571a5460e11c19e1c02f (patch)
tree7af163d40753502ce5bd28ef5b1bf1d3d0cff3bb /gcc
parentaac00d09859cc5934bd0f7493d537b8430337773 (diff)
downloadgcc-54d2339c9f87f702e02e571a5460e11c19e1c02f.zip
gcc-54d2339c9f87f702e02e571a5460e11c19e1c02f.tar.gz
gcc-54d2339c9f87f702e02e571a5460e11c19e1c02f.tar.bz2
[testsuite] [arm] [vect] adjust mve-vshr test [PR113281]
The test was too optimistic, alas. We used to vectorize shifts by clamping the shift counts below the bit width of the types (e.g. at 15 for 16-bit vector elements), but (uint16_t)32768 >> (uint16_t)16 is well defined (because of promotion to 32-bit int) and must yield 0, not 1 (as before the fix). Unfortunately, in the gimple model of vector units, such large shift counts wouldn't be well-defined, so we won't vectorize such shifts any more, unless we can tell they're in range or undefined. So the test that expected the vectorization we no longer performed needs to be adjusted. Instead of nobbling the test, Richard Earnshaw suggested annotating the test with the expected ranges so as to enable the optimization, and Christophe Lyon suggested a further simplification. Co-Authored-By: Richard Earnshaw <Richard.Earnshaw@arm.com> for gcc/testsuite/ChangeLog PR tree-optimization/113281 * gcc.target/arm/simd/mve-vshr.c: Add expected ranges.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/gcc.target/arm/simd/mve-vshr.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/arm/simd/mve-vshr.c b/gcc/testsuite/gcc.target/arm/simd/mve-vshr.c
index 8c7adef..03078de 100644
--- a/gcc/testsuite/gcc.target/arm/simd/mve-vshr.c
+++ b/gcc/testsuite/gcc.target/arm/simd/mve-vshr.c
@@ -9,6 +9,8 @@
void test_ ## NAME ##_ ## SIGN ## BITS ## x ## NB (TYPE##BITS##_t * __restrict__ dest, TYPE##BITS##_t *a, TYPE##BITS##_t *b) { \
int i; \
for (i=0; i<NB; i++) { \
+ if ((unsigned)b[i] >= (unsigned)(BITS)) \
+ __builtin_unreachable(); \
dest[i] = a[i] OP b[i]; \
} \
}