Fix -Wundef warnings in login/tst-utmp.c.
[glibc.git] / sysdeps / i386 / fpu / s_remquof.S
blob62063f068f59220a2f774b1be7be5b613644b34c
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 <machine/asm.h>
9 #define PARMS   4               /* no space for saved regs */
10 #define DVDND   PARMS
11 #define DVSOR   DVDND+4
12 #define QUOP    DVSOR+4
14         .text
15 ENTRY (__remquof)
17         flds    DVSOR(%esp)
18         flds    DVDND(%esp)
19 1:      fprem1
20         fstsw   %ax
21         sahf
22         jp      1b
23         fstp    %st(1)
24         /* Compute the congruent of the quotient.  */
25         movl    %eax, %ecx
26         shrl    $8, %eax
27         shrl    $12, %ecx
28         andl    $4, %ecx
29         andl    $3, %eax
30         orl     %eax, %ecx
31         leal    (%ecx,%ecx,2),%ecx
32         movl    $0xef2a60, %eax
33         shrl    %cl, %eax
34         andl    $7, %eax
35         movl    QUOP(%esp), %ecx
36         movl    DVDND(%esp), %edx
37         xorl    DVSOR(%esp), %edx
38         testl   $0x80000000, %edx
39         jz      1f
40         negl    %eax
41 1:      movl    %eax, (%ecx)
43         ret
44 END (__remquof)
45 weak_alias (__remquof, remquof)