summaryrefslogtreecommitdiff
path: root/gcc/config/fp-bit.c
diff options
context:
space:
mode:
authorciceron <ciceron@138bc75d-0d04-0410-961f-82ee72b054a4>2000-09-08 20:16:40 +0000
committerciceron <ciceron@138bc75d-0d04-0410-961f-82ee72b054a4>2000-09-08 20:16:40 +0000
commit320f29dca62454d7a739c9bfe2b2cec47c8bf7a2 (patch)
tree1dc567b8266ce8479953260b70b01007f3e1f8f3 /gcc/config/fp-bit.c
parent5e4d941a26367ed038fbe88a0a8a12d21dc99542 (diff)
downloadgcc-320f29dca62454d7a739c9bfe2b2cec47c8bf7a2.tar.gz
Unsigned -> float conversion for fp-bit.c
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@36274 138bc75d-0d04-0410-961f-82ee72b054a4
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)