x86_64 math asm, long double functions only
[musl] / src / math / x86_64 / modfl.s
1 .global modfl
2 .type modfl,@function
3 modfl:
4         fldt 8(%rsp)
5         fxam
6         fnstsw %ax
7         sahf
8         jnp 1f
9         jc 2f
10 1:      fld1
11         fld %st(1)
12 1:      fprem
13         fnstsw %ax
14         sahf
15         jp 1b
16         fstp %st(1)
17         fsubr %st(0),%st(1)
18         fxch %st(1)
19         fstpt (%rdi)
20         ret
21
22 2:      fstpt (%rdi)
23         mov 6(%rdi),%eax
24         and $0x80000000,%eax
25         mov %eax,8(%rsp)
26         flds 8(%rsp)
27         ret