From a8e70fd379cd81455b61dd031c277d929f8eaa4e Mon Sep 17 00:00:00 2001 From: Robin Dapp Date: Mon, 3 Apr 2017 10:54:38 +0000 Subject: [PATCH] Fix s390 testcase vcond-shift This patch fixes the vcond shift testcase that failed since setting PARAM_MIN_VECT_LOOP_BOUND in the s390 backend. gcc/testsuite/ChangeLog: 2017-04-03 Robin Dapp * gcc.target/s390/vector/vcond-shift.c (foo, foo2, foo3, baz, baf) (bal): Increase iteration count and assume alignment. From-SVN: r246644 --- gcc/testsuite/ChangeLog | 5 +++ .../gcc.target/s390/vector/vcond-shift.c | 34 +++++++++++++------ 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 39121e04b2e..c353008f277 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-04-03 Robin Dapp + + * gcc.target/s390/vector/vcond-shift.c (foo, foo2, foo3, baz, baf) + (bal): Increase iteration count and assume alignment. + 2017-04-03 Bin Cheng * gcc.dg/tree-ssa/pr71347.c: Add predcom and drop XFAILs. diff --git a/gcc/testsuite/gcc.target/s390/vector/vcond-shift.c b/gcc/testsuite/gcc.target/s390/vector/vcond-shift.c index f58bd1f8cf4..cc40153bb27 100644 --- a/gcc/testsuite/gcc.target/s390/vector/vcond-shift.c +++ b/gcc/testsuite/gcc.target/s390/vector/vcond-shift.c @@ -11,51 +11,63 @@ /* { dg-final { scan-assembler "vesrlh\t%v.?,%v.?,15" } } */ /* { dg-final { scan-assembler "vesrlb\t%v.?,%v.?,7" } } */ -#define SZ 4 -#define SZ2 8 -#define SZ3 16 +#define SZ 8 +#define SZ2 16 +#define SZ3 32 void foo(int *w) { int i; - /* Should expand to (w + (w < 0 ? 1 : 0)) >> 1 - which in turn should get simplified to (w + (w >> 31)) >> 1. */ + int *ww = __builtin_assume_aligned (w, 8); + + /* Should expand to (ww + (ww < 0 ? 1 : 0)) >> 1 + which in turn should get simplified to (ww + (ww >> 31)) >> 1. */ for (i = 0; i < SZ; i++) - w[i] = w[i] / 2; + ww[i] = ww[i] / 2; } void foo2(short *w) { int i; + short *ww = __builtin_assume_aligned (w, 8); + for (i = 0; i < SZ2; i++) - w[i] = w[i] / 2; + ww[i] = ww[i] / 2; } void foo3(signed char *w) { int i; + signed char *ww = __builtin_assume_aligned (w, 8); + for (i = 0; i < SZ3; i++) - w[i] = w[i] / 2; + ww[i] = ww[i] / 2; } int baz(int *x) { int i; + int *xx = __builtin_assume_aligned (x, 8); + for (i = 0; i < SZ; i++) - x[i] = x[i] < 0 ? -1 : 0; + xx[i] = xx[i] < 0 ? -1 : 0; } int baf(short *x) { int i; + short *xx = __builtin_assume_aligned (x, 8); + for (i = 0; i < SZ2; i++) - x[i] = x[i] >= 0 ? 0 : 1; + xx[i] = xx[i] >= 0 ? 0 : 1; } int bal(signed char *x) { int i; + signed char *xx = __builtin_assume_aligned (x, 8); + for (i = 0; i < SZ3; i++) - x[i] = x[i] >= 0 ? 0 : -1; + xx[i] = xx[i] >= 0 ? 0 : -1; } -- 2.30.2