From: Alan Modra Date: Fri, 25 Nov 2005 06:41:48 +0000 (+0000) Subject: ppc64-fp.c (__floatunditf): New function. X-Git-Tag: releases/gcc-4.2.0~5761 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3f231c29370df4a5b2ff441d8df1c0b8f5e87804;p=thirdparty%2Fgcc.git ppc64-fp.c (__floatunditf): New function. * config/rs6000/ppc64-fp.c (__floatunditf): New function. (__floatundidf, __floatundisf): Likewise. From-SVN: r107494 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6b19608c8ffd..4e4a94a7d1a1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2005-11-25 Alan Modra + + * config/rs6000/ppc64-fp.c (__floatunditf): New function. + (__floatundidf, __floatundisf): Likewise. + 2005-11-25 David Edelsohn * config/rs6000/rs6000.c (rs6000_sr_alias_set): Delete. diff --git a/gcc/config/rs6000/ppc64-fp.c b/gcc/config/rs6000/ppc64-fp.c index cb8e585484c1..6be3ca8235fe 100644 --- a/gcc/config/rs6000/ppc64-fp.c +++ b/gcc/config/rs6000/ppc64-fp.c @@ -39,8 +39,11 @@ extern DItype __fixsfdi (SFtype); extern USItype __fixunsdfsi (DFtype); extern USItype __fixunssfsi (SFtype); extern TFtype __floatditf (DItype); +extern TFtype __floatunditf (UDItype); extern DFtype __floatdidf (DItype); +extern DFtype __floatundidf (UDItype); extern SFtype __floatdisf (DItype); +extern SFtype __floatundisf (UDItype); extern DItype __fixunstfdi (TFtype); static DItype local_fixunssfdi (SFtype); @@ -100,6 +103,18 @@ __floatditf (DItype u) return (TFtype) dh + (TFtype) dl; } +TFtype +__floatunditf (UDItype u) +{ + DFtype dh, dl; + + dh = (USItype) (u >> (sizeof (SItype) * 8)); + dh *= 2.0 * (((UDItype) 1) << ((sizeof (SItype) * 8) - 1)); + dl = (USItype) (u & ((((UDItype) 1) << (sizeof (SItype) * 8)) - 1)); + + return (TFtype) dh + (TFtype) dl; +} + DFtype __floatdidf (DItype u) { @@ -112,6 +127,18 @@ __floatdidf (DItype u) return d; } +DFtype +__floatundidf (UDItype u) +{ + DFtype d; + + d = (USItype) (u >> (sizeof (SItype) * 8)); + d *= 2.0 * (((UDItype) 1) << ((sizeof (SItype) * 8) - 1)); + d += (USItype) (u & ((((UDItype) 1) << (sizeof (SItype) * 8)) - 1)); + + return d; +} + SFtype __floatdisf (DItype u) { @@ -137,6 +164,30 @@ __floatdisf (DItype u) return (SFtype) f; } +SFtype +__floatundisf (UDItype u) +{ + DFtype f; + + if (53 < (sizeof (DItype) * 8) + && 53 > ((sizeof (DItype) * 8) - 53 + 24)) + { + if (u >= ((UDItype) 1 << 53)) + { + if ((UDItype) u & (((UDItype) 1 << ((sizeof (DItype) * 8) - 53)) - 1)) + { + u &= ~ (((UDItype) 1 << ((sizeof (DItype) * 8) - 53)) - 1); + u |= ((UDItype) 1 << ((sizeof (DItype) * 8) - 53)); + } + } + } + f = (USItype) (u >> (sizeof (SItype) * 8)); + f *= 2.0 * (((UDItype) 1) << ((sizeof (SItype) * 8) - 1)); + f += (USItype) (u & ((((UDItype) 1) << (sizeof (SItype) * 8)) - 1)); + + return (SFtype) f; +} + DItype __fixunstfdi (TFtype a) {