public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/meissner/heads/work018)] PowerPC: Use __builtin_pack_ieee128 if long double is IEEE 128-bit.
@ 2020-09-24  2:36 Michael Meissner
  0 siblings, 0 replies; only message in thread
From: Michael Meissner @ 2020-09-24  2:36 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:c629cfb53d4ac6c7a19bf4cad83e965f9c033e17

commit c629cfb53d4ac6c7a19bf4cad83e965f9c033e17
Author: Michael Meissner <meissner@linux.ibm.com>
Date:   Wed Sep 23 22:35:51 2020 -0400

    PowerPC: Use __builtin_pack_ieee128 if long double is IEEE 128-bit.
    
    libgcc/
    2020-09-23  Michael Meissner  <meissner@linux.ibm.com>
    
            * config/rs6000/ibm-ldouble.c (pack_ldouble): Use
            __builtin_pack_ieee128 if long double is IEEE 128-bit.

Diff:
---
 libgcc/config/rs6000/ibm-ldouble.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/libgcc/config/rs6000/ibm-ldouble.c b/libgcc/config/rs6000/ibm-ldouble.c
index dd2a02373f2..767fdd72683 100644
--- a/libgcc/config/rs6000/ibm-ldouble.c
+++ b/libgcc/config/rs6000/ibm-ldouble.c
@@ -102,9 +102,17 @@ __asm__ (".symver __gcc_qadd,_xlqadd@GCC_3.4\n\t"
 static inline IBM128_TYPE
 pack_ldouble (double dh, double dl)
 {
+  /* If we are building on a non-VSX system, the __ibm128 type is not defined.
+     This means we can't always use __builtin_pack_ibm128.  Instead, we use
+     __builtin_pack_longdouble if long double uses the IBM extended double
+     128-bit format, and use the explicit __builtin_pack_ibm128 if long double
+     is IEEE 128-bit.  */
 #if defined (__LONG_DOUBLE_128__) && defined (__LONG_DOUBLE_IBM128__)	\
     && !(defined (_SOFT_FLOAT) || defined (__NO_FPRS__))
   return __builtin_pack_longdouble (dh, dl);
+#elif defined (__LONG_DOUBLE_128__) && defined (__LONG_DOUBLE_IEEE128__) \
+    && !(defined (_SOFT_FLOAT) || defined (__NO_FPRS__))
+  return __builtin_pack_ibm128 (dh, dl);
 #else
   union
   {


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-09-24  2:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-24  2:36 [gcc(refs/users/meissner/heads/work018)] PowerPC: Use __builtin_pack_ieee128 if long double is IEEE 128-bit Michael Meissner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).