* [Committed 1/3] S/390: Turn movstr-1.c into compile only test.
2016-02-23 10:20 [Committed 0/3] S/390: Move recently added testcases to correct subdirs Andreas Krebbel
2016-02-23 10:20 ` [Committed 2/3] S/390: Move movstr-2.c into vector subdir Andreas Krebbel
2016-02-23 10:20 ` [Committed 3/3] S/390: Move vcond-shift.c to " Andreas Krebbel
@ 2016-02-23 10:20 ` Andreas Krebbel
2 siblings, 0 replies; 4+ messages in thread
From: Andreas Krebbel @ 2016-02-23 10:20 UTC (permalink / raw)
To: gcc-patches
gcc/testsuite/ChangeLog:
* gcc.target/s390/md/movstr-1.c: Turn into compile test.
---
gcc/testsuite/gcc.target/s390/md/movstr-1.c | 16 ++--------------
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/gcc/testsuite/gcc.target/s390/md/movstr-1.c b/gcc/testsuite/gcc.target/s390/md/movstr-1.c
index da98415..b83ed6d 100644
--- a/gcc/testsuite/gcc.target/s390/md/movstr-1.c
+++ b/gcc/testsuite/gcc.target/s390/md/movstr-1.c
@@ -1,7 +1,7 @@
/* Machine description pattern tests. */
-/* { dg-do run } */
-/* { dg-options "-dP -save-temps" } */
+/* { dg-do compile } */
+/* { dg-options "-dP" } */
__attribute__ ((noinline))
void test(char *dest, const char *src)
@@ -10,15 +10,3 @@ void test(char *dest, const char *src)
}
/* { dg-final { scan-assembler-times {{[*]movstr}|{vec_vfenesv16qi}} 1 } } */
-
-#define LEN 200
-char buf[LEN];
-
-int main(void)
-{
- __builtin_memset(buf, 0, LEN);
- test(buf, "hello world!");
- if (__builtin_strcmp(buf, "hello world!") != 0)
- __builtin_abort();
- return 0;
-}
--
1.9.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Committed 0/3] S/390: Move recently added testcases to correct subdirs
@ 2016-02-23 10:20 Andreas Krebbel
2016-02-23 10:20 ` [Committed 2/3] S/390: Move movstr-2.c into vector subdir Andreas Krebbel
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Andreas Krebbel @ 2016-02-23 10:20 UTC (permalink / raw)
To: gcc-patches
Andreas Krebbel (3):
S/390: Turn movstr-1.c into compile only test.
S/390: Move movstr-2.c into vector subdir.
S/390: Move vcond-shift.c to vector subdir.
gcc/testsuite/gcc.target/s390/md/movstr-1.c | 16 +---
gcc/testsuite/gcc.target/s390/md/movstr-2.c | 98 --------------------
gcc/testsuite/gcc.target/s390/vcond-shift.c | 61 -------------
gcc/testsuite/gcc.target/s390/vector/stpcpy-1.c | 100 +++++++++++++++++++++
gcc/testsuite/gcc.target/s390/vector/vcond-shift.c | 61 +++++++++++++
5 files changed, 163 insertions(+), 173 deletions(-)
delete mode 100644 gcc/testsuite/gcc.target/s390/md/movstr-2.c
delete mode 100644 gcc/testsuite/gcc.target/s390/vcond-shift.c
create mode 100644 gcc/testsuite/gcc.target/s390/vector/stpcpy-1.c
create mode 100644 gcc/testsuite/gcc.target/s390/vector/vcond-shift.c
--
1.9.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Committed 3/3] S/390: Move vcond-shift.c to vector subdir.
2016-02-23 10:20 [Committed 0/3] S/390: Move recently added testcases to correct subdirs Andreas Krebbel
2016-02-23 10:20 ` [Committed 2/3] S/390: Move movstr-2.c into vector subdir Andreas Krebbel
@ 2016-02-23 10:20 ` Andreas Krebbel
2016-02-23 10:20 ` [Committed 1/3] S/390: Turn movstr-1.c into compile only test Andreas Krebbel
2 siblings, 0 replies; 4+ messages in thread
From: Andreas Krebbel @ 2016-02-23 10:20 UTC (permalink / raw)
To: gcc-patches
gcc/testsuite/ChangeLog:
* gcc.target/s390/vcond-shift.c: Move to ...
* gcc.target/s390/vector/vcond-shift.c: ... here.
---
gcc/testsuite/gcc.target/s390/vcond-shift.c | 61 ----------------------
gcc/testsuite/gcc.target/s390/vector/vcond-shift.c | 61 ++++++++++++++++++++++
2 files changed, 61 insertions(+), 61 deletions(-)
delete mode 100644 gcc/testsuite/gcc.target/s390/vcond-shift.c
create mode 100644 gcc/testsuite/gcc.target/s390/vector/vcond-shift.c
diff --git a/gcc/testsuite/gcc.target/s390/vcond-shift.c b/gcc/testsuite/gcc.target/s390/vcond-shift.c
deleted file mode 100644
index f58bd1f..0000000
--- a/gcc/testsuite/gcc.target/s390/vcond-shift.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/* Check if conditional vector instructions are simplified
- into shift operations. */
-/* { dg-do compile { target { s390*-*-* } } } */
-/* { dg-options "-O3 -march=z13 -mzarch" } */
-
-/* { dg-final { scan-assembler "vesraf\t%v.?,%v.?,31" } } */
-/* { dg-final { scan-assembler "vesrah\t%v.?,%v.?,15" } } */
-/* { dg-final { scan-assembler "vesrab\t%v.?,%v.?,7" } } */
-/* { dg-final { scan-assembler-not "vzero\t*" } } */
-/* { dg-final { scan-assembler "vesrlf\t%v.?,%v.?,31" } } */
-/* { 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
-
-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. */
- for (i = 0; i < SZ; i++)
- w[i] = w[i] / 2;
-}
-
-void foo2(short *w)
-{
- int i;
- for (i = 0; i < SZ2; i++)
- w[i] = w[i] / 2;
-}
-
-
-void foo3(signed char *w)
-{
- int i;
- for (i = 0; i < SZ3; i++)
- w[i] = w[i] / 2;
-}
-
-int baz(int *x)
-{
- int i;
- for (i = 0; i < SZ; i++)
- x[i] = x[i] < 0 ? -1 : 0;
-}
-
-int baf(short *x)
-{
- int i;
- for (i = 0; i < SZ2; i++)
- x[i] = x[i] >= 0 ? 0 : 1;
-}
-
-int bal(signed char *x)
-{
- int i;
- for (i = 0; i < SZ3; i++)
- x[i] = x[i] >= 0 ? 0 : -1;
-}
diff --git a/gcc/testsuite/gcc.target/s390/vector/vcond-shift.c b/gcc/testsuite/gcc.target/s390/vector/vcond-shift.c
new file mode 100644
index 0000000..f58bd1f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/vcond-shift.c
@@ -0,0 +1,61 @@
+/* Check if conditional vector instructions are simplified
+ into shift operations. */
+/* { dg-do compile { target { s390*-*-* } } } */
+/* { dg-options "-O3 -march=z13 -mzarch" } */
+
+/* { dg-final { scan-assembler "vesraf\t%v.?,%v.?,31" } } */
+/* { dg-final { scan-assembler "vesrah\t%v.?,%v.?,15" } } */
+/* { dg-final { scan-assembler "vesrab\t%v.?,%v.?,7" } } */
+/* { dg-final { scan-assembler-not "vzero\t*" } } */
+/* { dg-final { scan-assembler "vesrlf\t%v.?,%v.?,31" } } */
+/* { 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
+
+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. */
+ for (i = 0; i < SZ; i++)
+ w[i] = w[i] / 2;
+}
+
+void foo2(short *w)
+{
+ int i;
+ for (i = 0; i < SZ2; i++)
+ w[i] = w[i] / 2;
+}
+
+
+void foo3(signed char *w)
+{
+ int i;
+ for (i = 0; i < SZ3; i++)
+ w[i] = w[i] / 2;
+}
+
+int baz(int *x)
+{
+ int i;
+ for (i = 0; i < SZ; i++)
+ x[i] = x[i] < 0 ? -1 : 0;
+}
+
+int baf(short *x)
+{
+ int i;
+ for (i = 0; i < SZ2; i++)
+ x[i] = x[i] >= 0 ? 0 : 1;
+}
+
+int bal(signed char *x)
+{
+ int i;
+ for (i = 0; i < SZ3; i++)
+ x[i] = x[i] >= 0 ? 0 : -1;
+}
--
1.9.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Committed 2/3] S/390: Move movstr-2.c into vector subdir.
2016-02-23 10:20 [Committed 0/3] S/390: Move recently added testcases to correct subdirs Andreas Krebbel
@ 2016-02-23 10:20 ` Andreas Krebbel
2016-02-23 10:20 ` [Committed 3/3] S/390: Move vcond-shift.c to " Andreas Krebbel
2016-02-23 10:20 ` [Committed 1/3] S/390: Turn movstr-1.c into compile only test Andreas Krebbel
2 siblings, 0 replies; 4+ messages in thread
From: Andreas Krebbel @ 2016-02-23 10:20 UTC (permalink / raw)
To: gcc-patches
gcc/testsuite/ChangeLog:
* gcc.target/s390/md/movstr-2.c: Move and rename to ...
* gcc.target/s390/vector/stpcpy-1.c: ... this one.
---
gcc/testsuite/gcc.target/s390/md/movstr-2.c | 98 -----------------------
gcc/testsuite/gcc.target/s390/vector/stpcpy-1.c | 100 ++++++++++++++++++++++++
2 files changed, 100 insertions(+), 98 deletions(-)
delete mode 100644 gcc/testsuite/gcc.target/s390/md/movstr-2.c
create mode 100644 gcc/testsuite/gcc.target/s390/vector/stpcpy-1.c
diff --git a/gcc/testsuite/gcc.target/s390/md/movstr-2.c b/gcc/testsuite/gcc.target/s390/md/movstr-2.c
deleted file mode 100644
index 1b977a2..0000000
--- a/gcc/testsuite/gcc.target/s390/md/movstr-2.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/* The z13 stpcpy implementation plays some alignment tricks for good
- performance. This test tries to make sure it works correctly and
- does not access bytes beyond the source and destination
- strings. */
-
-/* { dg-do run } */
-
-#include <stdio.h>
-#include <sys/mman.h>
-
-#define PAGE_SIZE 4096
-
-struct {
- char unused[PAGE_SIZE - 32];
- char m32[15]; /* page bndry - 32 */
- char m17[1];
- char m16[1];
- char m15[14];
- char m1[1];
- char next_page[PAGE_SIZE];
-} s, d __attribute__((aligned(PAGE_SIZE)));
-
-char *__attribute__((noinline))
-my_stpcpy(char *dest, const char *src)
-{
- return __builtin_stpcpy (dest, src);
-}
-
-void __attribute__ ((noinline))
-check (char *dest, char *src, size_t len)
-{
- char *result;
-
- result = my_stpcpy (dest, src);
- if (result != dest + len)
- __builtin_abort ();
- if (__builtin_memcmp (src, dest, len) != 0)
- __builtin_abort ();
-}
-
-int
-main ()
-{
- char *src[5] = { s.m32, s.m17, s.m16, s.m15, s.m1 };
- char *dst[5] = { d.m32, d.m17, d.m16, d.m15, d.m1 };
- int len[8] = { 33, 32, 31, 17, 16, 15, 1, 0 };
- int i, j, k;
- char backup;
-
- for (i = 0; i < sizeof (s); i++)
- ((char*)&s)[i] = i % 26 + 97;
-
- for (i = 0; i < 5; i++)
- for (j = 0; j < 5; j++)
- for (k = 0; k < 8; k++)
- {
- backup = src[j][len[k]];
- src[j][len[k]] = 0;
- __builtin_memset (&d, 0, sizeof (d));
- check (dst[i], src[j], len[k]);
- src[j][len[k]] = backup;
- }
-
- /* Make all source strings end before the page boundary. */
- backup = s.m1[0];
- s.m1[0] = 0;
-
- if (mprotect (&s.next_page, PAGE_SIZE, PROT_NONE) == -1)
- perror ("mprotect src");
-
- for (i = 0; i < 5; i++)
- for (j = 0; j < 5; j++)
- check (dst[i], src[j],
- PAGE_SIZE - ((unsigned long)src[j] & ((1UL << 12) - 1)) - 1);
-
- if (mprotect (&s.next_page, PAGE_SIZE, PROT_READ | PROT_WRITE) == -1)
- perror ("mprotect src");
-
- s.m1[0] = backup;
-
- if (mprotect (&d.next_page, PAGE_SIZE, PROT_NONE) == -1)
- perror ("mprotect dst");
-
- for (i = 0; i < 5; i++)
- for (j = 0; j < 5; j++)
- {
- int len = PAGE_SIZE - ((unsigned long)dst[i] & ((1UL << 12) - 1)) - 1;
- char backup = src[j][len];
-
- src[j][len] = 0;
- __builtin_memset (&d, 0,
- (unsigned long)&d.next_page - (unsigned long)&d);
- check (dst[i], src[j], len);
- src[j][len] = backup;
- }
-
- return 0;
-}
diff --git a/gcc/testsuite/gcc.target/s390/vector/stpcpy-1.c b/gcc/testsuite/gcc.target/s390/vector/stpcpy-1.c
new file mode 100644
index 0000000..91c1f7c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/stpcpy-1.c
@@ -0,0 +1,100 @@
+/* The z13 stpcpy implementation plays some alignment tricks for good
+ performance. This test tries to make sure it works correctly and
+ does not access bytes beyond the source and destination
+ strings. */
+
+/* { dg-do run } */
+/* { dg-require-effective-target vector } */
+/* { dg-options "-O3 -mzarch -march=z13" } */
+
+#include <stdio.h>
+#include <sys/mman.h>
+
+#define PAGE_SIZE 4096
+
+struct {
+ char unused[PAGE_SIZE - 32];
+ char m32[15]; /* page bndry - 32 */
+ char m17[1];
+ char m16[1];
+ char m15[14];
+ char m1[1];
+ char next_page[PAGE_SIZE];
+} s, d __attribute__((aligned(PAGE_SIZE)));
+
+char *__attribute__((noinline))
+my_stpcpy(char *dest, const char *src)
+{
+ return __builtin_stpcpy (dest, src);
+}
+
+void __attribute__ ((noinline))
+check (char *dest, char *src, size_t len)
+{
+ char *result;
+
+ result = my_stpcpy (dest, src);
+ if (result != dest + len)
+ __builtin_abort ();
+ if (__builtin_memcmp (src, dest, len) != 0)
+ __builtin_abort ();
+}
+
+int
+main ()
+{
+ char *src[5] = { s.m32, s.m17, s.m16, s.m15, s.m1 };
+ char *dst[5] = { d.m32, d.m17, d.m16, d.m15, d.m1 };
+ int len[8] = { 33, 32, 31, 17, 16, 15, 1, 0 };
+ int i, j, k;
+ char backup;
+
+ for (i = 0; i < sizeof (s); i++)
+ ((char*)&s)[i] = i % 26 + 97;
+
+ for (i = 0; i < 5; i++)
+ for (j = 0; j < 5; j++)
+ for (k = 0; k < 8; k++)
+ {
+ backup = src[j][len[k]];
+ src[j][len[k]] = 0;
+ __builtin_memset (&d, 0, sizeof (d));
+ check (dst[i], src[j], len[k]);
+ src[j][len[k]] = backup;
+ }
+
+ /* Make all source strings end before the page boundary. */
+ backup = s.m1[0];
+ s.m1[0] = 0;
+
+ if (mprotect (&s.next_page, PAGE_SIZE, PROT_NONE) == -1)
+ perror ("mprotect src");
+
+ for (i = 0; i < 5; i++)
+ for (j = 0; j < 5; j++)
+ check (dst[i], src[j],
+ PAGE_SIZE - ((unsigned long)src[j] & ((1UL << 12) - 1)) - 1);
+
+ if (mprotect (&s.next_page, PAGE_SIZE, PROT_READ | PROT_WRITE) == -1)
+ perror ("mprotect src");
+
+ s.m1[0] = backup;
+
+ if (mprotect (&d.next_page, PAGE_SIZE, PROT_NONE) == -1)
+ perror ("mprotect dst");
+
+ for (i = 0; i < 5; i++)
+ for (j = 0; j < 5; j++)
+ {
+ int len = PAGE_SIZE - ((unsigned long)dst[i] & ((1UL << 12) - 1)) - 1;
+ char backup = src[j][len];
+
+ src[j][len] = 0;
+ __builtin_memset (&d, 0,
+ (unsigned long)&d.next_page - (unsigned long)&d);
+ check (dst[i], src[j], len);
+ src[j][len] = backup;
+ }
+
+ return 0;
+}
--
1.9.1
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-02-23 10:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-23 10:20 [Committed 0/3] S/390: Move recently added testcases to correct subdirs Andreas Krebbel
2016-02-23 10:20 ` [Committed 2/3] S/390: Move movstr-2.c into vector subdir Andreas Krebbel
2016-02-23 10:20 ` [Committed 3/3] S/390: Move vcond-shift.c to " Andreas Krebbel
2016-02-23 10:20 ` [Committed 1/3] S/390: Turn movstr-1.c into compile only test Andreas Krebbel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).