In a previous patch, I added code to ibm-ldouble.c to use __builtin_pack_ibm128
if long double is IEEE 128-bit and continue to use __builtin_pack_longdouble
if long double is IBM extended double. This code was needed because
__builtin_pack_ibm128 is not available unless the __ibm128 keyword is
availabe. In the current code, __ibm128 is only enabled if we have support for
both IBM and IEEE 128-bit long double.
Segher suggested that instead I should make __ibm128, __builtin_pack_ibm128,
and __builtin_unpack_ibm128 available on older systems that don't support IEEE
128-bit floating point but does support the IBM extended double floating point.
This patch changes the code so that __ibm128 is now exported if either
long double uses the IBM extended double format, or IEEE 128-bit floating
point is available.
I changed the internal built-in types from float128 to ibm128, since the
only built-in functions that use this are __builtin_pack_ibm128 and
__builtin_unpack_ibm128, and the new name matches the function.
gcc/
2021-04-28 Michael Meissner <meissner@linux.ibm.com>
* config/rs6000/rs6000-builtin.def (BU_IBM128_2): Rename
RS6000_BTM_IBM128 from RS6000_BTM_FLOAT128.
* config/rs6000/rs6000-call.c (rs6000_invalid_builtin): Update
error message for __ibm128 built-in functions.
(rs6000_init_builtins): Create the __ibm128 keyword on older
systems where long double uses the IBM extended double format,
even if they don't support IEEE 128-bit floating point.
* config/rs6000/rs6000.c (rs6000_builtin_mask_calculate): Rename
RS6000_BTM_IBM128 from RS6000_BTM_FLOAT128.
(rs6000_builtin_mask_names): Rename RS6000_BTM_IBM128 from
RS6000_BTM_FLOAT128.
* config/rs6000/rs6000.h (TARGET_IBM128): New macro.
(RS6000_BTM_IBM128): Rename from RS6000_BTM_FLOAT128.
(RS6000_BTM_COMMON): Rename RS6000_BTM_IBM128 from
RS6000_BTM_FLOAT128.