From 661eb8f9e5270df79c21601273219e2a8e282204 Mon Sep 17 00:00:00 2001 From: Michael Meissner Date: Fri, 20 Apr 2018 21:27:08 +0000 Subject: re PR target/85456 (PowerPC: Using -mabi=ieeelongdouble calls wrong function for __builtin_powi.) [libgcc] 2018-04-20 Michael Meissner PR target/85456 * config/rs6000/_powikf2.c: New file. Add support for the __builtin_powil function when long double is IEEE 128-bit floating point. * config/rs6000/float128-ifunc.c (__powikf2_resolve): Add __powikf2 support. (__powikf2): Likewise. * config/rs6000/quad-float128.h (__powikf2_sw): Likewise. (__powikf2_hw): Likewise. (__powikf2): Likewise. * config/rs6000/t-float128 (fp128_ppc_funcs): Likewise. * config/rs6000/t-float128-hw (fp128_hw_func): Likewise. (_powikf2-hw.c): Likewise. [gcc] 2018-04-20 Michael Meissner PR target/85456 * config/rs6000/rs6000.c (init_float128_ieee): Add support to call __powikf2 when long double is IEEE 128-bit. [gcc/testsuite] 2018-04-20 Michael Meissner PR target/85456 * gcc.target/powerpc/pr85456.c: New test. From-SVN: r259533 --- gcc/ChangeLog | 6 ++++++ gcc/config/rs6000/rs6000.c | 1 + gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/powerpc/pr85456.c | 14 ++++++++++++++ 4 files changed, 26 insertions(+) create mode 100644 gcc/testsuite/gcc.target/powerpc/pr85456.c (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d25e3e3..b58362d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-04-20 Michael Meissner + + PR target/85456 + * config/rs6000/rs6000.c (init_float128_ieee): Add support to call + __powikf2 when long double is IEEE 128-bit. + 2018-04-20 Kito Cheng * config/riscv/riscv.c (riscv_first_stack_step): Round up min diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 7ba908e..cbd4cfe 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -18657,6 +18657,7 @@ init_float128_ieee (machine_mode mode) set_optab_libfunc (sdiv_optab, mode, "__divkf3"); set_optab_libfunc (sqrt_optab, mode, "__sqrtkf2"); set_optab_libfunc (abs_optab, mode, "__abstkf2"); + set_optab_libfunc (powi_optab, mode, "__powitkf2"); set_optab_libfunc (eq_optab, mode, "__eqkf2"); set_optab_libfunc (ne_optab, mode, "__nekf2"); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 29808a1..5314d9e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-04-20 Michael Meissner + + PR target/85456 + * gcc.target/powerpc/pr85456.c: New test. + 2018-04-20 Bill Schmidt * g++.dg/ext/undef-bool-1.C: Require lp64. diff --git a/gcc/testsuite/gcc.target/powerpc/pr85456.c b/gcc/testsuite/gcc.target/powerpc/pr85456.c new file mode 100644 index 0000000..b9df16a --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr85456.c @@ -0,0 +1,14 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-require-effective-target powerpc_p8vector_ok } */ +/* { dg-options "-O2 -mpower8-vector -mabi=ieeelongdouble -Wno-psabi" } */ + +/* Check that the __builtin_powil generates a call to the correct function + when long double uses IEEE 128-bit floating point. */ + +long double +do_powl (long double a, int i) +{ + return __builtin_powil (a, i); +} + +/* { dg-final { scan-assembler "bl __powikf2" } } */ -- cgit v1.1