NOTE => NOTES
[AROS.git] / arch / m68k-all / libgcc1 / _floatsidf.s
blob80966e103724a3a063555a41df44356c46bbbf80
1 | long integer to double float conversion routine
3 | written by Kai-Uwe Bloem (I5110401@dbstu1.bitnet).
4 | Based on a 80x86 floating point packet from comp.os.minix, written by P.Housel
7 | Revision 1.2, kub 01-90 :
8 | added support for denormalized numbers
10 | Revision 1.1, kub 12-89 :
11 | Ported over to 68k assembler
13 | Revision 1.0:
14 | original 8088 code from P.S.Housel
16 BIAS8 = 0x3FF-1
18 .text
19 .even
20 .globl __floatsidf
22 __floatsidf:
23 movel %sp@(4),%d0 | get the 4-byte integer
24 moveml %d2-%d7,%sp@- | save registers to make norm_df happy
26 movel %d0,%d4 | prepare result mantissa
27 clrl %d5
28 movew #BIAS8+32-11,%d0 | radix point after 32 bits
29 L_0:
30 movel %d4,%d2 | set sign flag
31 swap %d2
32 tstw %d2 | check sign of number
33 bge L_1 | nonnegative
34 negl %d4 | take absolute value
35 L_1:
36 clrw %d1 | set rounding = 0
37 jmp norm_df