aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2020-11-18 18:40:30 +0000
committerRichard Sandiford <richard.sandiford@arm.com>2020-11-18 18:40:30 +0000
commit0f545ad9b68445094975455a5657bfc8be2e4912 (patch)
treeefa69e4e3925bb496186a5935e6b39b8f1818214 /gcc
parent92648faa1cb2b28685f3b3dccfdfc4b1ed2c5a7b (diff)
downloadgcc-0f545ad9b68445094975455a5657bfc8be2e4912.zip
gcc-0f545ad9b68445094975455a5657bfc8be2e4912.tar.gz
gcc-0f545ad9b68445094975455a5657bfc8be2e4912.tar.bz2
testsuite: Fix vect/vect-sdiv-pow2-1.c
We're now able to vectorise the set-up loop: int p = power2 (fns[i].po2); for (int j = 0; j < N; j++) a[j] = ((p << 4) * j) / (N - 1) - (p << 5); This patch adds an asm to stop the loop being vectorised. gcc/testsuite/ * gcc.dg/vect/vect-sdiv-pow2-1.c (main): Add an asm to the set-up loop.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-sdiv-pow2-1.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/testsuite/gcc.dg/vect/vect-sdiv-pow2-1.c b/gcc/testsuite/gcc.dg/vect/vect-sdiv-pow2-1.c
index be70bc6..484efb1 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-sdiv-pow2-1.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-sdiv-pow2-1.c
@@ -62,7 +62,10 @@ main (void)
{
int p = power2 (fns[i].po2);
for (int j = 0; j < N; j++)
- a[j] = ((p << 4) * j) / (N - 1) - (p << 5);
+ {
+ a[j] = ((p << 4) * j) / (N - 1) - (p << 5);
+ asm volatile ("" ::: "memory");
+ }
fns[i].div (b, a, N);
fns[i].mod (c, a, N);