2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
6 #include "mathieeedoubtrans_intern.h"
10 Convert IEEE double to IEEE single precision number
13 IEEE single precision number
17 negative : result is negative
18 overflow : value was out of range for IEEE single precision
33 AROS_LHQUAD1(LONG
, IEEEDPTieee
,
34 AROS_LHAQUAD(double, y
, D0
, D1
),
35 struct MathIeeeDoubTransBase
*, MathIeeeDoubTransBase
, 17, MathIeeeDoubTrans
42 SetSR(0, Zero_Bit
| Overflow_Bit
| Negative_Bit
);
44 if (is_eqC(y
, 0x0, 0x0))
46 SetSR(Zero_Bit
, Zero_Bit
| Overflow_Bit
| Negative_Bit
);
52 /* calculate the exponent */
54 Res
= Res
+ 0x7e - 0x3fe;
57 Res
|= (tmp
& IEEESPMantisse_Mask
);
59 if (is_lessSC(y
, 0x0, 0x0))
61 SetSR(Negative_Bit
, Zero_Bit
| Overflow_Bit
| Negative_Bit
);
62 Res
|= IEEESPSign_Mask
;