| 1 | /** |
| 2 | * This file has no copyright assigned and is placed in the Public Domain. |
| 3 | * This file is part of the mingw-w64 runtime package. |
| 4 | * No warranty is given; refer to the file DISCLAIMER.PD within this package. |
| 5 | */ |
| 6 | #include <_mingw_mac.h> |
| 7 | |
| 8 | 	.file	"remquol.S" |
| 9 | .text |
| 10 | #ifdef __x86_64__ |
| 11 | 	.align 8 |
| 12 | #else |
| 13 | 	.align 4 |
| 14 | #endif |
| 15 | .globl __MINGW_USYMBOL(remquol) |
| 16 | __MINGW_USYMBOL(remquol): |
| 17 | #ifdef __x86_64__ |
| 18 | 	pushq	%rcx |
| 19 | fldt (%r8) |
| 20 | fldt (%rdx) |
| 21 | 1:	fprem1 |
| 22 | fstsw %ax |
| 23 | sahf |
| 24 | jp 1b |
| 25 | fstp %st(1) |
| 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 | movl $0xef2a60, %eax |
| 33 | 	leal (%ecx,%ecx,2),%ecx |
| 34 | shrl %cl, %eax |
| 35 | andl $7, %eax |
| 36 | movl 8(%rdx), %edx |
| 37 | xorl 8(%r8), %edx |
| 38 | testl $0x8000, %edx |
| 39 | jz 1f |
| 40 | negl %eax |
| 41 | 1:	movl %eax, (%r9) |
| 42 | |
| 43 | 	popq %rcx |
| 44 | 	movq %rcx,%rax |
| 45 | 	movq	$0,8(%rcx) |
| 46 | 	fstpt	(%rcx) |
| 47 | ret |
| 48 | #else |
| 49 | fldt 4 +12(%esp) |
| 50 | fldt 4(%esp) |
| 51 | 1:	fprem1 |
| 52 | fstsw %ax |
| 53 | sahf |
| 54 | jp 1b |
| 55 | fstp %st(1) |
| 56 | movl %eax, %ecx |
| 57 | shrl $8, %eax |
| 58 | shrl $12, %ecx |
| 59 | andl $4, %ecx |
| 60 | andl $3, %eax |
| 61 | orl %eax, %ecx |
| 62 | movl $0xef2a60, %eax |
| 63 | 	leal (%ecx,%ecx,2),%ecx |
| 64 | shrl %cl, %eax |
| 65 | andl $7, %eax |
| 66 | movl 4 +12 +12(%esp), %ecx |
| 67 | movl 4 +8(%esp), %edx |
| 68 | xorl 4 +12 +8(%esp), %edx |
| 69 | testl $0x8000, %edx |
| 70 | jz 1f |
| 71 | negl %eax |
| 72 | 1:	movl %eax, (%ecx) |
| 73 | |
| 74 | ret |
| 75 | #endif |