This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/24998] [4.2 Regression] Build failure on sparc-sun-solaris2.9/arm: undefined symbol __floatunsitf



------- Comment #15 from joseph at codesourcery dot com  2005-11-26 03:55 -------
Subject:  Patch for ia64-hpux problems

This patch fixes the ia64-hpux problems with my __floatun* patch.  It adds 
a full set of C implementations of __floatunsi* which should also be 
usable to solve the arm-netbsdelf problems.

Bootstrapped with no regressions on ia64-hp-hpux11.23.  OK to commit?

2005-11-26  Joseph S. Myers  <joseph@codesourcery.com>

        * config/floatunsisf.c, config/floatunsidf.c,
        config/floatunsixf.c, config/floatunsitf.c: New files.
        * config/ia64/t-hpux: Add floatunsitf.c.
        * config/ia64/ia64.c (ia64_init_libfuncs): Use
        _U_Qfcnvxuf_dbl_to_quad for unsigned DImode-to-TFmode conversion.

diff -rupN GCC.orig/gcc/config/floatunsidf.c GCC/gcc/config/floatunsidf.c
--- GCC.orig/gcc/config/floatunsidf.c   1970-01-01 00:00:00.000000000 +0000
+++ GCC/gcc/config/floatunsidf.c        2005-11-25 15:21:38.000000000 +0000
@@ -0,0 +1,15 @@
+/* Public domain.  */
+typedef int SItype __attribute__ ((mode (SI)));
+typedef unsigned int USItype __attribute__ ((mode (SI)));
+typedef float DFtype __attribute__ ((mode (DF)));
+
+DFtype
+__floatunsidf (USItype u)
+{
+  SItype s = (SItype) u;
+  DFtype r = (DFtype) s;
+  if (s < 0)
+    r += (DFtype)2.0 * (DFtype) ((USItype) 1
+                                << (sizeof (USItype) * __CHAR_BIT__ - 1));
+  return r;
+}
diff -rupN GCC.orig/gcc/config/floatunsisf.c GCC/gcc/config/floatunsisf.c
--- GCC.orig/gcc/config/floatunsisf.c   1970-01-01 00:00:00.000000000 +0000
+++ GCC/gcc/config/floatunsisf.c        2005-11-25 15:26:54.000000000 +0000
@@ -0,0 +1,18 @@
+/* Public domain.  */
+typedef int SItype __attribute__ ((mode (SI)));
+typedef unsigned int USItype __attribute__ ((mode (SI)));
+typedef float SFtype __attribute__ ((mode (SF)));
+
+SFtype
+__floatunsisf (USItype u)
+{
+  SItype s = (SItype) u;
+  if (s < 0)
+    {
+      /* As in expand_float, compute (u & 1) | (u >> 1) to ensure
+        correct rounding if a nonzero bit is shifted out.  */
+      return (SFtype) 2.0 * (SFtype) (SItype) ((u & 1) | (u >> 1));
+    }
+  else
+    return (SFtype) s;
+}
diff -rupN GCC.orig/gcc/config/floatunsitf.c GCC/gcc/config/floatunsitf.c
--- GCC.orig/gcc/config/floatunsitf.c   1970-01-01 00:00:00.000000000 +0000
+++ GCC/gcc/config/floatunsitf.c        2005-11-25 15:21:48.000000000 +0000
@@ -0,0 +1,15 @@
+/* Public domain.  */
+typedef int SItype __attribute__ ((mode (SI)));
+typedef unsigned int USItype __attribute__ ((mode (SI)));
+typedef float TFtype __attribute__ ((mode (TF)));
+
+TFtype
+__floatunsitf (USItype u)
+{
+  SItype s = (SItype) u;
+  TFtype r = (TFtype) s;
+  if (s < 0)
+    r += (TFtype)2.0 * (TFtype) ((USItype) 1
+                                << (sizeof (USItype) * __CHAR_BIT__ - 1));
+  return r;
+}
diff -rupN GCC.orig/gcc/config/floatunsixf.c GCC/gcc/config/floatunsixf.c
--- GCC.orig/gcc/config/floatunsixf.c   1970-01-01 00:00:00.000000000 +0000
+++ GCC/gcc/config/floatunsixf.c        2005-11-25 15:21:43.000000000 +0000
@@ -0,0 +1,15 @@
+/* Public domain.  */
+typedef int SItype __attribute__ ((mode (SI)));
+typedef unsigned int USItype __attribute__ ((mode (SI)));
+typedef float XFtype __attribute__ ((mode (XF)));
+
+XFtype
+__floatunsixf (USItype u)
+{
+  SItype s = (SItype) u;
+  XFtype r = (XFtype) s;
+  if (s < 0)
+    r += (XFtype)2.0 * (XFtype) ((USItype) 1
+                                << (sizeof (USItype) * __CHAR_BIT__ - 1));
+  return r;
+}
diff -rupN GCC.orig/gcc/config/ia64/ia64.c GCC/gcc/config/ia64/ia64.c
--- GCC.orig/gcc/config/ia64/ia64.c     2005-11-20 16:20:24.000000000 +0000
+++ GCC/gcc/config/ia64/ia64.c  2005-11-25 15:10:32.000000000 +0000
@@ -8437,6 +8437,9 @@ ia64_init_libfuncs (void)

   set_conv_libfunc (sfloat_optab, TFmode, SImode, "_U_Qfcnvxf_sgl_to_quad");
   set_conv_libfunc (sfloat_optab, TFmode, DImode, "_U_Qfcnvxf_dbl_to_quad");
+  /* HP-UX 11.23 libc does not have a function for unsigned
+     SImode-to-TFmode conversion.  */
+  set_conv_libfunc (ufloat_optab, TFmode, DImode, "_U_Qfcnvxuf_dbl_to_quad");
 }

 /* Rename all the TFmode libfuncs using the HPUX conventions.  */
diff -rupN GCC.orig/gcc/config/ia64/t-hpux GCC/gcc/config/ia64/t-hpux
--- GCC.orig/gcc/config/ia64/t-hpux     2005-10-28 23:33:38.000000000 +0000
+++ GCC/gcc/config/ia64/t-hpux  2005-11-25 15:38:27.000000000 +0000
@@ -9,7 +9,7 @@ MULTILIB_MATCHES =

 # Support routines for HP-UX 128 bit floats.

-LIB2FUNCS_EXTRA=quadlib.c
+LIB2FUNCS_EXTRA=quadlib.c $(srcdir)/config/floatunsitf.c

 quadlib.c: $(srcdir)/config/ia64/quadlib.c
        cat $(srcdir)/config/ia64/quadlib.c > quadlib.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24998


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]