1/*
2 * Public domain.
3 */
4
5#include <machine/asm.h>
6#include <libm-alias-double.h>
7
8#define PARMS 4 /* no space for saved regs */
9#define DVDND PARMS
10#define DVSOR DVDND+8
11#define QUOP DVSOR+8
12
13 .text
14ENTRY (__remquo)
15
16 fldl DVSOR(%esp)
17 fldl DVDND(%esp)
181: 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
401: movl %eax, (%ecx)
41
42 ret
43END (__remquo)
44libm_alias_double (__remquo, remquo)
45

source code of glibc/sysdeps/i386/fpu/s_remquo.S