aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/config/floatunsidf.c15
-rw-r--r--gcc/config/floatunsisf.c18
-rw-r--r--gcc/config/floatunsitf.c15
-rw-r--r--gcc/config/floatunsixf.c15
-rw-r--r--gcc/config/ia64/ia64.c3
-rw-r--r--gcc/config/ia64/t-hpux2
7 files changed, 75 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0ee870d..b654b62 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2005-11-27 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.
+
2005-11-26 Richard Henderson <rth@redhat.com>
* c-lex.c (pragma_lex): Rename from c_lex.
diff --git a/gcc/config/floatunsidf.c b/gcc/config/floatunsidf.c
new file mode 100644
index 0000000..ff28112
--- /dev/null
+++ b/gcc/config/floatunsidf.c
@@ -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 --git a/gcc/config/floatunsisf.c b/gcc/config/floatunsisf.c
new file mode 100644
index 0000000..11d4aa7
--- /dev/null
+++ b/gcc/config/floatunsisf.c
@@ -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 --git a/gcc/config/floatunsitf.c b/gcc/config/floatunsitf.c
new file mode 100644
index 0000000..955d676
--- /dev/null
+++ b/gcc/config/floatunsitf.c
@@ -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 --git a/gcc/config/floatunsixf.c b/gcc/config/floatunsixf.c
new file mode 100644
index 0000000..5251168
--- /dev/null
+++ b/gcc/config/floatunsixf.c
@@ -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 --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index b11583d..7267625 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -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 --git a/gcc/config/ia64/t-hpux b/gcc/config/ia64/t-hpux
index 2897739..7d294d1 100644
--- a/gcc/config/ia64/t-hpux
+++ b/gcc/config/ia64/t-hpux
@@ -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