malloc: add multi-threaded tests for aligned_alloc/calloc/malloc
[glibc.git] / sysdeps / i386 / fpu / s_remquo.S
blob6e82de880a27ca3bb7ddf1c67ccf378b727e879e
1 /*
2  * Public domain.
3  */
5 #include <machine/asm.h>
6 #include <libm-alias-double.h>
8 #define PARMS   4               /* no space for saved regs */
9 #define DVDND   PARMS
10 #define DVSOR   DVDND+8
11 #define QUOP    DVSOR+8
13         .text
14 ENTRY (__remquo)
16         fldl    DVSOR(%esp)
17         fldl    DVDND(%esp)
18 1:      fprem1
19         fstsw   %ax
20         sahf
21         jp      1b
22         fstp    %st(1)
23         /* Compute the congruent of the quotient.  */
24         movl    %eax, %ecx
25         shrl    $8, %eax
26         shrl    $12, %ecx
27         andl    $4, %ecx
28         andl    $3, %eax
29         orl     %eax, %ecx
30         leal    (%ecx,%ecx,2),%ecx
31         movl    $0xef2a60, %eax
32         shrl    %cl, %eax
33         andl    $7, %eax
34         movl    QUOP(%esp), %ecx
35         movl    DVDND+4(%esp), %edx
36         xorl    DVSOR+4(%esp), %edx
37         testl   $0x80000000, %edx
38         jz      1f
39         negl    %eax
40 1:      movl    %eax, (%ecx)
42         ret
43 END (__remquo)
44 libm_alias_double (__remquo, remquo)