diff options
author | Alan Modra <amodra@bigpond.net.au> | 2005-11-25 06:41:48 +0000 |
---|---|---|
committer | Alan Modra <amodra@gcc.gnu.org> | 2005-11-25 17:11:48 +1030 |
commit | 3f231c29370df4a5b2ff441d8df1c0b8f5e87804 (patch) | |
tree | 14c7545ac34aac70d3df0513d5028542b577efde | |
parent | 66f788b0b33ae14ca966f1925c9a3c3aff2144a1 (diff) | |
download | gcc-3f231c29370df4a5b2ff441d8df1c0b8f5e87804.zip gcc-3f231c29370df4a5b2ff441d8df1c0b8f5e87804.tar.gz gcc-3f231c29370df4a5b2ff441d8df1c0b8f5e87804.tar.bz2 |
ppc64-fp.c (__floatunditf): New function.
* config/rs6000/ppc64-fp.c (__floatunditf): New function.
(__floatundidf, __floatundisf): Likewise.
From-SVN: r107494
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/rs6000/ppc64-fp.c | 51 |
2 files changed, 56 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6b19608..4e4a94a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2005-11-25 Alan Modra <amodra@bigpond.net.au> + + * config/rs6000/ppc64-fp.c (__floatunditf): New function. + (__floatundidf, __floatundisf): Likewise. + 2005-11-25 David Edelsohn <edelsohn@gnu.org> * 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 cb8e585..6be3ca82 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) { |