--- /dev/null
+/* { 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 } } */
--- /dev/null
+/* { dg-do run } */
+/* { dg-options "-O3 -march=z14 -mzarch" } */
+#include "long-double-callee-abi-scan.c"
+#include "long-double-caller-abi-scan.c"
--- /dev/null
+/* { 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 } } */
--- /dev/null
+/* { 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);
+}
--- /dev/null
+/* { 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);
+}
--- /dev/null
+/* { 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);
+}
--- /dev/null
+/* { 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);
+}
--- /dev/null
+/* { 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);
+}
--- /dev/null
+/* { 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);
+}
--- /dev/null
+/* { 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);
+}
--- /dev/null
+/* { 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);
+}
--- /dev/null
+/* { 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);
+}
--- /dev/null
+/* { 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);
+}
--- /dev/null
+/* { 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);
+}
--- /dev/null
+/* { 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);
+}
--- /dev/null
+/* { 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.);
+}
--- /dev/null
+/* { 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);
+}
--- /dev/null
+/* { 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);
+}
--- /dev/null
+/* { 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);
+}
--- /dev/null
+/* { 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);
+}
--- /dev/null
+/* { 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);
+}
--- /dev/null
+/* { 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);
+}
--- /dev/null
+/* { 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);
+}
--- /dev/null
+/* { 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);
+}
--- /dev/null
+/* { 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);
+}
--- /dev/null
+/* { 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++;
+}
--- /dev/null
+#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
--- /dev/null
+/* { 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);
+}
--- /dev/null
+/* { 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} } } */
--- /dev/null
+/* { 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} } } */
--- /dev/null
+/* { 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} } } */
--- /dev/null
+/* { 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} } } */
--- /dev/null
+/* { 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);
+}
--- /dev/null
+/* { 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} } } */
--- /dev/null
+/* { 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} } } */
--- /dev/null
+/* { 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} } } */
--- /dev/null
+/* { 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} } } */
--- /dev/null
+/* { 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} } } */
--- /dev/null
+/* { 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} } } */
--- /dev/null
+/* { 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;
+ }
+}
--- /dev/null
+/* { 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;
+ }
+}
--- /dev/null
+/* { 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} } } */
--- /dev/null
+/* { 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} } } */
--- /dev/null
+/* { 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} } } */
--- /dev/null
+/* { 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} } } */
--- /dev/null
+/* { 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} } } */
--- /dev/null
+/* { 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} } } */
--- /dev/null
+/* { 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} } } */
--- /dev/null
+/* { 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} } } */
--- /dev/null
+/* { 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} } } */
--- /dev/null
+/* { 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} } } */
--- /dev/null
+/* { 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);
+}
--- /dev/null
+/* { 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} } } */
--- /dev/null
+/* { 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} } } */
--- /dev/null
+/* { 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} } } */