public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ilya Leoshkevich <iii@linux.ibm.com>
To: krebbel@linux.ibm.com
Cc: gcc-patches@gcc.gnu.org, Ilya Leoshkevich <iii@linux.ibm.com>
Subject: [PATCH 4/4] IBM Z: Test long doubles in vector registers
Date: Tue,  3 Nov 2020 22:46:56 +0100	[thread overview]
Message-ID: <20201103214656.1877781-1-iii@linux.ibm.com> (raw)
In-Reply-To: <20201103213637.1876906-1-iii@linux.ibm.com>

gcc/testsuite/ChangeLog:

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

	* gcc.target/s390/zvector/long-double-callee-abi-scan.c: New test.
	* gcc.target/s390/zvector/long-double-caller-abi-run.c: New test.
	* gcc.target/s390/zvector/long-double-caller-abi-scan.c: New test.
	* gcc.target/s390/zvector/long-double-copysign-run.c: New test.
	* gcc.target/s390/zvector/long-double-copysign-scan.c: New test.
	* gcc.target/s390/zvector/long-double-fprx2-constant.c: New test.
	* gcc.target/s390/zvector/long-double-from-double-run.c: New test.
	* gcc.target/s390/zvector/long-double-from-double-scan.c: New test.
	* gcc.target/s390/zvector/long-double-from-float-run.c: New test.
	* gcc.target/s390/zvector/long-double-from-float-scan.c: New test.
	* gcc.target/s390/zvector/long-double-from-i16-run.c: New test.
	* gcc.target/s390/zvector/long-double-from-i16-scan.c: New test.
	* gcc.target/s390/zvector/long-double-from-i32-run.c: New test.
	* gcc.target/s390/zvector/long-double-from-i32-scan.c: New test.
	* gcc.target/s390/zvector/long-double-from-i64-run.c: New test.
	* gcc.target/s390/zvector/long-double-from-i64-scan.c: New test.
	* gcc.target/s390/zvector/long-double-from-i8-run.c: New test.
	* gcc.target/s390/zvector/long-double-from-i8-scan.c: New test.
	* gcc.target/s390/zvector/long-double-from-u16-run.c: New test.
	* gcc.target/s390/zvector/long-double-from-u16-scan.c: New test.
	* gcc.target/s390/zvector/long-double-from-u32-run.c: New test.
	* gcc.target/s390/zvector/long-double-from-u32-scan.c: New test.
	* gcc.target/s390/zvector/long-double-from-u64-run.c: New test.
	* gcc.target/s390/zvector/long-double-from-u64-scan.c: New test.
	* gcc.target/s390/zvector/long-double-from-u8-run.c: New test.
	* gcc.target/s390/zvector/long-double-from-u8-scan.c: New test.
	* gcc.target/s390/zvector/long-double-to-double-run.c: New test.
	* gcc.target/s390/zvector/long-double-to-double-scan.c: New test.
	* gcc.target/s390/zvector/long-double-to-float-run.c: New test.
	* gcc.target/s390/zvector/long-double-to-float-scan.c: New test.
	* gcc.target/s390/zvector/long-double-to-i16-run.c: New test.
	* gcc.target/s390/zvector/long-double-to-i16-scan.c: New test.
	* gcc.target/s390/zvector/long-double-to-i32-run.c: New test.
	* gcc.target/s390/zvector/long-double-to-i32-scan.c: New test.
	* gcc.target/s390/zvector/long-double-to-i64-run.c: New test.
	* gcc.target/s390/zvector/long-double-to-i64-scan.c: New test.
	* gcc.target/s390/zvector/long-double-to-i8-run.c: New test.
	* gcc.target/s390/zvector/long-double-to-i8-scan.c: New test.
	* gcc.target/s390/zvector/long-double-to-u16-run.c: New test.
	* gcc.target/s390/zvector/long-double-to-u16-scan.c: New test.
	* gcc.target/s390/zvector/long-double-to-u32-run.c: New test.
	* gcc.target/s390/zvector/long-double-to-u32-scan.c: New test.
	* gcc.target/s390/zvector/long-double-to-u64-run.c: New test.
	* gcc.target/s390/zvector/long-double-to-u64-scan.c: New test.
	* gcc.target/s390/zvector/long-double-to-u8-run.c: New test.
	* gcc.target/s390/zvector/long-double-to-u8-scan.c: New test.
	* gcc.target/s390/zvector/long-double-vec-duplicate.c: New test.
	* gcc.target/s390/zvector/long-double-wf.h: New test.
	* gcc.target/s390/zvector/long-double-wfaxb-run.c: New test.
	* gcc.target/s390/zvector/long-double-wfaxb-scan.c: New test.
	* gcc.target/s390/zvector/long-double-wfaxb.c: New test.
	* gcc.target/s390/zvector/long-double-wfcxb-0001.c: New test.
	* gcc.target/s390/zvector/long-double-wfcxb-0111.c: New test.
	* gcc.target/s390/zvector/long-double-wfcxb-1011.c: New test.
	* gcc.target/s390/zvector/long-double-wfcxb-1101.c: New test.
	* gcc.target/s390/zvector/long-double-wfdxb-run.c: New test.
	* gcc.target/s390/zvector/long-double-wfdxb-scan.c: New test.
	* gcc.target/s390/zvector/long-double-wfdxb.c: New test.
	* gcc.target/s390/zvector/long-double-wfixb.c: New test.
	* gcc.target/s390/zvector/long-double-wfkxb-0111.c: New test.
	* gcc.target/s390/zvector/long-double-wfkxb-1011.c: New test.
	* gcc.target/s390/zvector/long-double-wfkxb-1101.c: New test.
	* gcc.target/s390/zvector/long-double-wflcxb.c: New test.
	* gcc.target/s390/zvector/long-double-wflpxb.c: New test.
	* gcc.target/s390/zvector/long-double-wfmaxb-2.c: New test.
	* gcc.target/s390/zvector/long-double-wfmaxb-3.c: New test.
	* gcc.target/s390/zvector/long-double-wfmaxb-disabled.c: New test.
	* gcc.target/s390/zvector/long-double-wfmaxb.c: New test.
	* gcc.target/s390/zvector/long-double-wfmsxb-disabled.c: New test.
	* gcc.target/s390/zvector/long-double-wfmsxb.c: New test.
	* gcc.target/s390/zvector/long-double-wfmxb.c: New test.
	* gcc.target/s390/zvector/long-double-wfnmaxb-disabled.c: New test.
	* gcc.target/s390/zvector/long-double-wfnmaxb.c: New test.
	* gcc.target/s390/zvector/long-double-wfnmsxb-disabled.c: New test.
	* gcc.target/s390/zvector/long-double-wfnmsxb.c: New test.
	* gcc.target/s390/zvector/long-double-wfsqxb.c: New test.
	* gcc.target/s390/zvector/long-double-wfsxb-1.c: New test.
	* gcc.target/s390/zvector/long-double-wfsxb.c: New test.
	* gcc.target/s390/zvector/long-double-wftcixb-1.c: New test.
	* gcc.target/s390/zvector/long-double-wftcixb.c: New test.
---
 .../zvector/long-double-callee-abi-scan.c     | 20 +++++++
 .../s390/zvector/long-double-caller-abi-run.c |  4 ++
 .../zvector/long-double-caller-abi-scan.c     | 13 ++++
 .../s390/zvector/long-double-copysign-run.c   | 14 +++++
 .../s390/zvector/long-double-copysign-scan.c  | 11 ++++
 .../s390/zvector/long-double-fprx2-constant.c | 11 ++++
 .../zvector/long-double-from-double-run.c     | 12 ++++
 .../zvector/long-double-from-double-scan.c    |  9 +++
 .../s390/zvector/long-double-from-float-run.c | 12 ++++
 .../zvector/long-double-from-float-scan.c     | 10 ++++
 .../s390/zvector/long-double-from-i16-run.c   | 12 ++++
 .../s390/zvector/long-double-from-i16-scan.c  | 11 ++++
 .../s390/zvector/long-double-from-i32-run.c   | 12 ++++
 .../s390/zvector/long-double-from-i32-scan.c  | 11 ++++
 .../s390/zvector/long-double-from-i64-run.c   | 12 ++++
 .../s390/zvector/long-double-from-i64-scan.c  | 11 ++++
 .../s390/zvector/long-double-from-i8-run.c    | 12 ++++
 .../s390/zvector/long-double-from-i8-scan.c   | 11 ++++
 .../s390/zvector/long-double-from-u16-run.c   | 12 ++++
 .../s390/zvector/long-double-from-u16-scan.c  | 11 ++++
 .../s390/zvector/long-double-from-u32-run.c   | 12 ++++
 .../s390/zvector/long-double-from-u32-scan.c  | 11 ++++
 .../s390/zvector/long-double-from-u64-run.c   | 12 ++++
 .../s390/zvector/long-double-from-u64-scan.c  | 11 ++++
 .../s390/zvector/long-double-from-u8-run.c    | 12 ++++
 .../s390/zvector/long-double-from-u8-scan.c   | 11 ++++
 .../s390/zvector/long-double-to-double-run.c  | 12 ++++
 .../s390/zvector/long-double-to-double-scan.c |  9 +++
 .../s390/zvector/long-double-to-float-run.c   | 12 ++++
 .../s390/zvector/long-double-to-float-scan.c  | 10 ++++
 .../s390/zvector/long-double-to-i16-run.c     | 12 ++++
 .../s390/zvector/long-double-to-i16-scan.c    | 11 ++++
 .../s390/zvector/long-double-to-i32-run.c     | 12 ++++
 .../s390/zvector/long-double-to-i32-scan.c    | 11 ++++
 .../s390/zvector/long-double-to-i64-run.c     | 12 ++++
 .../s390/zvector/long-double-to-i64-scan.c    | 13 ++++
 .../s390/zvector/long-double-to-i8-run.c      | 12 ++++
 .../s390/zvector/long-double-to-i8-scan.c     | 11 ++++
 .../s390/zvector/long-double-to-u16-run.c     | 13 ++++
 .../s390/zvector/long-double-to-u16-scan.c    | 11 ++++
 .../s390/zvector/long-double-to-u32-run.c     | 13 ++++
 .../s390/zvector/long-double-to-u32-scan.c    | 11 ++++
 .../s390/zvector/long-double-to-u64-run.c     | 13 ++++
 .../s390/zvector/long-double-to-u64-scan.c    | 11 ++++
 .../s390/zvector/long-double-to-u8-run.c      | 13 ++++
 .../s390/zvector/long-double-to-u8-scan.c     | 11 ++++
 .../s390/zvector/long-double-vec-duplicate.c  | 13 ++++
 .../gcc.target/s390/zvector/long-double-wf.h  | 60 +++++++++++++++++++
 .../s390/zvector/long-double-wfaxb-run.c      | 11 ++++
 .../s390/zvector/long-double-wfaxb-scan.c     | 10 ++++
 .../s390/zvector/long-double-wfaxb.c          |  8 +++
 .../s390/zvector/long-double-wfcxb-0001.c     | 10 ++++
 .../s390/zvector/long-double-wfcxb-0111.c     | 10 ++++
 .../s390/zvector/long-double-wfcxb-1011.c     | 10 ++++
 .../s390/zvector/long-double-wfcxb-1101.c     | 10 ++++
 .../s390/zvector/long-double-wfdxb-run.c      | 11 ++++
 .../s390/zvector/long-double-wfdxb-scan.c     | 10 ++++
 .../s390/zvector/long-double-wfdxb.c          |  8 +++
 .../s390/zvector/long-double-wfixb.c          |  8 +++
 .../s390/zvector/long-double-wfkxb-0111.c     | 10 ++++
 .../s390/zvector/long-double-wfkxb-1011.c     | 10 ++++
 .../s390/zvector/long-double-wfkxb-1101.c     | 10 ++++
 .../s390/zvector/long-double-wflcxb.c         |  8 +++
 .../s390/zvector/long-double-wflpxb.c         |  8 +++
 .../s390/zvector/long-double-wfmaxb-2.c       | 24 ++++++++
 .../s390/zvector/long-double-wfmaxb-3.c       | 14 +++++
 .../zvector/long-double-wfmaxb-disabled.c     |  9 +++
 .../s390/zvector/long-double-wfmaxb.c         |  8 +++
 .../zvector/long-double-wfmsxb-disabled.c     |  9 +++
 .../s390/zvector/long-double-wfmsxb.c         |  8 +++
 .../s390/zvector/long-double-wfmxb.c          |  8 +++
 .../zvector/long-double-wfnmaxb-disabled.c    | 10 ++++
 .../s390/zvector/long-double-wfnmaxb.c        |  8 +++
 .../zvector/long-double-wfnmsxb-disabled.c    | 10 ++++
 .../s390/zvector/long-double-wfnmsxb.c        |  8 +++
 .../s390/zvector/long-double-wfsqxb.c         |  8 +++
 .../s390/zvector/long-double-wfsxb-1.c        | 21 +++++++
 .../s390/zvector/long-double-wfsxb.c          |  8 +++
 .../s390/zvector/long-double-wftcixb-1.c      | 15 +++++
 .../s390/zvector/long-double-wftcixb.c        |  8 +++
 80 files changed, 934 insertions(+)
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-callee-abi-scan.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-caller-abi-run.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-caller-abi-scan.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-copysign-run.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-copysign-scan.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-fprx2-constant.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-from-double-run.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-from-double-scan.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-from-float-run.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-from-float-scan.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-from-i16-run.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-from-i16-scan.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-from-i32-run.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-from-i32-scan.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-from-i64-run.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-from-i64-scan.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-from-i8-run.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-from-i8-scan.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-from-u16-run.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-from-u16-scan.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-from-u32-run.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-from-u32-scan.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-from-u64-run.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-from-u64-scan.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-from-u8-run.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-from-u8-scan.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-to-double-run.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-to-double-scan.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-to-float-run.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-to-float-scan.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-to-i16-run.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-to-i16-scan.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-to-i32-run.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-to-i32-scan.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-to-i64-run.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-to-i64-scan.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-to-i8-run.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-to-i8-scan.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-to-u16-run.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-to-u16-scan.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-to-u32-run.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-to-u32-scan.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-to-u64-run.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-to-u64-scan.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-to-u8-run.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-to-u8-scan.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-vec-duplicate.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-wf.h
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-wfaxb-run.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-wfaxb-scan.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-wfaxb.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-wfcxb-0001.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-wfcxb-0111.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-wfcxb-1011.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-wfcxb-1101.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-wfdxb-run.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-wfdxb-scan.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-wfdxb.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-wfixb.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-wfkxb-0111.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-wfkxb-1011.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-wfkxb-1101.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-wflcxb.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-wflpxb.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-wfmaxb-2.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-wfmaxb-3.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-wfmaxb-disabled.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-wfmaxb.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-wfmsxb-disabled.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-wfmsxb.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-wfmxb.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-wfnmaxb-disabled.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-wfnmaxb.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-wfnmsxb-disabled.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-wfnmsxb.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-wfsqxb.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-wfsxb-1.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-wfsxb.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-wftcixb-1.c
 create mode 100644 gcc/testsuite/gcc.target/s390/zvector/long-double-wftcixb.c

diff --git a/gcc/testsuite/gcc.target/s390/zvector/long-double-callee-abi-scan.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-callee-abi-scan.c
new file mode 100644
index 00000000000..005bfa9977a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-callee-abi-scan.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -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/zvector/long-double-caller-abi-run.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-caller-abi-run.c
new file mode 100644
index 00000000000..d1756f5d34c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-caller-abi-run.c
@@ -0,0 +1,4 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+#include "long-double-callee-abi-scan.c"
+#include "long-double-caller-abi-scan.c"
diff --git a/gcc/testsuite/gcc.target/s390/zvector/long-double-caller-abi-scan.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-caller-abi-scan.c
new file mode 100644
index 00000000000..ef690733fbf
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-caller-abi-scan.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -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/zvector/long-double-copysign-run.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-copysign-run.c
new file mode 100644
index 00000000000..c874b64d78e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-copysign-run.c
@@ -0,0 +1,14 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+#include <assert.h>
+
+#include "long-double-copysign-scan.c"
+
+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/zvector/long-double-copysign-scan.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-copysign-scan.c
new file mode 100644
index 00000000000..6a44c0eff61
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-copysign-scan.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+#include <stdint.h>
+
+__attribute__ ((noipa, used)) 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 } } */
diff --git a/gcc/testsuite/gcc.target/s390/zvector/long-double-fprx2-constant.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-fprx2-constant.c
new file mode 100644
index 00000000000..02a6a1f69c5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/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/zvector/long-double-from-double-run.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-from-double-run.c
new file mode 100644
index 00000000000..7a960ad119d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-from-double-run.c
@@ -0,0 +1,12 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+#include <assert.h>
+
+#include "long-double-from-double-scan.c"
+
+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/zvector/long-double-from-double-scan.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-from-double-scan.c
new file mode 100644
index 00000000000..db9ba4534c3
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-from-double-scan.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+__attribute__ ((noipa, used)) static long double
+long_double_from_double (double x)
+{
+  return x;
+}
+
+/* { dg-final { scan-assembler-times {\n\twflld\t} 1 } } */
diff --git a/gcc/testsuite/gcc.target/s390/zvector/long-double-from-float-run.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-from-float-run.c
new file mode 100644
index 00000000000..41256b39abc
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-from-float-run.c
@@ -0,0 +1,12 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+#include <assert.h>
+
+#include "long-double-from-float-scan.c"
+
+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/zvector/long-double-from-float-scan.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-from-float-scan.c
new file mode 100644
index 00000000000..4b9b570fcfb
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-from-float-scan.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+__attribute__ ((noipa, used)) 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 } } */
diff --git a/gcc/testsuite/gcc.target/s390/zvector/long-double-from-i16-run.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-from-i16-run.c
new file mode 100644
index 00000000000..6c0fac93da5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-from-i16-run.c
@@ -0,0 +1,12 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+#include <assert.h>
+
+#include "long-double-from-i16-scan.c"
+
+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/zvector/long-double-from-i16-scan.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-from-i16-scan.c
new file mode 100644
index 00000000000..18af4d82f57
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-from-i16-scan.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+#include <stdint.h>
+
+__attribute__ ((noipa, used)) static long double
+long_double_from_i16 (int16_t x)
+{
+  return x;
+}
+
+/* { dg-final { scan-assembler-times {\n\tcxfbr\t} 1 } } */
diff --git a/gcc/testsuite/gcc.target/s390/zvector/long-double-from-i32-run.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-from-i32-run.c
new file mode 100644
index 00000000000..2baa6e156f7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-from-i32-run.c
@@ -0,0 +1,12 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+#include <assert.h>
+
+#include "long-double-from-i32-scan.c"
+
+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/zvector/long-double-from-i32-scan.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-from-i32-scan.c
new file mode 100644
index 00000000000..433b6bbffe5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-from-i32-scan.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+#include <stdint.h>
+
+__attribute__ ((noipa, used)) static long double
+long_double_from_i32 (int32_t x)
+{
+  return x;
+}
+
+/* { dg-final { scan-assembler-times {\n\tcxfbr\t} 1 } } */
diff --git a/gcc/testsuite/gcc.target/s390/zvector/long-double-from-i64-run.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-from-i64-run.c
new file mode 100644
index 00000000000..c6f460064e0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-from-i64-run.c
@@ -0,0 +1,12 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+#include <assert.h>
+
+#include "long-double-from-i64-scan.c"
+
+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/zvector/long-double-from-i64-scan.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-from-i64-scan.c
new file mode 100644
index 00000000000..f418dffd8b0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-from-i64-scan.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+#include <stdint.h>
+
+__attribute__ ((noipa, used)) static long double
+long_double_from_i64 (int64_t x)
+{
+  return x;
+}
+
+/* { dg-final { scan-assembler-times {\n\tcxgbr\t} 1 } } */
diff --git a/gcc/testsuite/gcc.target/s390/zvector/long-double-from-i8-run.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-from-i8-run.c
new file mode 100644
index 00000000000..15c46d8a909
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-from-i8-run.c
@@ -0,0 +1,12 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+#include <assert.h>
+
+#include "long-double-from-i8-scan.c"
+
+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/zvector/long-double-from-i8-scan.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-from-i8-scan.c
new file mode 100644
index 00000000000..7a8b3fdaad0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-from-i8-scan.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+#include <stdint.h>
+
+__attribute__ ((noipa, used)) static long double
+long_double_from_i8 (int8_t x)
+{
+  return x;
+}
+
+/* { dg-final { scan-assembler-times {\n\tcxfbr\t} 1 } } */
diff --git a/gcc/testsuite/gcc.target/s390/zvector/long-double-from-u16-run.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-from-u16-run.c
new file mode 100644
index 00000000000..495b3f9f18d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-from-u16-run.c
@@ -0,0 +1,12 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+#include <assert.h>
+
+#include "long-double-from-u16-scan.c"
+
+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/zvector/long-double-from-u16-scan.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-from-u16-scan.c
new file mode 100644
index 00000000000..b65e10269df
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-from-u16-scan.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+#include <stdint.h>
+
+__attribute__ ((noipa, used)) static long double
+long_double_from_u16 (uint16_t x)
+{
+  return x;
+}
+
+/* { dg-final { scan-assembler-times {\n\tcxlfbr\t} 1 } } */
diff --git a/gcc/testsuite/gcc.target/s390/zvector/long-double-from-u32-run.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-from-u32-run.c
new file mode 100644
index 00000000000..072ae99ef24
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-from-u32-run.c
@@ -0,0 +1,12 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+#include <assert.h>
+
+#include "long-double-from-u32-scan.c"
+
+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/zvector/long-double-from-u32-scan.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-from-u32-scan.c
new file mode 100644
index 00000000000..408e3d1b570
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-from-u32-scan.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+#include <stdint.h>
+
+__attribute__ ((noipa, used)) static long double
+long_double_from_u32 (uint32_t x)
+{
+  return x;
+}
+
+/* { dg-final { scan-assembler-times {\n\tcxlfbr\t} 1 } } */
diff --git a/gcc/testsuite/gcc.target/s390/zvector/long-double-from-u64-run.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-from-u64-run.c
new file mode 100644
index 00000000000..6146c322611
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-from-u64-run.c
@@ -0,0 +1,12 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+#include <assert.h>
+
+#include "long-double-from-u64-scan.c"
+
+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/zvector/long-double-from-u64-scan.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-from-u64-scan.c
new file mode 100644
index 00000000000..856912d5689
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-from-u64-scan.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+#include <stdint.h>
+
+__attribute__ ((noipa, used)) static long double
+long_double_from_u64 (uint64_t x)
+{
+  return x;
+}
+
+/* { dg-final { scan-assembler-times {\n\tcxlgbr\t} 1 } } */
diff --git a/gcc/testsuite/gcc.target/s390/zvector/long-double-from-u8-run.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-from-u8-run.c
new file mode 100644
index 00000000000..d769d006499
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-from-u8-run.c
@@ -0,0 +1,12 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+#include <assert.h>
+
+#include "long-double-from-u8-scan.c"
+
+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/zvector/long-double-from-u8-scan.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-from-u8-scan.c
new file mode 100644
index 00000000000..d1421d4322c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-from-u8-scan.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+#include <stdint.h>
+
+__attribute__ ((noipa, used)) static long double
+long_double_from_u8 (uint8_t x)
+{
+  return x;
+}
+
+/* { dg-final { scan-assembler-times {\n\tcxlfbr\t} 1 } } */
diff --git a/gcc/testsuite/gcc.target/s390/zvector/long-double-to-double-run.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-to-double-run.c
new file mode 100644
index 00000000000..b68ce88529a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-to-double-run.c
@@ -0,0 +1,12 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+#include <assert.h>
+
+#include "long-double-to-double-scan.c"
+
+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/zvector/long-double-to-double-scan.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-to-double-scan.c
new file mode 100644
index 00000000000..78ce18b38c4
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-to-double-scan.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+__attribute__ ((noipa, used)) static double
+long_double_to_double (long double x)
+{
+  return x;
+}
+
+/* { dg-final { scan-assembler-times {\n\twflrx\t} 1 } } */
diff --git a/gcc/testsuite/gcc.target/s390/zvector/long-double-to-float-run.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-to-float-run.c
new file mode 100644
index 00000000000..70a8a3e7f73
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-to-float-run.c
@@ -0,0 +1,12 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+#include <assert.h>
+
+#include "long-double-to-float-scan.c"
+
+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/zvector/long-double-to-float-scan.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-to-float-scan.c
new file mode 100644
index 00000000000..1f0b60a3f03
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-to-float-scan.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+__attribute__ ((noipa, used)) 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 } } */
diff --git a/gcc/testsuite/gcc.target/s390/zvector/long-double-to-i16-run.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-to-i16-run.c
new file mode 100644
index 00000000000..2044baa45af
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-to-i16-run.c
@@ -0,0 +1,12 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+#include <assert.h>
+
+#include "long-double-to-i16-scan.c"
+
+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/zvector/long-double-to-i16-scan.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-to-i16-scan.c
new file mode 100644
index 00000000000..3c47ae97c39
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-to-i16-scan.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+#include <stdint.h>
+
+__attribute__ ((noipa, used)) static int16_t
+long_double_to_i16 (long double x)
+{
+  return x;
+}
+
+/* { dg-final { scan-assembler-times {\n\tcfxbr\t} 1 } } */
diff --git a/gcc/testsuite/gcc.target/s390/zvector/long-double-to-i32-run.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-to-i32-run.c
new file mode 100644
index 00000000000..9f98ea39f6f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-to-i32-run.c
@@ -0,0 +1,12 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+#include <assert.h>
+
+#include "long-double-to-i32-scan.c"
+
+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/zvector/long-double-to-i32-scan.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-to-i32-scan.c
new file mode 100644
index 00000000000..978b4751bff
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-to-i32-scan.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+#include <stdint.h>
+
+__attribute__ ((noipa, used)) static int32_t
+long_double_to_i32 (long double x)
+{
+  return x;
+}
+
+/* { dg-final { scan-assembler-times {\n\tcfxbr\t} 1 } } */
diff --git a/gcc/testsuite/gcc.target/s390/zvector/long-double-to-i64-run.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-to-i64-run.c
new file mode 100644
index 00000000000..f2a27ff4fec
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-to-i64-run.c
@@ -0,0 +1,12 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+#include <assert.h>
+
+#include "long-double-to-i64-scan.c"
+
+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/zvector/long-double-to-i64-scan.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-to-i64-scan.c
new file mode 100644
index 00000000000..38a212ac3c7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-to-i64-scan.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+#include <stdint.h>
+
+__attribute__ ((noipa, used)) 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 } } */
diff --git a/gcc/testsuite/gcc.target/s390/zvector/long-double-to-i8-run.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-to-i8-run.c
new file mode 100644
index 00000000000..0e0624b2788
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-to-i8-run.c
@@ -0,0 +1,12 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+#include <assert.h>
+
+#include "long-double-to-i8-scan.c"
+
+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/zvector/long-double-to-i8-scan.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-to-i8-scan.c
new file mode 100644
index 00000000000..d015b8a307b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-to-i8-scan.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+#include <stdint.h>
+
+__attribute__ ((noipa, used)) static int8_t
+long_double_to_i8 (long double x)
+{
+  return x;
+}
+
+/* { dg-final { scan-assembler-times {\n\tcfxbr\t} 1 } } */
diff --git a/gcc/testsuite/gcc.target/s390/zvector/long-double-to-u16-run.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-to-u16-run.c
new file mode 100644
index 00000000000..7bac113a04c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-to-u16-run.c
@@ -0,0 +1,13 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+#include <assert.h>
+
+#include "long-double-to-u16-scan.c"
+
+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/zvector/long-double-to-u16-scan.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-to-u16-scan.c
new file mode 100644
index 00000000000..a7694ceb3ad
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-to-u16-scan.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+#include <stdint.h>
+
+__attribute__ ((noipa, used)) static uint16_t
+long_double_to_u16 (long double x)
+{
+  return x;
+}
+
+/* { dg-final { scan-assembler-times {\n\tclfxbr\t} 1 } } */
diff --git a/gcc/testsuite/gcc.target/s390/zvector/long-double-to-u32-run.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-to-u32-run.c
new file mode 100644
index 00000000000..b85038c0723
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-to-u32-run.c
@@ -0,0 +1,13 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+#include <assert.h>
+
+#include "long-double-to-u32-scan.c"
+
+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/zvector/long-double-to-u32-scan.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-to-u32-scan.c
new file mode 100644
index 00000000000..ff97803d320
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-to-u32-scan.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+#include <stdint.h>
+
+__attribute__ ((noipa, used)) static uint32_t
+long_double_to_u32 (long double x)
+{
+  return x;
+}
+
+/* { dg-final { scan-assembler-times {\n\tclfxbr\t} 1 } } */
diff --git a/gcc/testsuite/gcc.target/s390/zvector/long-double-to-u64-run.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-to-u64-run.c
new file mode 100644
index 00000000000..e781637dac3
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-to-u64-run.c
@@ -0,0 +1,13 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+#include <assert.h>
+
+#include "long-double-to-u64-scan.c"
+
+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/zvector/long-double-to-u64-scan.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-to-u64-scan.c
new file mode 100644
index 00000000000..d97c0ec35dd
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-to-u64-scan.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+#include <stdint.h>
+
+__attribute__ ((noipa, used)) static uint64_t
+long_double_to_u64 (long double x)
+{
+  return x;
+}
+
+/* { dg-final { scan-assembler-times {\n\tclgxbr\t} 1 } } */
diff --git a/gcc/testsuite/gcc.target/s390/zvector/long-double-to-u8-run.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-to-u8-run.c
new file mode 100644
index 00000000000..7ae330b6aa1
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-to-u8-run.c
@@ -0,0 +1,13 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+#include <assert.h>
+
+#include "long-double-to-u8-scan.c"
+
+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/zvector/long-double-to-u8-scan.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-to-u8-scan.c
new file mode 100644
index 00000000000..0500bc1c946
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-to-u8-scan.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+#include <stdint.h>
+
+__attribute__ ((noipa, used)) static uint8_t
+long_double_to_u8 (long double x)
+{
+  return x;
+}
+
+/* { dg-final { scan-assembler-times {\n\tclfxbr\t} 1 } } */
diff --git a/gcc/testsuite/gcc.target/s390/zvector/long-double-vec-duplicate.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-vec-duplicate.c
new file mode 100644
index 00000000000..2ce9da33b8e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/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/zvector/long-double-wf.h b/gcc/testsuite/gcc.target/s390/zvector/long-double-wf.h
new file mode 100644
index 00000000000..a564fc62d47
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/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/zvector/long-double-wfaxb-run.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfaxb-run.c
new file mode 100644
index 00000000000..de7770068ea
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfaxb-run.c
@@ -0,0 +1,11 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+#include <assert.h>
+
+#include "long-double-wfaxb-scan.c"
+
+int
+main (void)
+{
+  assert (wfaxb (1.11L, 2.22L, 3.33L) == 6.66L);
+}
diff --git a/gcc/testsuite/gcc.target/s390/zvector/long-double-wfaxb-scan.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfaxb-scan.c
new file mode 100644
index 00000000000..2bbf408416a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfaxb-scan.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+
+__attribute__ ((noipa, used)) 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 } } */
diff --git a/gcc/testsuite/gcc.target/s390/zvector/long-double-wfaxb.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfaxb.c
new file mode 100644
index 00000000000..354dbe226b0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfaxb.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+
+#include "long-double-wf.h"
+
+LONG_DOUBLE_WF (ADD);
+
+/* { dg-final { scan-assembler {\n\twfaxb\t} } } */
diff --git a/gcc/testsuite/gcc.target/s390/zvector/long-double-wfcxb-0001.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfcxb-0001.c
new file mode 100644
index 00000000000..d0a32d51902
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfcxb-0001.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -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/zvector/long-double-wfcxb-0111.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfcxb-0111.c
new file mode 100644
index 00000000000..04a34e7373c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfcxb-0111.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -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/zvector/long-double-wfcxb-1011.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfcxb-1011.c
new file mode 100644
index 00000000000..f221a56ffb8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfcxb-1011.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -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/zvector/long-double-wfcxb-1101.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfcxb-1101.c
new file mode 100644
index 00000000000..d2353ebe30c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfcxb-1101.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -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/zvector/long-double-wfdxb-run.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfdxb-run.c
new file mode 100644
index 00000000000..7ac752dc289
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfdxb-run.c
@@ -0,0 +1,11 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+#include <assert.h>
+
+#include "long-double-wfdxb-scan.c"
+
+int
+main (void)
+{
+  assert (wfdxb (2.22L, 1.11L, 2.L) == 1.L);
+}
diff --git a/gcc/testsuite/gcc.target/s390/zvector/long-double-wfdxb-scan.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfdxb-scan.c
new file mode 100644
index 00000000000..31eea0f9329
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfdxb-scan.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+
+__attribute__ ((noipa, used)) 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 } } */
diff --git a/gcc/testsuite/gcc.target/s390/zvector/long-double-wfdxb.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfdxb.c
new file mode 100644
index 00000000000..7d854cac1bc
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfdxb.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+
+#include "long-double-wf.h"
+
+LONG_DOUBLE_WF (DIV);
+
+/* { dg-final { scan-assembler {\n\twfdxb\t} } } */
diff --git a/gcc/testsuite/gcc.target/s390/zvector/long-double-wfixb.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfixb.c
new file mode 100644
index 00000000000..5e16ffa58e6
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfixb.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -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/zvector/long-double-wfkxb-0111.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfkxb-0111.c
new file mode 100644
index 00000000000..2e7b1c37d08
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfkxb-0111.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -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/zvector/long-double-wfkxb-1011.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfkxb-1011.c
new file mode 100644
index 00000000000..2d2020af842
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfkxb-1011.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -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/zvector/long-double-wfkxb-1101.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfkxb-1101.c
new file mode 100644
index 00000000000..f17f83ca568
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfkxb-1101.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -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/zvector/long-double-wflcxb.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-wflcxb.c
new file mode 100644
index 00000000000..c69161beca9
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-wflcxb.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -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/zvector/long-double-wflpxb.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-wflpxb.c
new file mode 100644
index 00000000000..df3c1dbccb8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-wflpxb.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -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/zvector/long-double-wfmaxb-2.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfmaxb-2.c
new file mode 100644
index 00000000000..9335680a70c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfmaxb-2.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -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/zvector/long-double-wfmaxb-3.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfmaxb-3.c
new file mode 100644
index 00000000000..9cc2b85f673
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfmaxb-3.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -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/zvector/long-double-wfmaxb-disabled.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfmaxb-disabled.c
new file mode 100644
index 00000000000..c9e5a7b066c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfmaxb-disabled.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -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/zvector/long-double-wfmaxb.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfmaxb.c
new file mode 100644
index 00000000000..fddad943f18
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfmaxb.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -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/zvector/long-double-wfmsxb-disabled.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfmsxb-disabled.c
new file mode 100644
index 00000000000..e78178b9a0b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfmsxb-disabled.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -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/zvector/long-double-wfmsxb.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfmsxb.c
new file mode 100644
index 00000000000..1fe71ecf09f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfmsxb.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -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/zvector/long-double-wfmxb.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfmxb.c
new file mode 100644
index 00000000000..ce311f89db4
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfmxb.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -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/zvector/long-double-wfnmaxb-disabled.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfnmaxb-disabled.c
new file mode 100644
index 00000000000..da8a73adcee
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfnmaxb-disabled.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -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/zvector/long-double-wfnmaxb.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfnmaxb.c
new file mode 100644
index 00000000000..75b28137048
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfnmaxb.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -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/zvector/long-double-wfnmsxb-disabled.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfnmsxb-disabled.c
new file mode 100644
index 00000000000..9a07d049ed4
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfnmsxb-disabled.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -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/zvector/long-double-wfnmsxb.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfnmsxb.c
new file mode 100644
index 00000000000..16b80890725
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfnmsxb.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -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/zvector/long-double-wfsqxb.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfsqxb.c
new file mode 100644
index 00000000000..2f42483dfee
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfsqxb.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -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/zvector/long-double-wfsxb-1.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfsxb-1.c
new file mode 100644
index 00000000000..dd2f244a4eb
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfsxb-1.c
@@ -0,0 +1,21 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzvector -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/zvector/long-double-wfsxb.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfsxb.c
new file mode 100644
index 00000000000..d27cf8ca3de
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-wfsxb.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -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/zvector/long-double-wftcixb-1.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-wftcixb-1.c
new file mode 100644
index 00000000000..6915d8ed8a4
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-wftcixb-1.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -march=z14 -mzvector -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/zvector/long-double-wftcixb.c b/gcc/testsuite/gcc.target/s390/zvector/long-double-wftcixb.c
new file mode 100644
index 00000000000..1134e26ee87
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/long-double-wftcixb.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+
+#include "long-double-wf.h"
+
+LONG_DOUBLE_WF (ISINFL);
+
+/* { dg-final { scan-assembler {\n\twftcixb\t} } } */
-- 
2.25.4


  parent reply	other threads:[~2020-11-03 21:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-03 21:36 [PATCH 0/4] IBM Z: Store long doubles in vector registers when possible Ilya Leoshkevich
2020-11-03 21:36 ` [PATCH 1/4] IBM Z: Remove unused RRe and RXe mode_attrs Ilya Leoshkevich
2020-11-04 17:14   ` Andreas Krebbel
2020-11-03 21:45 ` [PATCH 2/4] IBM Z: Unhardcode NR_C_MODES Ilya Leoshkevich
2020-11-04 17:14   ` Andreas Krebbel
2020-11-03 21:45 ` [PATCH 3/4] IBM Z: Store long doubles in vector registers when possible Ilya Leoshkevich
2020-11-04 17:16   ` Andreas Krebbel
2020-11-04 22:12     ` Ilya Leoshkevich
2020-11-05  7:26       ` Andreas Krebbel
2020-11-03 21:46 ` Ilya Leoshkevich [this message]
2020-11-04 17:28   ` [PATCH 4/4] IBM Z: Test long doubles in vector registers Andreas Krebbel
2020-11-04 22:19     ` Ilya Leoshkevich
2020-11-05  7:28       ` Andreas Krebbel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201103214656.1877781-1-iii@linux.ibm.com \
    --to=iii@linux.ibm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=krebbel@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).