blob: c24689aac41ee189e86c67c9292d1d8a8a18f123 [file] [log] [blame]
Daniel Dunbarb3a69012009-06-26 16:47:03 +00001// This file is distributed under the University of Illinois Open Source
2// License. See LICENSE.TXT for details.
3
4// long double __floatundixf(du_int a);16
5
6#ifdef __i386__
7
8.const
9.align 4
10twop52: .quad 0x4330000000000000
11twop84_plus_twop52_neg:
12 .quad 0xc530000000100000
13twop84: .quad 0x4530000000000000
14
15#define REL_ADDR(_a) (_a)-0b(%eax)
16
17.text
18.align 4
19.globl ___floatundixf
20___floatundixf:
21 calll 0f
220: popl %eax
23 movss 8(%esp), %xmm0 // hi 32 bits of input
24 movss 4(%esp), %xmm1 // lo 32 bits of input
25 orpd REL_ADDR(twop84), %xmm0 // 2^84 + hi (as a double)
26 orpd REL_ADDR(twop52), %xmm1 // 2^52 + lo (as a double)
27 addsd REL_ADDR(twop84_plus_twop52_neg), %xmm0 // hi - 2^52 (no rounding occurs)
28 movsd %xmm1, 4(%esp)
29 fldl 4(%esp)
30 movsd %xmm0, 4(%esp)
31 faddl 4(%esp)
32 ret
33
34#endif // __i386__