]> gcc.gnu.org Git - gcc.git/commit
PR target/107299: Fix build issue when long double is IEEE 128-bit
authorMichael Meissner <meissner@linux.ibm.com>
Wed, 18 Jan 2023 16:19:20 +0000 (11:19 -0500)
committerMichael Meissner <meissner@linux.ibm.com>
Wed, 18 Jan 2023 16:19:20 +0000 (11:19 -0500)
commitd54e3d92dd6541057c7feb7dace84f4eb8497012
tree14a337b13675b826b7ba04741c5ee7d95f61dd02
parent68ed94d070d5b216376052662f57532afa088c1d
PR target/107299: Fix build issue when long double is IEEE 128-bit

This patch updates the IEEE 128-bit types used in libgcc.

At the moment, we cannot build GCC when the target uses IEEE 128-bit long
doubles, such as building the compiler for a native Fedora 36 system.  The
build dies when it is trying to build the _mulkc3.c and _divkc3 modules.

This patch changes libgcc to use long double for the IEEE 128-bit base type if
long double is IEEE 128-bit, and it uses _Float128 otherwise.  The built-in
functions are adjusted to be the correct version based on the IEEE 128-bit base
type used.

While it is desirable to ultimately have __float128 and _Float128 use the same
internal type and mode within GCC, at present if you use the option
-mabi=ieeelongdouble, the __float128 type will use the long double type and not
the _Float128 type.  We get an internal compiler error if we combine the
signbitf128 built-in with a long double type.

I've gone through several iterations of trying to fix this within GCC, and
there are various problems that have come up.  I developed this alternative
patch that changes libgcc so that it does not tickle the issue.  I hope we can
fix the compiler at some point, but right now, this is preventing people on
Fedora 36 systems from building compilers where the default long double is IEEE
128-bit.

2023-01-18   Michael Meissner  <meissner@linux.ibm.com>

PR target/107299
* config/rs6000/_divkc3.c (COPYSIGN): Use the correct built-in based on
whether long double is IBM or IEEE.
(INFINITY): Likewise.
(FABS): Likewise.
* config/rs6000/_mulkc3.c (COPYSIGN): Likewise.
(INFINITY): Likewise.
* config/rs6000/quad-float128.h (TF): Remove definition.
(TFtype): Define to be long double or _Float128.
(TCtype): Define to be _Complex long double or _Complex _Float128.
* libgcc2.h (TFtype): Allow machine config files to override this.
(TCtype): Likewise.
* soft-fp/quad.h (TFtype): Likewise.
libgcc/config/rs6000/_divkc3.c
libgcc/config/rs6000/_mulkc3.c
libgcc/config/rs6000/quad-float128.h
libgcc/libgcc2.h
libgcc/soft-fp/quad.h
This page took 0.06002 seconds and 6 git commands to generate.