Use libm_alias_ldouble in sysdeps/i386/fpu.
[glibc.git] / sysdeps / i386 / fpu / s_remquol.S
blobf02cc1046548cbe4e66c5c2ecb5bcf02dede8c4e
1 /*
2  * Written by Ulrich Drepper <drepper@cygnus.com>.
3  * Based on e_remainder by J.T. Conklin <jtc@netbsd.org>.
4  * Public domain.
5  */
7 #include <libm-alias-ldouble.h>
8 #include <machine/asm.h>
10 #define PARMS   4               /* no space for saved regs */
11 #define DVDND   PARMS
12 #define DVSOR   DVDND+12
13 #define QUOP    DVSOR+12
15         .text
16 ENTRY (__remquol)
18         fldt    DVSOR(%esp)
19         fldt    DVDND(%esp)
20 1:      fprem1
21         fstsw   %ax
22         sahf
23         jp      1b
24         fstp    %st(1)
25         /* Compute the congruent of the quotient.  */
26         movl    %eax, %ecx
27         shrl    $8, %eax
28         shrl    $12, %ecx
29         andl    $4, %ecx
30         andl    $3, %eax
31         orl     %eax, %ecx
32         leal    (%ecx,%ecx,2),%ecx
33         movl    $0xef2a60, %eax
34         shrl    %cl, %eax
35         andl    $7, %eax
36         movl    QUOP(%esp), %ecx
37         movl    DVDND+8(%esp), %edx
38         xorl    DVSOR+8(%esp), %edx
39         testl   $0x8000, %edx
40         jz      1f
41         negl    %eax
42 1:      movl    %eax, (%ecx)
44         ret
45 END (__remquol)
46 libm_alias_ldouble (__remquo, remquo)