Added missing properties.
[tangerine.git] / arch / m68k-mac / libgcc1 / _extend.s
blob591d67450fec496e5f14797b7bfea46f83e2815e
1 | single float 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 BIAS4 = 0x7F-1
17 BIAS8 = 0x3FF-1
19 .text
20 .even
21 .globl __extendsfdf2
23 __extendsfdf2:
24 lea %sp@(4),%a0 | parameter pointer
25 moveml %d2-%d7,%sp@- | save regs to keep norm_df happy
26 movel %a0@,%d4 | get number
27 clrl %d5 | prepare double mantissa
29 movew %a0@,%d0 | extract exponent
30 movew %d0,%d2 | extract sign
31 lsrw #7,%d0
32 andw #0xff,%d0 | kill sign bit (exponent is 8 bits)
34 andl #0x7fffff,%d4 | remove exponent from mantissa
35 tstw %d0 | check for zero exponent - no leading "1"
36 beq L_0 | for denormalized numbers
37 orl #0x800000,%d4 | restore implied leading "1"
38 bra L_1
39 L_0: addw #1,%d0 | "normalize" exponent
40 L_1:
41 addw #BIAS8-BIAS4-3,%d0 | adjust bias, account for shift
42 clrw %d1 | dummy rounding info
44 jmp norm_df