IBM Z: Test long doubles in vector registers
authorIlya Leoshkevich <iii@linux.ibm.com>
Tue, 28 Apr 2020 11:16:07 +0000 (13:16 +0200)
committerIlya Leoshkevich <iii@linux.ibm.com>
Tue, 10 Nov 2020 11:13:38 +0000 (12:13 +0100)
gcc/testsuite/ChangeLog:

2020-11-05  Ilya Leoshkevich  <iii@linux.ibm.com>

* gcc.target/s390/vector/long-double-callee-abi-scan.c: New test.
* gcc.target/s390/vector/long-double-caller-abi-run.c: New test.
* gcc.target/s390/vector/long-double-caller-abi-scan.c: New test.
* gcc.target/s390/vector/long-double-copysign.c: New test.
* gcc.target/s390/vector/long-double-fprx2-constant.c: New test.
* gcc.target/s390/vector/long-double-from-double.c: New test.
* gcc.target/s390/vector/long-double-from-float.c: New test.
* gcc.target/s390/vector/long-double-from-i16.c: New test.
* gcc.target/s390/vector/long-double-from-i32.c: New test.
* gcc.target/s390/vector/long-double-from-i64.c: New test.
* gcc.target/s390/vector/long-double-from-i8.c: New test.
* gcc.target/s390/vector/long-double-from-u16.c: New test.
* gcc.target/s390/vector/long-double-from-u32.c: New test.
* gcc.target/s390/vector/long-double-from-u64.c: New test.
* gcc.target/s390/vector/long-double-from-u8.c: New test.
* gcc.target/s390/vector/long-double-to-double.c: New test.
* gcc.target/s390/vector/long-double-to-float.c: New test.
* gcc.target/s390/vector/long-double-to-i16.c: New test.
* gcc.target/s390/vector/long-double-to-i32.c: New test.
* gcc.target/s390/vector/long-double-to-i64.c: New test.
* gcc.target/s390/vector/long-double-to-i8.c: New test.
* gcc.target/s390/vector/long-double-to-u16.c: New test.
* gcc.target/s390/vector/long-double-to-u32.c: New test.
* gcc.target/s390/vector/long-double-to-u64.c: New test.
* gcc.target/s390/vector/long-double-to-u8.c: New test.
* gcc.target/s390/vector/long-double-vec-duplicate.c: New test.
* gcc.target/s390/vector/long-double-wf.h: New test.
* gcc.target/s390/vector/long-double-wfaxb.c: New test.
* gcc.target/s390/vector/long-double-wfcxb-0001.c: New test.
* gcc.target/s390/vector/long-double-wfcxb-0111.c: New test.
* gcc.target/s390/vector/long-double-wfcxb-1011.c: New test.
* gcc.target/s390/vector/long-double-wfcxb-1101.c: New test.
* gcc.target/s390/vector/long-double-wfdxb.c: New test.
* gcc.target/s390/vector/long-double-wfixb.c: New test.
* gcc.target/s390/vector/long-double-wfkxb-0111.c: New test.
* gcc.target/s390/vector/long-double-wfkxb-1011.c: New test.
* gcc.target/s390/vector/long-double-wfkxb-1101.c: New test.
* gcc.target/s390/vector/long-double-wflcxb.c: New test.
* gcc.target/s390/vector/long-double-wflpxb.c: New test.
* gcc.target/s390/vector/long-double-wfmaxb-2.c: New test.
* gcc.target/s390/vector/long-double-wfmaxb-3.c: New test.
* gcc.target/s390/vector/long-double-wfmaxb-disabled.c: New test.
* gcc.target/s390/vector/long-double-wfmaxb.c: New test.
* gcc.target/s390/vector/long-double-wfmsxb-disabled.c: New test.
* gcc.target/s390/vector/long-double-wfmsxb.c: New test.
* gcc.target/s390/vector/long-double-wfmxb.c: New test.
* gcc.target/s390/vector/long-double-wfnmaxb-disabled.c: New test.
* gcc.target/s390/vector/long-double-wfnmaxb.c: New test.
* gcc.target/s390/vector/long-double-wfnmsxb-disabled.c: New test.
* gcc.target/s390/vector/long-double-wfnmsxb.c: New test.
* gcc.target/s390/vector/long-double-wfsqxb.c: New test.
* gcc.target/s390/vector/long-double-wfsxb-1.c: New test.
* gcc.target/s390/vector/long-double-wfsxb.c: New test.
* gcc.target/s390/vector/long-double-wftcixb-1.c: New test.
* gcc.target/s390/vector/long-double-wftcixb.c: New test.

55 files changed:
gcc/testsuite/gcc.target/s390/vector/long-double-callee-abi-scan.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-caller-abi-run.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-caller-abi-scan.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-copysign.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-fprx2-constant.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-from-double.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-from-float.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-from-i16.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-from-i32.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-from-i64.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-from-i8.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-from-u16.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-from-u32.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-from-u64.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-from-u8.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-to-double.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-to-float.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-to-i16.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-to-i32.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-to-i64.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-to-i8.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-to-u16.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-to-u32.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-to-u64.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-to-u8.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-vec-duplicate.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-wf.h [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-wfaxb.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-wfcxb-0001.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-wfcxb-0111.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-wfcxb-1011.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-wfcxb-1101.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-wfdxb.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-wfixb.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-wfkxb-0111.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-wfkxb-1011.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-wfkxb-1101.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-wflcxb.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-wflpxb.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-wfmaxb-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-wfmaxb-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-wfmaxb-disabled.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-wfmaxb.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-wfmsxb-disabled.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-wfmsxb.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-wfmxb.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-wfnmaxb-disabled.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-wfnmaxb.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-wfnmsxb-disabled.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-wfnmsxb.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-wfsqxb.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-wfsxb-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-wfsxb.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-wftcixb-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-wftcixb.c [new file with mode: 0644]

diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-callee-abi-scan.c b/gcc/testsuite/gcc.target/s390/vector/long-double-callee-abi-scan.c
new file mode 100644 (file)
index 0000000..69e8c61
--- /dev/null
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzarch -fno-unroll-loops" } */
+#include <stdarg.h>
+
+__attribute__ ((noipa, used)) long double
+long_double_callee (long double x, int n, ...)
+{
+  long double sum = x;
+  va_list vl;
+  int i;
+
+  va_start (vl, n);
+  for (i = 0; i < n; i++)
+    sum += va_arg (vl, long double);
+  va_end (vl);
+
+  return sum;
+}
+
+/* { dg-final { scan-assembler-times {\n\tvl\t} 3 } } */
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-caller-abi-run.c b/gcc/testsuite/gcc.target/s390/vector/long-double-caller-abi-run.c
new file mode 100644 (file)
index 0000000..f3a41ba
--- /dev/null
@@ -0,0 +1,4 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzarch" } */
+#include "long-double-callee-abi-scan.c"
+#include "long-double-caller-abi-scan.c"
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-caller-abi-scan.c b/gcc/testsuite/gcc.target/s390/vector/long-double-caller-abi-scan.c
new file mode 100644 (file)
index 0000000..c1ec5b1
--- /dev/null
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzarch" } */
+#include <assert.h>
+
+long double long_double_callee (long double x, int n, ...);
+
+int
+main ()
+{
+  assert (long_double_callee (1.L, 2, 2.L, 3.L) == 6.L);
+}
+
+/* { dg-final { scan-assembler-times {\n\tvst\t} 3 } } */
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-copysign.c b/gcc/testsuite/gcc.target/s390/vector/long-double-copysign.c
new file mode 100644 (file)
index 0000000..3115195
--- /dev/null
@@ -0,0 +1,21 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzarch --save-temps" } */
+#include <assert.h>
+#include <stdint.h>
+
+__attribute__ ((noipa)) static long double
+long_double_copysign (long double x, long double y)
+{
+  return __builtin_copysignl (x, y);
+}
+
+/* { dg-final { scan-assembler-times {\n\tvsel\t} 1 } } */
+
+int
+main (void)
+{
+  assert (long_double_copysign (1.1L, 2.2L) == 1.1L);
+  assert (long_double_copysign (1.1L, -2.2L) == -1.1L);
+  assert (long_double_copysign (-1.1L, 2.2L) == 1.1L);
+  assert (long_double_copysign (-1.1L, -2.2L) == -1.1L);
+}
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-fprx2-constant.c b/gcc/testsuite/gcc.target/s390/vector/long-double-fprx2-constant.c
new file mode 100644 (file)
index 0000000..02a6a1f
--- /dev/null
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mtune=z14 -funroll-loops" } */
+
+long double a;
+int d;
+void
+b ()
+{
+  for (int c = 0; c < d; ++c)
+    a = (a - c) / (c + 1);
+}
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-from-double.c b/gcc/testsuite/gcc.target/s390/vector/long-double-from-double.c
new file mode 100644 (file)
index 0000000..5eb31f8
--- /dev/null
@@ -0,0 +1,18 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzarch --save-temps" } */
+#include <assert.h>
+
+__attribute__ ((noipa)) static long double
+long_double_from_double (double x)
+{
+  return x;
+}
+
+/* { dg-final { scan-assembler-times {\n\twflld\t} 1 } } */
+
+int
+main (void)
+{
+  assert (long_double_from_double (42.) == 42.L);
+  assert (long_double_from_double (-42.) == -42.L);
+}
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-from-float.c b/gcc/testsuite/gcc.target/s390/vector/long-double-from-float.c
new file mode 100644 (file)
index 0000000..0449f0c
--- /dev/null
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzarch --save-temps" } */
+#include <assert.h>
+
+__attribute__ ((noipa)) static long double
+long_double_from_float (float x)
+{
+  return x;
+}
+
+/* { dg-final { scan-assembler-times {\n\tldebr\t} 1 } } */
+/* { dg-final { scan-assembler-times {\n\twflld\t} 1 } } */
+
+int
+main (void)
+{
+  assert (long_double_from_float (42.F) == 42.L);
+  assert (long_double_from_float (-42.F) == -42.L);
+}
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-from-i16.c b/gcc/testsuite/gcc.target/s390/vector/long-double-from-i16.c
new file mode 100644 (file)
index 0000000..68b164d
--- /dev/null
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzarch --save-temps" } */
+#include <assert.h>
+#include <stdint.h>
+
+__attribute__ ((noipa)) static long double
+long_double_from_i16 (int16_t x)
+{
+  return x;
+}
+
+/* { dg-final { scan-assembler-times {\n\tcxfbr\t} 1 } } */
+
+int
+main (void)
+{
+  assert (long_double_from_i16 (42) == 42.L);
+  assert (long_double_from_i16 (-42) == -42.L);
+}
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-from-i32.c b/gcc/testsuite/gcc.target/s390/vector/long-double-from-i32.c
new file mode 100644 (file)
index 0000000..ad8443b
--- /dev/null
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzarch --save-temps" } */
+#include <assert.h>
+#include <stdint.h>
+
+__attribute__ ((noipa)) static long double
+long_double_from_i32 (int32_t x)
+{
+  return x;
+}
+
+/* { dg-final { scan-assembler-times {\n\tcxfbr\t} 1 } } */
+
+int
+main (void)
+{
+  assert (long_double_from_i32 (42) == 42.L);
+  assert (long_double_from_i32 (-42) == -42.L);
+}
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-from-i64.c b/gcc/testsuite/gcc.target/s390/vector/long-double-from-i64.c
new file mode 100644 (file)
index 0000000..3d2c424
--- /dev/null
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzarch --save-temps" } */
+#include <assert.h>
+#include <stdint.h>
+
+__attribute__ ((noipa)) static long double
+long_double_from_i64 (int64_t x)
+{
+  return x;
+}
+
+/* { dg-final { scan-assembler-times {\n\tcxgbr\t} 1 } } */
+
+int
+main (void)
+{
+  assert (long_double_from_i64 (42) == 42.L);
+  assert (long_double_from_i64 (-42) == -42.L);
+}
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-from-i8.c b/gcc/testsuite/gcc.target/s390/vector/long-double-from-i8.c
new file mode 100644 (file)
index 0000000..44c8c9d
--- /dev/null
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzarch --save-temps" } */
+#include <assert.h>
+#include <stdint.h>
+
+__attribute__ ((noipa)) static long double
+long_double_from_i8 (int8_t x)
+{
+  return x;
+}
+
+/* { dg-final { scan-assembler-times {\n\tcxfbr\t} 1 } } */
+
+int
+main (void)
+{
+  assert (long_double_from_i8 (42) == 42.L);
+  assert (long_double_from_i8 (-42) == -42.L);
+}
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-from-u16.c b/gcc/testsuite/gcc.target/s390/vector/long-double-from-u16.c
new file mode 100644 (file)
index 0000000..f10c298
--- /dev/null
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzarch --save-temps" } */
+#include <assert.h>
+#include <stdint.h>
+
+__attribute__ ((noipa)) static long double
+long_double_from_u16 (uint16_t x)
+{
+  return x;
+}
+
+/* { dg-final { scan-assembler-times {\n\tcxlfbr\t} 1 } } */
+
+int
+main (void)
+{
+  assert (long_double_from_u16 (42) == 42.L);
+  assert (long_double_from_u16 (-42) == 65494.L);
+}
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-from-u32.c b/gcc/testsuite/gcc.target/s390/vector/long-double-from-u32.c
new file mode 100644 (file)
index 0000000..2763fb4
--- /dev/null
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzarch --save-temps" } */
+#include <assert.h>
+#include <stdint.h>
+
+__attribute__ ((noipa)) static long double
+long_double_from_u32 (uint32_t x)
+{
+  return x;
+}
+
+/* { dg-final { scan-assembler-times {\n\tcxlfbr\t} 1 } } */
+
+int
+main (void)
+{
+  assert (long_double_from_u32 (42) == 42.L);
+  assert (long_double_from_u32 (-42) == 4294967254.L);
+}
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-from-u64.c b/gcc/testsuite/gcc.target/s390/vector/long-double-from-u64.c
new file mode 100644 (file)
index 0000000..4686dfd
--- /dev/null
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzarch --save-temps" } */
+#include <assert.h>
+#include <stdint.h>
+
+__attribute__ ((noipa)) static long double
+long_double_from_u64 (uint64_t x)
+{
+  return x;
+}
+
+/* { dg-final { scan-assembler-times {\n\tcxlgbr\t} 1 } } */
+
+int
+main (void)
+{
+  assert (long_double_from_u64 (42) == 42.L);
+  assert (long_double_from_u64 (-42) == 18446744073709551574.L);
+}
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-from-u8.c b/gcc/testsuite/gcc.target/s390/vector/long-double-from-u8.c
new file mode 100644 (file)
index 0000000..3e6eb92
--- /dev/null
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzarch --save-temps" } */
+#include <assert.h>
+#include <stdint.h>
+
+__attribute__ ((noipa)) static long double
+long_double_from_u8 (uint8_t x)
+{
+  return x;
+}
+
+/* { dg-final { scan-assembler-times {\n\tcxlfbr\t} 1 } } */
+
+int
+main (void)
+{
+  assert (long_double_from_u8 (42) == 42.L);
+  assert (long_double_from_u8 (-42) == 214.L);
+}
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-to-double.c b/gcc/testsuite/gcc.target/s390/vector/long-double-to-double.c
new file mode 100644 (file)
index 0000000..88aa053
--- /dev/null
@@ -0,0 +1,18 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzarch --save-temps" } */
+#include <assert.h>
+
+__attribute__ ((noipa)) static double
+long_double_to_double (long double x)
+{
+  return x;
+}
+
+/* { dg-final { scan-assembler-times {\n\twflrx\t} 1 } } */
+
+int
+main (void)
+{
+  assert (long_double_to_double (42.L) == 42.);
+  assert (long_double_to_double (-42.L) == -42.);
+}
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-to-float.c b/gcc/testsuite/gcc.target/s390/vector/long-double-to-float.c
new file mode 100644 (file)
index 0000000..36fd429
--- /dev/null
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzarch --save-temps" } */
+#include <assert.h>
+
+__attribute__ ((noipa)) static float
+long_double_to_float (long double x)
+{
+  return x;
+}
+
+/* { dg-final { scan-assembler-times {\n\twflrx\t%v\d+,%v\d+,0,3\n} 1 } } */
+/* { dg-final { scan-assembler-times {\n\tledbr\t} 1 } } */
+
+int
+main (void)
+{
+  assert (long_double_to_float (42.L) == 42.F);
+  assert (long_double_to_float (-42.L) == -42.F);
+}
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-to-i16.c b/gcc/testsuite/gcc.target/s390/vector/long-double-to-i16.c
new file mode 100644 (file)
index 0000000..ddfc668
--- /dev/null
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzarch --save-temps" } */
+#include <assert.h>
+#include <stdint.h>
+
+__attribute__ ((noipa)) static int16_t
+long_double_to_i16 (long double x)
+{
+  return x;
+}
+
+/* { dg-final { scan-assembler-times {\n\tcfxbr\t} 1 } } */
+
+int
+main (void)
+{
+  assert (long_double_to_i16 (42.L) == 42);
+  assert (long_double_to_i16 (-42.L) == -42);
+}
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-to-i32.c b/gcc/testsuite/gcc.target/s390/vector/long-double-to-i32.c
new file mode 100644 (file)
index 0000000..975a5de
--- /dev/null
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzarch --save-temps" } */
+#include <assert.h>
+#include <stdint.h>
+
+__attribute__ ((noipa)) static int32_t
+long_double_to_i32 (long double x)
+{
+  return x;
+}
+
+/* { dg-final { scan-assembler-times {\n\tcfxbr\t} 1 } } */
+
+int
+main (void)
+{
+  assert (long_double_to_i32 (42.L) == 42);
+  assert (long_double_to_i32 (-42.L) == -42);
+}
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-to-i64.c b/gcc/testsuite/gcc.target/s390/vector/long-double-to-i64.c
new file mode 100644 (file)
index 0000000..6bd5079
--- /dev/null
@@ -0,0 +1,21 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzarch --save-temps" } */
+#include <assert.h>
+#include <stdint.h>
+
+__attribute__ ((noipa)) static int64_t
+long_double_to_i64 (long double x)
+{
+  return x;
+}
+
+/* { dg-final { scan-assembler-times {\n\tvpdi\t%v\d+,%v\d+,%v\d+,1\n} 1 } } */
+/* { dg-final { scan-assembler-times {\n\tvpdi\t%v\d+,%v\d+,%v\d+,5\n} 1 } } */
+/* { dg-final { scan-assembler-times {\n\tcgxbr\t} 1 } } */
+
+int
+main (void)
+{
+  assert (long_double_to_i64 (42.L) == 42);
+  assert (long_double_to_i64 (-42.L) == -42);
+}
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-to-i8.c b/gcc/testsuite/gcc.target/s390/vector/long-double-to-i8.c
new file mode 100644 (file)
index 0000000..46e6d6b
--- /dev/null
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzarch --save-temps" } */
+#include <assert.h>
+#include <stdint.h>
+
+__attribute__ ((noipa)) static int8_t
+long_double_to_i8 (long double x)
+{
+  return x;
+}
+
+/* { dg-final { scan-assembler-times {\n\tcfxbr\t} 1 } } */
+
+int
+main (void)
+{
+  assert (long_double_to_i8 (42.L) == 42);
+  assert (long_double_to_i8 (-42.L) == -42);
+}
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-to-u16.c b/gcc/testsuite/gcc.target/s390/vector/long-double-to-u16.c
new file mode 100644 (file)
index 0000000..0690f3d
--- /dev/null
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzarch --save-temps" } */
+#include <assert.h>
+#include <stdint.h>
+
+__attribute__ ((noipa)) static uint16_t
+long_double_to_u16 (long double x)
+{
+  return x;
+}
+
+/* { dg-final { scan-assembler-times {\n\tclfxbr\t} 1 } } */
+
+int
+main (void)
+{
+  assert (long_double_to_u16 (42.L) == 42);
+  /* Not (-42 & 0xffff) due to loss of precision.  */
+  assert (long_double_to_u16 (-42.L) == 0);
+}
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-to-u32.c b/gcc/testsuite/gcc.target/s390/vector/long-double-to-u32.c
new file mode 100644 (file)
index 0000000..aa0e318
--- /dev/null
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzarch --save-temps" } */
+#include <assert.h>
+#include <stdint.h>
+
+__attribute__ ((noipa)) static uint32_t
+long_double_to_u32 (long double x)
+{
+  return x;
+}
+
+/* { dg-final { scan-assembler-times {\n\tclfxbr\t} 1 } } */
+
+int
+main (void)
+{
+  assert (long_double_to_u32 (42.L) == 42);
+  /* Not (-42 & 0xffffffff) due to loss of precision.  */
+  assert (long_double_to_u32 (-42.L) == 0);
+}
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-to-u64.c b/gcc/testsuite/gcc.target/s390/vector/long-double-to-u64.c
new file mode 100644 (file)
index 0000000..e37b65e
--- /dev/null
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzarch --save-temps" } */
+#include <assert.h>
+#include <stdint.h>
+
+__attribute__ ((noipa)) static uint64_t
+long_double_to_u64 (long double x)
+{
+  return x;
+}
+
+/* { dg-final { scan-assembler-times {\n\tclgxbr\t} 1 } } */
+
+int
+main (void)
+{
+  assert (long_double_to_u64 (42.L) == 42);
+  /* Not (-42 & 0xffffffffffffffff) due to loss of precision.  */
+  assert (long_double_to_u64 (-42.L) == 0);
+}
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-to-u8.c b/gcc/testsuite/gcc.target/s390/vector/long-double-to-u8.c
new file mode 100644 (file)
index 0000000..bddbff8
--- /dev/null
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzarch --save-temps" } */
+#include <assert.h>
+#include <stdint.h>
+
+__attribute__ ((noipa)) static uint8_t
+long_double_to_u8 (long double x)
+{
+  return x;
+}
+
+/* { dg-final { scan-assembler-times {\n\tclfxbr\t} 1 } } */
+
+int
+main (void)
+{
+  assert (long_double_to_u8 (42.L) == 42);
+  /* Not (-42 & 0xff) due to loss of precision.  */
+  assert (long_double_to_u8 (-42.L) == 0);
+}
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-vec-duplicate.c b/gcc/testsuite/gcc.target/s390/vector/long-double-vec-duplicate.c
new file mode 100644 (file)
index 0000000..2ce9da3
--- /dev/null
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -funroll-loops -march=z14 -mtune=z14" } */
+
+long double a, b;
+double *c;
+long double *d;
+
+void
+e ()
+{
+  while (d != &a)
+    *d++ = b * *c++;
+}
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-wf.h b/gcc/testsuite/gcc.target/s390/vector/long-double-wf.h
new file mode 100644 (file)
index 0000000..a564fc6
--- /dev/null
@@ -0,0 +1,60 @@
+#ifndef LONG_DOUBLE_WF_H
+#define LONG_DOUBLE_WF_H 1
+
+#include <math.h>
+
+#define ADD(x, y, z) ((x) + (z))
+#define DIV(x, y, z) ((x) / (z))
+#define FABSL(x, y, z) (fabsl (y))
+#define ISINFL(x, y, z) (isinfl (x) ? (y) : (z))
+#define MUL(x, y, z) ((x) * (z))
+#define MUL_ADD(x, y, z) ((x) * (y) + (z))
+#define MUL_SUB(x, y, z) ((x) * (y) - (z))
+#define NEG(x, y, z)                                                          \
+  ({                                                                          \
+    volatile long double r = -(y);                                            \
+    r;                                                                        \
+  })
+#define NEG_MUL_ADD(x, y, z) NEG (0, MUL_ADD (x, y, z), 0)
+#define NEG_MUL_SUB(x, y, z) NEG (0, MUL_SUB (x, y, z), 0)
+#define QUIET_IFEQUAL(x, y, z) ((x) == (y) ? (z) : 0)
+#define QUIET_IFGREATER(x, y, z) (__builtin_isgreater (x, y) ? (z) : 0)
+#define QUIET_IFLESS(x, y, z) (__builtin_isless (x, y) ? (z) : 0)
+#define QUIET_IFUNORDERED(x, y, z) (__builtin_isunordered (x, y) ? (z) : 0)
+#define SIGNALING_IFEQUAL(x, y, z) (((x) >= (y) && (x) <= (y)) ? (z) : 0)
+#define SIGNALING_IFGREATER(x, y, z) ((x) > (y) ? (z) : 0)
+#define SIGNALING_IFLESS(x, y, z) ((x) < (y) ? (z) : 0)
+#define ROUNDL(x, y, z) (roundl (y))
+#define SQRTL(x, y, z) (sqrtl (y))
+#define SUB(x, y, z) ((x) - (z))
+
+#define LONG_DOUBLE_WF(op)                                                    \
+  long double test (                                                          \
+      long double x0, long double x1, long double x2, long double x3,         \
+      long double x4, long double x5, long double x6, long double x7,         \
+      long double x8, long double x9, long double x10, long double x11,       \
+      long double x12, long double x13, long double x14, long double x15)     \
+  {                                                                           \
+    while (x15 < 1E+30)                                                       \
+      {                                                                       \
+       x0 = op (x1, x2, x3);                                                 \
+       x1 = op (x2, x3, x4) + 1;                                             \
+       x2 = op (x3, x4, x5) + 2;                                             \
+       x3 = op (x4, x5, x6) + 3;                                             \
+       x4 = op (x5, x6, x7) + 4;                                             \
+       x5 = op (x6, x7, x8) + 5;                                             \
+       x6 = op (x7, x8, x9) + 6;                                             \
+       x7 = op (x8, x9, x10) + 7;                                            \
+       x8 = op (x9, x10, x11) + 8;                                           \
+       x9 = op (x10, x11, x12) + 9;                                          \
+       x10 = op (x11, x12, x13) + 10;                                        \
+       x11 = op (x12, x13, x14) + 11;                                        \
+       x12 = op (x13, x14, x15) + 12;                                        \
+       x13 = op (x14, x15, x0) + 13;                                         \
+       x14 = op (x15, x0, x1) + 14;                                          \
+       x15 = op (x0, x1, x2) + 15;                                           \
+      }                                                                       \
+    return x15;                                                               \
+  }
+
+#endif
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-wfaxb.c b/gcc/testsuite/gcc.target/s390/vector/long-double-wfaxb.c
new file mode 100644 (file)
index 0000000..1b35c1c
--- /dev/null
@@ -0,0 +1,17 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzarch --save-temps" } */
+#include <assert.h>
+
+__attribute__ ((noipa)) static long double
+wfaxb (long double x, long double y, long double z)
+{
+  return x + y + z;
+}
+
+/* { dg-final { scan-assembler-times {\n\twfaxb\t} 2 } } */
+
+int
+main (void)
+{
+  assert (wfaxb (1.11L, 2.22L, 3.33L) == 6.66L);
+}
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-wfcxb-0001.c b/gcc/testsuite/gcc.target/s390/vector/long-double-wfcxb-0001.c
new file mode 100644 (file)
index 0000000..9ffff6f
--- /dev/null
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzarch" } */
+#include "long-double-wf.h"
+
+LONG_DOUBLE_WF (QUIET_IFUNORDERED);
+
+/* { dg-final { scan-assembler {\n\twfcxb\t} } } */
+/* jo == brc 0b0001, ...  */
+/* { dg-final { scan-assembler {\n\tjo\t} } } */
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-wfcxb-0111.c b/gcc/testsuite/gcc.target/s390/vector/long-double-wfcxb-0111.c
new file mode 100644 (file)
index 0000000..3ade835
--- /dev/null
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzarch" } */
+#include "long-double-wf.h"
+
+LONG_DOUBLE_WF (QUIET_IFEQUAL);
+
+/* { dg-final { scan-assembler {\n\twfcxb\t} } } */
+/* jne == brc 0b0111, ...  */
+/* { dg-final { scan-assembler {\n\tjne\t} } } */
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-wfcxb-1011.c b/gcc/testsuite/gcc.target/s390/vector/long-double-wfcxb-1011.c
new file mode 100644 (file)
index 0000000..a9c819d
--- /dev/null
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzarch" } */
+#include "long-double-wf.h"
+
+LONG_DOUBLE_WF (QUIET_IFLESS);
+
+/* { dg-final { scan-assembler {\n\twfcxb\t} } } */
+/* jnl == brc 0b1011, ...  */
+/* { dg-final { scan-assembler {\n\tjnl\t} } } */
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-wfcxb-1101.c b/gcc/testsuite/gcc.target/s390/vector/long-double-wfcxb-1101.c
new file mode 100644 (file)
index 0000000..47ea7c7
--- /dev/null
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzarch" } */
+#include "long-double-wf.h"
+
+LONG_DOUBLE_WF (QUIET_IFGREATER);
+
+/* { dg-final { scan-assembler {\n\twfcxb\t} } } */
+/* jnh == brc 0b1101, ...  */
+/* { dg-final { scan-assembler {\n\tjnh\t} } } */
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-wfdxb.c b/gcc/testsuite/gcc.target/s390/vector/long-double-wfdxb.c
new file mode 100644 (file)
index 0000000..16b4893
--- /dev/null
@@ -0,0 +1,17 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzarch --save-temps" } */
+#include <assert.h>
+
+__attribute__ ((noipa)) static long double
+wfdxb (long double x, long double y, long double z)
+{
+  return (x / y) / z;
+}
+
+/* { dg-final { scan-assembler-times {\n\twfdxb\t} 2 } } */
+
+int
+main (void)
+{
+  assert (wfdxb (2.22L, 1.11L, 2.L) == 1.L);
+}
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-wfixb.c b/gcc/testsuite/gcc.target/s390/vector/long-double-wfixb.c
new file mode 100644 (file)
index 0000000..69348bd
--- /dev/null
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzarch" } */
+#include "long-double-wf.h"
+
+LONG_DOUBLE_WF (ROUNDL);
+
+/* { dg-final { scan-assembler {\n\twfixb\t} } } */
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-wfkxb-0111.c b/gcc/testsuite/gcc.target/s390/vector/long-double-wfkxb-0111.c
new file mode 100644 (file)
index 0000000..0f7b209
--- /dev/null
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzarch" } */
+#include "long-double-wf.h"
+
+LONG_DOUBLE_WF (SIGNALING_IFEQUAL);
+
+/* { dg-final { scan-assembler {\n\twfkxb\t} } } */
+/* jne == brc 0b0111, ...  */
+/* { dg-final { scan-assembler {\n\tjne\t} } } */
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-wfkxb-1011.c b/gcc/testsuite/gcc.target/s390/vector/long-double-wfkxb-1011.c
new file mode 100644 (file)
index 0000000..b76dbb0
--- /dev/null
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzarch" } */
+#include "long-double-wf.h"
+
+LONG_DOUBLE_WF (SIGNALING_IFLESS);
+
+/* { dg-final { scan-assembler {\n\twfkxb\t} } } */
+/* jnl == brc 0b1011, ...  */
+/* { dg-final { scan-assembler {\n\tjnl\t} } } */
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-wfkxb-1101.c b/gcc/testsuite/gcc.target/s390/vector/long-double-wfkxb-1101.c
new file mode 100644 (file)
index 0000000..61f0ec4
--- /dev/null
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzarch" } */
+#include "long-double-wf.h"
+
+LONG_DOUBLE_WF (SIGNALING_IFGREATER);
+
+/* { dg-final { scan-assembler {\n\twfkxb\t} } } */
+/* jnh == brc 0b1101, ...  */
+/* { dg-final { scan-assembler {\n\tjnh\t} } } */
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-wflcxb.c b/gcc/testsuite/gcc.target/s390/vector/long-double-wflcxb.c
new file mode 100644 (file)
index 0000000..ddcf972
--- /dev/null
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzarch" } */
+#include "long-double-wf.h"
+
+LONG_DOUBLE_WF (NEG);
+
+/* { dg-final { scan-assembler {\n\twflcxb\t} } } */
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-wflpxb.c b/gcc/testsuite/gcc.target/s390/vector/long-double-wflpxb.c
new file mode 100644 (file)
index 0000000..df90505
--- /dev/null
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzarch" } */
+#include "long-double-wf.h"
+
+LONG_DOUBLE_WF (FABSL);
+
+/* { dg-final { scan-assembler {\n\twflpxb\t} } } */
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-wfmaxb-2.c b/gcc/testsuite/gcc.target/s390/vector/long-double-wfmaxb-2.c
new file mode 100644 (file)
index 0000000..0b2fdcc
--- /dev/null
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzarch -mvx-long-double-fma" } */
+
+int a, c, d, f, k, l, m;
+long double b, e, g, h, i;
+double j;
+
+void
+n (void)
+{
+  while (m)
+    {
+      a = b * d;
+      b = c;
+      c = d * e + 2;
+      e = f + g + 4;
+      f = h + 6;
+      g = h * 0 + i + 7;
+      h = i + 9;
+      i = j * k + 0 + 10;
+      j = l;
+      m = a * b;
+    }
+}
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-wfmaxb-3.c b/gcc/testsuite/gcc.target/s390/vector/long-double-wfmaxb-3.c
new file mode 100644 (file)
index 0000000..9ef49c1
--- /dev/null
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzarch -mvx-long-double-fma" } */
+
+long double a, c, d;
+int b;
+void
+e (void)
+{
+  while (d)
+    {
+      a = 0 * c + 0;
+      d = b;
+    }
+}
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-wfmaxb-disabled.c b/gcc/testsuite/gcc.target/s390/vector/long-double-wfmaxb-disabled.c
new file mode 100644 (file)
index 0000000..59bc80a
--- /dev/null
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzarch" } */
+#include "long-double-wf.h"
+
+LONG_DOUBLE_WF (MUL_ADD);
+
+/* { dg-final { scan-assembler {\n\twfmxb\t} } } */
+/* { dg-final { scan-assembler {\n\twfaxb\t} } } */
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-wfmaxb.c b/gcc/testsuite/gcc.target/s390/vector/long-double-wfmaxb.c
new file mode 100644 (file)
index 0000000..319a02f
--- /dev/null
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzarch -mvx-long-double-fma" } */
+#include "long-double-wf.h"
+
+LONG_DOUBLE_WF (MUL_ADD);
+
+/* { dg-final { scan-assembler {\n\twfmaxb\t} } } */
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-wfmsxb-disabled.c b/gcc/testsuite/gcc.target/s390/vector/long-double-wfmsxb-disabled.c
new file mode 100644 (file)
index 0000000..bb5c0f2
--- /dev/null
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzarch" } */
+#include "long-double-wf.h"
+
+LONG_DOUBLE_WF (MUL_SUB);
+
+/* { dg-final { scan-assembler {\n\twfmxb\t} } } */
+/* { dg-final { scan-assembler {\n\twfsxb\t} } } */
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-wfmsxb.c b/gcc/testsuite/gcc.target/s390/vector/long-double-wfmsxb.c
new file mode 100644 (file)
index 0000000..c14f673
--- /dev/null
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzarch -mvx-long-double-fma" } */
+#include "long-double-wf.h"
+
+LONG_DOUBLE_WF (MUL_SUB);
+
+/* { dg-final { scan-assembler {\n\twfmsxb\t} } } */
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-wfmxb.c b/gcc/testsuite/gcc.target/s390/vector/long-double-wfmxb.c
new file mode 100644 (file)
index 0000000..6ab1e68
--- /dev/null
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzarch" } */
+#include "long-double-wf.h"
+
+LONG_DOUBLE_WF (MUL);
+
+/* { dg-final { scan-assembler {\n\twfmxb\t} } } */
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-wfnmaxb-disabled.c b/gcc/testsuite/gcc.target/s390/vector/long-double-wfnmaxb-disabled.c
new file mode 100644 (file)
index 0000000..8c5298e
--- /dev/null
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzarch" } */
+#include "long-double-wf.h"
+
+LONG_DOUBLE_WF (NEG_MUL_ADD);
+
+/* { dg-final { scan-assembler {\n\twfmxb\t} } } */
+/* { dg-final { scan-assembler {\n\twfaxb\t} } } */
+/* { dg-final { scan-assembler {\n\twflcxb\t} } } */
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-wfnmaxb.c b/gcc/testsuite/gcc.target/s390/vector/long-double-wfnmaxb.c
new file mode 100644 (file)
index 0000000..9f0da13
--- /dev/null
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzarch -mvx-long-double-fma" } */
+#include "long-double-wf.h"
+
+LONG_DOUBLE_WF (NEG_MUL_ADD);
+
+/* { dg-final { scan-assembler {\n\twfnmaxb\t} } } */
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-wfnmsxb-disabled.c b/gcc/testsuite/gcc.target/s390/vector/long-double-wfnmsxb-disabled.c
new file mode 100644 (file)
index 0000000..39e4f60
--- /dev/null
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzarch" } */
+#include "long-double-wf.h"
+
+LONG_DOUBLE_WF (NEG_MUL_SUB);
+
+/* { dg-final { scan-assembler {\n\twfmxb\t} } } */
+/* { dg-final { scan-assembler {\n\twfsxb\t} } } */
+/* { dg-final { scan-assembler {\n\twflcxb\t} } } */
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-wfnmsxb.c b/gcc/testsuite/gcc.target/s390/vector/long-double-wfnmsxb.c
new file mode 100644 (file)
index 0000000..698e277
--- /dev/null
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzarch -mvx-long-double-fma" } */
+#include "long-double-wf.h"
+
+LONG_DOUBLE_WF (NEG_MUL_SUB);
+
+/* { dg-final { scan-assembler {\n\twfnmsxb\t} } } */
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-wfsqxb.c b/gcc/testsuite/gcc.target/s390/vector/long-double-wfsqxb.c
new file mode 100644 (file)
index 0000000..09f9128
--- /dev/null
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzarch" } */
+#include "long-double-wf.h"
+
+LONG_DOUBLE_WF (SQRTL);
+
+/* { dg-final { scan-assembler {\n\twfsqxb\t} } } */
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-wfsxb-1.c b/gcc/testsuite/gcc.target/s390/vector/long-double-wfsxb-1.c
new file mode 100644 (file)
index 0000000..20960d0
--- /dev/null
@@ -0,0 +1,21 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzarch" } */
+#include <assert.h>
+
+typedef float tf __attribute__ ((mode (TF)));
+static tf x;
+static tf y;
+
+__attribute__ ((noipa)) static tf
+sub (void)
+{
+  return x - y;
+}
+
+int
+main (void)
+{
+  x = 1.5L;
+  y = 2.5L;
+  assert (sub () == -1.0L);
+}
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-wfsxb.c b/gcc/testsuite/gcc.target/s390/vector/long-double-wfsxb.c
new file mode 100644 (file)
index 0000000..1c430ee
--- /dev/null
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzarch" } */
+#include "long-double-wf.h"
+
+LONG_DOUBLE_WF (SUB);
+
+/* { dg-final { scan-assembler {\n\twfsxb\t} } } */
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-wftcixb-1.c b/gcc/testsuite/gcc.target/s390/vector/long-double-wftcixb-1.c
new file mode 100644 (file)
index 0000000..224995f
--- /dev/null
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -march=z14 -mzarch" } */
+
+int a, b;
+
+void
+c (void)
+{
+  long double d;
+  a = d;
+  if (__builtin_isinf (d))
+    b = 0;
+}
+
+/* { dg-final { scan-assembler {\n\twftcixb\t} } } */
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-wftcixb.c b/gcc/testsuite/gcc.target/s390/vector/long-double-wftcixb.c
new file mode 100644 (file)
index 0000000..c2658b8
--- /dev/null
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzarch" } */
+#include "long-double-wf.h"
+
+LONG_DOUBLE_WF (ISINFL);
+
+/* { dg-final { scan-assembler {\n\twftcixb\t} } } */