floatunsisf.c, [...]: New files.

* 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.

From-SVN: r107558
This commit is contained in:
Joseph Myers 2005-11-27 01:40:01 +00:00 committed by Joseph Myers
parent b48a88cdcb
commit 2a3ebe774c
7 changed files with 75 additions and 1 deletions

View File

@ -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.

15
gcc/config/floatunsidf.c Normal file
View File

@ -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;
}

18
gcc/config/floatunsisf.c Normal file
View File

@ -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;
}

15
gcc/config/floatunsitf.c Normal file
View File

@ -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;
}

15
gcc/config/floatunsixf.c Normal file
View File

@ -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;
}

View File

@ -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. */

View File

@ -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