2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
6 #include "mathtrans_intern.h"
8 /*****************************************************************************
12 AROS_LH1(float, SPFieee
,
15 AROS_LHA(float, ieeenum
, D0
),
18 struct Library
*, MathTransBase
, 18, MathTrans
)
21 Convert single precision ieee number to FFP number
26 Motorola fast floating point number
30 negative : result is negative
31 overflow : exponent of the ieee-number was out of range for
38 *****************************************************************************/
44 /* check for ieeenum == 0 */
47 SetSR(Zero_Bit
, Zero_Bit
| Negative_Bit
| Overflow_Bit
);
51 /* calculate the exponent */
52 Res
= (ieeenum
& IEEESPExponent_Mask
) >> 23;
53 Res
= Res
- 126 + 0x40;
55 /* exponent too big / small */
58 SetSR(Overflow_Bit
, Zero_Bit
| Negative_Bit
| Overflow_Bit
);
62 Res
|= (ieeenum
<< 8) | 0x80000000;
64 /* check ieeenum-number for a sign */
68 SetSR(Negative_Bit
, Zero_Bit
| Negative_Bit
| Overflow_Bit
);