gcc/testsuite/ChangeLog:

2020-11-05  Ilya Leoshkevich  <i...@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.
---
 .../s390/vector/long-double-callee-abi-scan.c | 20 +++++++
 .../s390/vector/long-double-caller-abi-run.c  |  4 ++
 .../s390/vector/long-double-caller-abi-scan.c | 13 ++++
 .../s390/vector/long-double-copysign.c        | 21 +++++++
 .../s390/vector/long-double-fprx2-constant.c  | 11 ++++
 .../s390/vector/long-double-from-double.c     | 18 ++++++
 .../s390/vector/long-double-from-float.c      | 19 ++++++
 .../s390/vector/long-double-from-i16.c        | 19 ++++++
 .../s390/vector/long-double-from-i32.c        | 19 ++++++
 .../s390/vector/long-double-from-i64.c        | 19 ++++++
 .../s390/vector/long-double-from-i8.c         | 19 ++++++
 .../s390/vector/long-double-from-u16.c        | 19 ++++++
 .../s390/vector/long-double-from-u32.c        | 19 ++++++
 .../s390/vector/long-double-from-u64.c        | 19 ++++++
 .../s390/vector/long-double-from-u8.c         | 19 ++++++
 .../s390/vector/long-double-to-double.c       | 18 ++++++
 .../s390/vector/long-double-to-float.c        | 19 ++++++
 .../s390/vector/long-double-to-i16.c          | 19 ++++++
 .../s390/vector/long-double-to-i32.c          | 19 ++++++
 .../s390/vector/long-double-to-i64.c          | 21 +++++++
 .../s390/vector/long-double-to-i8.c           | 19 ++++++
 .../s390/vector/long-double-to-u16.c          | 20 +++++++
 .../s390/vector/long-double-to-u32.c          | 20 +++++++
 .../s390/vector/long-double-to-u64.c          | 20 +++++++
 .../s390/vector/long-double-to-u8.c           | 20 +++++++
 .../s390/vector/long-double-vec-duplicate.c   | 13 ++++
 .../gcc.target/s390/vector/long-double-wf.h   | 60 +++++++++++++++++++
 .../s390/vector/long-double-wfaxb.c           | 17 ++++++
 .../s390/vector/long-double-wfcxb-0001.c      |  9 +++
 .../s390/vector/long-double-wfcxb-0111.c      |  9 +++
 .../s390/vector/long-double-wfcxb-1011.c      |  9 +++
 .../s390/vector/long-double-wfcxb-1101.c      |  9 +++
 .../s390/vector/long-double-wfdxb.c           | 17 ++++++
 .../s390/vector/long-double-wfixb.c           |  7 +++
 .../s390/vector/long-double-wfkxb-0111.c      |  9 +++
 .../s390/vector/long-double-wfkxb-1011.c      |  9 +++
 .../s390/vector/long-double-wfkxb-1101.c      |  9 +++
 .../s390/vector/long-double-wflcxb.c          |  7 +++
 .../s390/vector/long-double-wflpxb.c          |  7 +++
 .../s390/vector/long-double-wfmaxb-2.c        | 24 ++++++++
 .../s390/vector/long-double-wfmaxb-3.c        | 14 +++++
 .../s390/vector/long-double-wfmaxb-disabled.c |  8 +++
 .../s390/vector/long-double-wfmaxb.c          |  7 +++
 .../s390/vector/long-double-wfmsxb-disabled.c |  8 +++
 .../s390/vector/long-double-wfmsxb.c          |  7 +++
 .../s390/vector/long-double-wfmxb.c           |  7 +++
 .../vector/long-double-wfnmaxb-disabled.c     |  9 +++
 .../s390/vector/long-double-wfnmaxb.c         |  7 +++
 .../vector/long-double-wfnmsxb-disabled.c     |  9 +++
 .../s390/vector/long-double-wfnmsxb.c         |  7 +++
 .../s390/vector/long-double-wfsqxb.c          |  7 +++
 .../s390/vector/long-double-wfsxb-1.c         | 21 +++++++
 .../s390/vector/long-double-wfsxb.c           |  7 +++
 .../s390/vector/long-double-wftcixb-1.c       | 15 +++++
 .../s390/vector/long-double-wftcixb.c         |  7 +++
 55 files changed, 808 insertions(+)
 create mode 100644 
gcc/testsuite/gcc.target/s390/vector/long-double-callee-abi-scan.c
 create mode 100644 
gcc/testsuite/gcc.target/s390/vector/long-double-caller-abi-run.c
 create mode 100644 
gcc/testsuite/gcc.target/s390/vector/long-double-caller-abi-scan.c
 create mode 100644 gcc/testsuite/gcc.target/s390/vector/long-double-copysign.c
 create mode 100644 
gcc/testsuite/gcc.target/s390/vector/long-double-fprx2-constant.c
 create mode 100644 
gcc/testsuite/gcc.target/s390/vector/long-double-from-double.c
 create mode 100644 
gcc/testsuite/gcc.target/s390/vector/long-double-from-float.c
 create mode 100644 gcc/testsuite/gcc.target/s390/vector/long-double-from-i16.c
 create mode 100644 gcc/testsuite/gcc.target/s390/vector/long-double-from-i32.c
 create mode 100644 gcc/testsuite/gcc.target/s390/vector/long-double-from-i64.c
 create mode 100644 gcc/testsuite/gcc.target/s390/vector/long-double-from-i8.c
 create mode 100644 gcc/testsuite/gcc.target/s390/vector/long-double-from-u16.c
 create mode 100644 gcc/testsuite/gcc.target/s390/vector/long-double-from-u32.c
 create mode 100644 gcc/testsuite/gcc.target/s390/vector/long-double-from-u64.c
 create mode 100644 gcc/testsuite/gcc.target/s390/vector/long-double-from-u8.c
 create mode 100644 gcc/testsuite/gcc.target/s390/vector/long-double-to-double.c
 create mode 100644 gcc/testsuite/gcc.target/s390/vector/long-double-to-float.c
 create mode 100644 gcc/testsuite/gcc.target/s390/vector/long-double-to-i16.c
 create mode 100644 gcc/testsuite/gcc.target/s390/vector/long-double-to-i32.c
 create mode 100644 gcc/testsuite/gcc.target/s390/vector/long-double-to-i64.c
 create mode 100644 gcc/testsuite/gcc.target/s390/vector/long-double-to-i8.c
 create mode 100644 gcc/testsuite/gcc.target/s390/vector/long-double-to-u16.c
 create mode 100644 gcc/testsuite/gcc.target/s390/vector/long-double-to-u32.c
 create mode 100644 gcc/testsuite/gcc.target/s390/vector/long-double-to-u64.c
 create mode 100644 gcc/testsuite/gcc.target/s390/vector/long-double-to-u8.c
 create mode 100644 
gcc/testsuite/gcc.target/s390/vector/long-double-vec-duplicate.c
 create mode 100644 gcc/testsuite/gcc.target/s390/vector/long-double-wf.h
 create mode 100644 gcc/testsuite/gcc.target/s390/vector/long-double-wfaxb.c
 create mode 100644 
gcc/testsuite/gcc.target/s390/vector/long-double-wfcxb-0001.c
 create mode 100644 
gcc/testsuite/gcc.target/s390/vector/long-double-wfcxb-0111.c
 create mode 100644 
gcc/testsuite/gcc.target/s390/vector/long-double-wfcxb-1011.c
 create mode 100644 
gcc/testsuite/gcc.target/s390/vector/long-double-wfcxb-1101.c
 create mode 100644 gcc/testsuite/gcc.target/s390/vector/long-double-wfdxb.c
 create mode 100644 gcc/testsuite/gcc.target/s390/vector/long-double-wfixb.c
 create mode 100644 
gcc/testsuite/gcc.target/s390/vector/long-double-wfkxb-0111.c
 create mode 100644 
gcc/testsuite/gcc.target/s390/vector/long-double-wfkxb-1011.c
 create mode 100644 
gcc/testsuite/gcc.target/s390/vector/long-double-wfkxb-1101.c
 create mode 100644 gcc/testsuite/gcc.target/s390/vector/long-double-wflcxb.c
 create mode 100644 gcc/testsuite/gcc.target/s390/vector/long-double-wflpxb.c
 create mode 100644 gcc/testsuite/gcc.target/s390/vector/long-double-wfmaxb-2.c
 create mode 100644 gcc/testsuite/gcc.target/s390/vector/long-double-wfmaxb-3.c
 create mode 100644 
gcc/testsuite/gcc.target/s390/vector/long-double-wfmaxb-disabled.c
 create mode 100644 gcc/testsuite/gcc.target/s390/vector/long-double-wfmaxb.c
 create mode 100644 
gcc/testsuite/gcc.target/s390/vector/long-double-wfmsxb-disabled.c
 create mode 100644 gcc/testsuite/gcc.target/s390/vector/long-double-wfmsxb.c
 create mode 100644 gcc/testsuite/gcc.target/s390/vector/long-double-wfmxb.c
 create mode 100644 
gcc/testsuite/gcc.target/s390/vector/long-double-wfnmaxb-disabled.c
 create mode 100644 gcc/testsuite/gcc.target/s390/vector/long-double-wfnmaxb.c
 create mode 100644 
gcc/testsuite/gcc.target/s390/vector/long-double-wfnmsxb-disabled.c
 create mode 100644 gcc/testsuite/gcc.target/s390/vector/long-double-wfnmsxb.c
 create mode 100644 gcc/testsuite/gcc.target/s390/vector/long-double-wfsqxb.c
 create mode 100644 gcc/testsuite/gcc.target/s390/vector/long-double-wfsxb-1.c
 create mode 100644 gcc/testsuite/gcc.target/s390/vector/long-double-wfsxb.c
 create mode 100644 gcc/testsuite/gcc.target/s390/vector/long-double-wftcixb-1.c
 create mode 100644 gcc/testsuite/gcc.target/s390/vector/long-double-wftcixb.c

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
index 00000000000..69e8c6148c2
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-callee-abi-scan.c
@@ -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
index 00000000000..f3a41bacc2f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-caller-abi-run.c
@@ -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
index 00000000000..c1ec5b16e9e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-caller-abi-scan.c
@@ -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
index 00000000000..3115195e974
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-copysign.c
@@ -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
index 00000000000..02a6a1f69c5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-fprx2-constant.c
@@ -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
index 00000000000..5eb31f8bd84
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-from-double.c
@@ -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
index 00000000000..0449f0cfaf2
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-from-float.c
@@ -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
index 00000000000..68b164d377f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-from-i16.c
@@ -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
index 00000000000..ad8443bf61a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-from-i32.c
@@ -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
index 00000000000..3d2c424bbc7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-from-i64.c
@@ -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
index 00000000000..44c8c9d9bec
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-from-i8.c
@@ -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
index 00000000000..f10c298c6d0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-from-u16.c
@@ -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
index 00000000000..2763fb47b55
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-from-u32.c
@@ -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
index 00000000000..4686dfd8d20
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-from-u64.c
@@ -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
index 00000000000..3e6eb924244
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-from-u8.c
@@ -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
index 00000000000..88aa053d203
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-to-double.c
@@ -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
index 00000000000..36fd4299ae4
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-to-float.c
@@ -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
index 00000000000..ddfc668f0d6
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-to-i16.c
@@ -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
index 00000000000..975a5deff8f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-to-i32.c
@@ -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
index 00000000000..6bd5079ae97
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-to-i64.c
@@ -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
index 00000000000..46e6d6bdf3c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-to-i8.c
@@ -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
index 00000000000..0690f3df1e3
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-to-u16.c
@@ -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
index 00000000000..aa0e318f299
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-to-u32.c
@@ -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
index 00000000000..e37b65ef6f8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-to-u64.c
@@ -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
index 00000000000..bddbff8bf69
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-to-u8.c
@@ -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
index 00000000000..2ce9da33b8e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-vec-duplicate.c
@@ -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
index 00000000000..a564fc62d47
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-wf.h
@@ -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
index 00000000000..1b35c1c5dd5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-wfaxb.c
@@ -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
index 00000000000..9ffff6ff36f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-wfcxb-0001.c
@@ -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
index 00000000000..3ade8358953
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-wfcxb-0111.c
@@ -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
index 00000000000..a9c819de15d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-wfcxb-1011.c
@@ -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
index 00000000000..47ea7c7c3b9
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-wfcxb-1101.c
@@ -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
index 00000000000..16b48938ebd
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-wfdxb.c
@@ -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
index 00000000000..69348bd4c07
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-wfixb.c
@@ -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
index 00000000000..0f7b2090871
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-wfkxb-0111.c
@@ -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
index 00000000000..b76dbb043ea
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-wfkxb-1011.c
@@ -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
index 00000000000..61f0ec49c6d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-wfkxb-1101.c
@@ -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
index 00000000000..ddcf97202ad
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-wflcxb.c
@@ -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
index 00000000000..df9050566e5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-wflpxb.c
@@ -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
index 00000000000..0b2fdcc084d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-wfmaxb-2.c
@@ -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
index 00000000000..9ef49c1311e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-wfmaxb-3.c
@@ -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
index 00000000000..59bc80a0cfe
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-wfmaxb-disabled.c
@@ -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
index 00000000000..319a02fc848
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-wfmaxb.c
@@ -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
index 00000000000..bb5c0f2cce0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-wfmsxb-disabled.c
@@ -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
index 00000000000..c14f6733533
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-wfmsxb.c
@@ -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
index 00000000000..6ab1e68d297
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-wfmxb.c
@@ -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
index 00000000000..8c5298e4d9c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-wfnmaxb-disabled.c
@@ -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
index 00000000000..9f0da134ed6
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-wfnmaxb.c
@@ -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
index 00000000000..39e4f6071ad
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-wfnmsxb-disabled.c
@@ -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
index 00000000000..698e277780a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-wfnmsxb.c
@@ -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
index 00000000000..09f91285aaf
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-wfsqxb.c
@@ -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
index 00000000000..20960d05e0c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-wfsxb-1.c
@@ -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
index 00000000000..1c430ee3232
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-wfsxb.c
@@ -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
index 00000000000..224995ff77e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-wftcixb-1.c
@@ -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
index 00000000000..c2658b88a18
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-wftcixb.c
@@ -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} } } */
-- 
2.25.4

Reply via email to