aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRobin Dapp <rdapp@linux.vnet.ibm.com>2017-04-03 10:54:38 +0000
committerAndreas Krebbel <krebbel@gcc.gnu.org>2017-04-03 10:54:38 +0000
commita8e70fd379cd81455b61dd031c277d929f8eaa4e (patch)
treefc8121b9d1542e7899b5e78d9c1cb476784250f3 /gcc
parente006186611558bd377d9d4880ebdec7b3e011657 (diff)
downloadgcc-a8e70fd379cd81455b61dd031c277d929f8eaa4e.zip
gcc-a8e70fd379cd81455b61dd031c277d929f8eaa4e.tar.gz
gcc-a8e70fd379cd81455b61dd031c277d929f8eaa4e.tar.bz2
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 <rdapp@linux.vnet.ibm.com> * gcc.target/s390/vector/vcond-shift.c (foo, foo2, foo3, baz, baf) (bal): Increase iteration count and assume alignment. From-SVN: r246644
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.target/s390/vector/vcond-shift.c34
2 files changed, 28 insertions, 11 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 39121e0..c353008 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2017-04-03 Robin Dapp <rdapp@linux.vnet.ibm.com>
+
+ * gcc.target/s390/vector/vcond-shift.c (foo, foo2, foo3, baz, baf)
+ (bal): Increase iteration count and assume alignment.
+
2017-04-03 Bin Cheng <bin.cheng@arm.com>
* 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 f58bd1f..cc40153 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;
}