]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libgcc2.c (__floatdisf, [...]): Don't use IBM Extended Double TFmode.
authorAlan Modra <amodra@bigpond.net.au>
Fri, 20 Jan 2006 00:42:29 +0000 (00:42 +0000)
committerAlan Modra <amodra@gcc.gnu.org>
Fri, 20 Jan 2006 00:42:29 +0000 (11:12 +1030)
* libgcc2.c (__floatdisf, __floatdidf): Don't use IBM Extended
Double TFmode.
(__floatundisf, __floatundidf): Likewise.
* libgcc2.h (IS_IBM_EXTENDED): Define.

From-SVN: r110004

gcc/ChangeLog
gcc/libgcc2.c
gcc/libgcc2.h

index b434a9cd568116a72be69ac833407247306ffcb9..8aaec41158b25b6d80c601eabef2523b01b7d55c 100644 (file)
@@ -1,3 +1,10 @@
+2006-01-20  Alan Modra  <amodra@bigpond.net.au>
+
+       * libgcc2.c (__floatdisf, __floatdidf): Don't use IBM Extended
+       Double TFmode.
+       (__floatundisf, __floatundidf): Likewise.
+       * libgcc2.h (IS_IBM_EXTENDED): Define.
+
 2006-01-19  DJ Delorie  <dj@redhat.com>
 
        * config/m32c/m32c.h (REG_ALLOC_ORDER): Define.
index 03cc448cab3e9e86f35a83bb73ed3c218ce2e6a3..97717a428c92740b3bbc644e6c612bea4481bd60 100644 (file)
@@ -1371,7 +1371,14 @@ __floatunditf (UDWtype u)
 #if (defined(L_floatdisf) && LIBGCC2_HAS_SF_MODE)      \
      || (defined(L_floatdidf) && LIBGCC2_HAS_DF_MODE)
 #define DI_SIZE (W_TYPE_SIZE * 2)
-#define F_MODE_OK(SIZE) (SIZE < DI_SIZE && SIZE > (DI_SIZE - SIZE + FSSIZE))
+#define F_MODE_OK(SIZE) \
+  (SIZE < DI_SIZE                                                      \
+   && SIZE > (DI_SIZE - SIZE + FSSIZE)                                 \
+   /* Don't use IBM Extended Double TFmode for TI->SF calculations.    \
+      The conversion from long double to float suffers from double     \
+      rounding, because we convert via double.  In any case, the       \
+      fallback code is faster.  */                                     \
+   && !IS_IBM_EXTENDED (SIZE))
 #if defined(L_floatdisf)
 #define FUNC __floatdisf
 #define FSTYPE SFtype
@@ -1476,7 +1483,14 @@ FUNC (DWtype u)
 #if (defined(L_floatundisf) && LIBGCC2_HAS_SF_MODE)    \
      || (defined(L_floatundidf) && LIBGCC2_HAS_DF_MODE)
 #define DI_SIZE (W_TYPE_SIZE * 2)
-#define F_MODE_OK(SIZE) (SIZE < DI_SIZE && SIZE > (DI_SIZE - SIZE + FSSIZE))
+#define F_MODE_OK(SIZE) \
+  (SIZE < DI_SIZE                                                      \
+   && SIZE > (DI_SIZE - SIZE + FSSIZE)                                 \
+   /* Don't use IBM Extended Double TFmode for TI->SF calculations.    \
+      The conversion from long double to float suffers from double     \
+      rounding, because we convert via double.  In any case, the       \
+      fallback code is faster.  */                                     \
+   && !IS_IBM_EXTENDED (SIZE))
 #if defined(L_floatundisf)
 #define FUNC __floatundisf
 #define FSTYPE SFtype
index f8056d66e141e4e4b8fb3a8a93bc5daad518a678..f24854f97ed5f1cc3dd0a95b6d197d5179b6840d 100644 (file)
@@ -117,6 +117,14 @@ extern short int __get_eh_table_version (struct exception_descriptor *);
 #endif
 #endif
 
+/* FIXME: This #ifdef probably should be removed, ie. enable the test
+   for mips too.  */
+#ifdef __powerpc__
+#define IS_IBM_EXTENDED(SIZE) (SIZE == 106)
+#else
+#define IS_IBM_EXTENDED(SIZE) 0
+#endif
+
 #ifndef MIN_UNITS_PER_WORD
 #define MIN_UNITS_PER_WORD UNITS_PER_WORD
 #endif