this repo has no description
1/*
2 * Adapted from original written by J.T. Conklin <jtc@netbsd.org>.
3 * Public domain.
4 *
5 * by Ian Ollmann, Apple Computer 2006
6 */
7
8.text
9.align 4
10.globl _fmodf
11_fmodf:
12#if defined __x86_64__
13 #define xf -4(%rsp)
14 #define yf -8(%rsp)
15 movss %xmm1, yf
16 movss %xmm0, xf
17#elif defined __i386__
18 #define xf 4(%esp)
19 #define yf 8(%esp)
20#else
21 #error "This implementation supports only 32- and 64-bit intel."
22#endif
23 flds yf
24 flds xf
251: fprem
26 fnstsw %ax
27 btw $10, %ax
28 jc 1b
29 fstp %st(1)
30#if defined __x86_64__
31 fstps xf
32 movss xf, %xmm0
33#endif
34 ret
35
36.text
37.align 4
38.globl _fmod
39_fmod:
40#if defined __x86_64__
41 #define x -8(%rsp)
42 #define y -16(%rsp)
43 movsd %xmm1, y
44 movsd %xmm0, x
45#elif defined __i386__
46 #define x 4(%esp)
47 #define y 12(%esp)
48#else
49 #error "This implementation supports only 32- and 64-bit intel."
50#endif
51 fldl y
52 fldl x
531: fprem
54 fnstsw %ax
55 btw $10, %ax
56 jc 1b
57 fstp %st(1)
58#if defined __x86_64__
59 fstpl x
60 movsd x, %xmm0
61#endif
62 ret
63
64.text
65.align 4
66.globl _fmodl
67_fmodl:
68#if defined __x86_64__
69 #define xl 8(%rsp)
70 #define yl 24(%rsp)
71#elif defined __i386__
72 #define xl 4(%esp)
73 #define yl 20(%esp)
74#else
75 #error "This implementation supports only 32- and 64-bit intel."
76#endif
77 fldt yl
78 fldt xl
791: fprem
80 fstsw %ax
81 btw $10,%ax
82 jc 1b
83 fstp %st(1)
84 ret
85