diff mbox series

[2/2] PowerPC: Use __builtin_pack_ibm128 instead of __builtin_pack_longdouble.

Message ID 20210114214901.GB14839@ibm-toto.the-meissners.org
State New
Headers show
Series PowerPC: Add __ibm128 to PowerPC targets without float128 support | expand

Commit Message

Michael Meissner Jan. 14, 2021, 9:49 p.m. UTC
[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  <meissner@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 mbox series

Patch

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
   {