[PATCH 2/2] PowerPC: Use __builtin_pack_ibm128 instead of __builtin_pack_longdouble.
In the patch submitted on October 22nd, 2020: https://gcc.gnu.org/pipermail/gcc-patches/2020-October/556869.html https://gcc.gnu.org/pipermail/gcc-patches/2020-October/557529.html Segher suggested that rather than add #ifdef code in libgcc's ibm-ldouble.c to use __builtin_pack_ibm128 instead of __builtin_pack_longdouble, that I should instead make __ibm128 available in targets that have 128-bit IBM long double, but don't support __float128/_Float128. This patch fixes the libgcc library to use __builtin_pack_ibm128 all of the time. I have tested these patches on a little endian power9 server system and there were no regressions. I have also tested the paches on a big endian power8 server system and there were no regressions. On the big endian system, I have built both compilers with power8 being the default cpu and power5 being the default cpu. I have verified that ibm-ldouble does use the ibm128 pack built-in function. Can i check this patch into the master branch once the previous patch has been commited? libgcc/ 2021-01-13 Michael Meissner <meiss...@linux.ibm.com> * config/rs6000/ibm-ldouble.c (pack_ldouble): Use __builtin_pack_ibm128 instead of __builtin_pack_longdouble. --- libgcc/config/rs6000/ibm-ldouble.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libgcc/config/rs6000/ibm-ldouble.c b/libgcc/config/rs6000/ibm-ldouble.c index 4c13453f975..92b4b4c583d 100644 --- a/libgcc/config/rs6000/ibm-ldouble.c +++ b/libgcc/config/rs6000/ibm-ldouble.c @@ -102,9 +102,9 @@ __asm__ (".symver __gcc_qadd,_xlqadd@GCC_3.4\n\t" static inline IBM128_TYPE pack_ldouble (double dh, double dl) { -#if defined (__LONG_DOUBLE_128__) && defined (__LONG_DOUBLE_IBM128__) \ +#if defined (__LONG_DOUBLE_128__) \ && !(defined (_SOFT_FLOAT) || defined (__NO_FPRS__)) - return __builtin_pack_longdouble (dh, dl); + return __builtin_pack_ibm128 (dh, dl); #else union { -- 2.22.0 -- Michael Meissner, IBM IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA email: meiss...@linux.ibm.com, phone: +1 (978) 899-4797