This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix s390 testcase vcond-shift
- From: Robin Dapp <rdapp at linux dot vnet dot ibm dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Andreas Krebbel <krebbel at linux dot vnet dot ibm dot com>
- Date: Mon, 27 Mar 2017 17:03:42 +0200
- Subject: [PATCH] Fix s390 testcase vcond-shift
- Authentication-results: sourceware.org; auth=none
Hi,
this patch fixes the vcond shift testcase that failed since setting
PARAM_MIN_VECT_LOOP_BOUND in the s390 backend.
Regards
Robin
--
gcc/testsuite/ChangeLog:
2017-03-27 Robin Dapp <rdapp@linux.vnet.ibm.com>
* gcc.target/s390/vector/vcond-shift.c (void foo): Increase
iteration count and assume alignment.
(void foo2): Likewise.
(void foo3): Likewise.
(int baz): Likewise.
(int baf): Likewise.
(int bal): Likewise.
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;
}