]> gcc.gnu.org Git - gcc.git/commit
PowerPC: Map IEEE 128-bit long double built-in functions.
authorMichael Meissner <meissner@linux.ibm.com>
Wed, 2 Dec 2020 19:00:20 +0000 (14:00 -0500)
committerMichael Meissner <meissner@linux.ibm.com>
Wed, 2 Dec 2020 19:00:20 +0000 (14:00 -0500)
commit43da2e44e1c9aae1f5cde6fb2808b1f710041b67
treed86b28dd6510d51c516425ba356e5267ed3a1943
parent1042c8bcd730144de16ea6c96aec191bf2113609
PowerPC: Map IEEE 128-bit long double built-in functions.

This patch replaces patches previously submitted:

September 24th, 2020:
Message-ID: <20200924203159.GA31597@ibm-toto.the-meissners.org>

October 9th, 2020:
Message-ID: <20201009043543.GA11343@ibm-toto.the-meissners.org>

October 24th, 2020:
Message-ID: <20201022220346.GA8151@ibm-toto.the-meissners.org>

This patch maps the built-in functions that take or return long double
arguments on systems where long double is IEEE 128-bit.

This patch goes through the built-in functions and changes the name of the
math, scanf, and printf built-in functions to use the functions that GLIBC
provides when long double uses the IEEE 128-bit representation.

In addition, changing the name in GCC allows the Fortran compiler to
automatically use the correct name.

To map the math functions, typically this patch changes <name>l to
__<name>ieee128.  However there are some exceptions that are handled with this
patch.

To map the printf functions, <name> is mapped to __<name>ieee128.

To map the scanf functions, <name> is mapped to __isoc99_<name>ieee128.

With the other IEEE long double patches, I have tested this patch by building 3
bootstrap compilers on a little endian power9 system, using the Advance
Toolchain AT14.0 library, which uses GLIBC 2.32:

    1) One compiler defaulted long double to IBM extended double;
    2) One compiler defaulted long double to IEEE 128-bit; (and)
    3) One compiler defaulted long double to 64 bit.

I was able to bootstrap each compiler and run make check.  In addition for the
compilers using the two 128-bit long double types (IBM, IEEE), I have built the
spec 2017 benchmark for both power9 and power10.

At the moment, there are some differences between between the three runs for
make check.  I have some patches to fix these issue that I've done in the past,
and I will be working on resubmitting them in the future.

In addition, there are 3 fortran benchmarks (ieee/large_2.f90,
default_format_2.f90, and default_format_denormal_2.f90) that now pass when the
long double default is IEEE 128-bit.

gcc/
2020-12-02  Michael Meissner  <meissner@linux.ibm.com>

* config/rs6000/rs6000.c (rs6000_mangle_decl_assembler_name): Add
support for mapping built-in function names for long double
built-in functions if long double is IEEE 128-bit.

gcc/testsuite/
2020-12-02  Michael Meissner  <meissner@linux.ibm.com>

* gcc.target/powerpc/float128-longdouble-math.c: New test.
* gcc.target/powerpc/float128-longdouble-stdio.c: New test.
* gcc.target/powerpc/float128-math.c: Adjust test for new name
being generated.  Add support for running test on power10.  Add
support for running if long double defaults to 64-bits.
gcc/config/rs6000/rs6000.c
gcc/testsuite/gcc.target/powerpc/float128-longdouble-math.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/float128-longdouble-stdio.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/float128-math.c
This page took 0.085619 seconds and 6 git commands to generate.