From e7722a2fed9f0a35d25c2a2145e0dba084e48653 Mon Sep 17 00:00:00 2001 From: Michael Meissner Date: Thu, 21 Sep 2017 22:41:08 +0000 Subject: [PATCH] 2017-09-13 Michael Meissner * gcc.target/powerpc/float128-fma1.c: New test. * gcc.target/powerpc/float128-fma2.c: Likewise. * gcc.target/powerpc/float128-sqrt1.c: Likewise. * gcc.target/powerpc/float128-sqrt2.c: Likewise. From-SVN: r253083 --- .../gcc.target/powerpc/float128-fma1.c | 32 +++++++++++++++++++ .../gcc.target/powerpc/float128-fma2.c | 9 ++++++ .../gcc.target/powerpc/float128-sqrt1.c | 11 +++++++ .../gcc.target/powerpc/float128-sqrt2.c | 9 ++++++ 4 files changed, 61 insertions(+) create mode 100644 gcc/testsuite/gcc.target/powerpc/float128-fma1.c create mode 100644 gcc/testsuite/gcc.target/powerpc/float128-fma2.c create mode 100644 gcc/testsuite/gcc.target/powerpc/float128-sqrt1.c create mode 100644 gcc/testsuite/gcc.target/powerpc/float128-sqrt2.c diff --git a/gcc/testsuite/gcc.target/powerpc/float128-fma1.c b/gcc/testsuite/gcc.target/powerpc/float128-fma1.c new file mode 100644 index 00000000000..9bc538ed859 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/float128-fma1.c @@ -0,0 +1,32 @@ +/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-options "-mpower9-vector -O2" } */ + +__float128 +xfma (__float128 a, __float128 b, __float128 c) +{ + return __builtin_fmaf128 (a, b, c); +} + +__float128 +xfms (__float128 a, __float128 b, __float128 c) +{ + return __builtin_fmaf128 (a, b, -c); +} + +__float128 +xfnma (__float128 a, __float128 b, __float128 c) +{ + return -__builtin_fmaf128 (a, b, c); +} + +__float128 +xfnms (__float128 a, __float128 b, __float128 c) +{ + return -__builtin_fmaf128 (a, b, -c); +} + +/* { dg-final { scan-assembler "xsmaddqp" } } */ +/* { dg-final { scan-assembler "xsmsubqp" } } */ +/* { dg-final { scan-assembler "xsnmaddqp" } } */ +/* { dg-final { scan-assembler "xsnmsubqp" } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/float128-fma2.c b/gcc/testsuite/gcc.target/powerpc/float128-fma2.c new file mode 100644 index 00000000000..e5f15aa2de9 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/float128-fma2.c @@ -0,0 +1,9 @@ +/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-options "-mpower9-vector -mno-float128-hardware -O2" } */ + +__float128 +xfma (__float128 a, __float128 b, __float128 c) +{ + return __builtin_fmaf128 (a, b, c); /* { dg-error "ISA 3.0 IEEE 128-bit" } */ +} diff --git a/gcc/testsuite/gcc.target/powerpc/float128-sqrt1.c b/gcc/testsuite/gcc.target/powerpc/float128-sqrt1.c new file mode 100644 index 00000000000..792aa05e030 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/float128-sqrt1.c @@ -0,0 +1,11 @@ +/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-options "-mpower9-vector -O2" } */ + +__float128 +xsqrt (__float128 a) +{ + return __builtin_sqrtf128 (a); +} + +/* { dg-final { scan-assembler "xssqrtqp" } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/float128-sqrt2.c b/gcc/testsuite/gcc.target/powerpc/float128-sqrt2.c new file mode 100644 index 00000000000..94527ebbd98 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/float128-sqrt2.c @@ -0,0 +1,9 @@ +/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-options "-mpower9-vector -mno-float128-hardware -O2" } */ + +__float128 +xsqrt (__float128 a) +{ + return __builtin_sqrtf128 (a); /* { dg-error "ISA 3.0 IEEE 128-bit" } */ +} -- 2.30.2