summaryrefslogtreecommitdiff
path: root/gcc/config/fp-bit.c
diff options
context:
space:
mode:
authorStephane Carrez <Stephane.Carrez@worldnet.fr>2000-09-08 22:16:40 +0200
committerStephane Carrez <ciceron@gcc.gnu.org>2000-09-08 22:16:40 +0200
commitdfaf3cdbc47cb897ddb1ade88e8d9f77bc9608a3 (patch)
tree1dc567b8266ce8479953260b70b01007f3e1f8f3 /gcc/config/fp-bit.c
parentf246ff2351ae53fa7ee78f29320225db84127f58 (diff)
downloadgcc-dfaf3cdbc47cb897ddb1ade88e8d9f77bc9608a3.tar.gz
Unsigned -> float conversion for fp-bit.c
From-SVN: r36274
Diffstat (limited to 'gcc/config/fp-bit.c')
-rw-r--r--gcc/config/fp-bit.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/gcc/config/fp-bit.c b/gcc/config/fp-bit.c
index 70a3f254ccd..5f88518982f 100644
--- a/gcc/config/fp-bit.c
+++ b/gcc/config/fp-bit.c
@@ -1169,6 +1169,38 @@ si_to_float (SItype arg_a)
}
#endif /* L_si_to_sf || L_si_to_df */
+#if defined(L_usi_to_sf) || defined(L_usi_to_df)
+FLO_type
+usi_to_float (USItype arg_a)
+{
+ fp_number_type in;
+
+ in.sign = 0;
+ if (!arg_a)
+ {
+ in.class = CLASS_ZERO;
+ }
+ else
+ {
+ in.class = CLASS_NUMBER;
+ in.normal_exp = FRACBITS + NGARDS;
+ in.fraction.ll = arg_a;
+
+ while (in.fraction.ll > (1LL << (FRACBITS + NGARDS)))
+ {
+ in.fraction.ll >>= 1;
+ in.normal_exp += 1;
+ }
+ while (in.fraction.ll < (1LL << (FRACBITS + NGARDS)))
+ {
+ in.fraction.ll <<= 1;
+ in.normal_exp -= 1;
+ }
+ }
+ return pack_d (&in);
+}
+#endif
+
#if defined(L_sf_to_si) || defined(L_df_to_si)
SItype
float_to_si (FLO_type arg_a)