Merge remote branch 'nsz/master'
[musl] / src / math / i386 / modff.s
1 .global modff
2 .type modff,@function
3 modff:
4         mov 8(%esp),%ecx
5         flds 4(%esp)
6         fxam
7         fnstsw %ax
8         sahf
9         jnp 1f
10         jc 2f
11 1:      fld1
12         fld %st(1)
13 1:      fprem
14         fnstsw %ax
15         sahf
16         jp 1b
17         fstp %st(1)
18         fsubr %st(0),%st(1)
19         fxch %st(1)
20         fstps (%ecx)
21         ret
22
23 2:      fstps (%ecx)
24         mov (%ecx),%eax
25         and $0x80000000,%eax
26         mov %eax,4(%esp)
27         flds 4(%esp)
28         ret