mirror of
https://git.planet-casio.com/Lephenixnoir/OpenLibm.git
synced 2025-01-01 06:23:39 +01:00
fix calling convention on win64, mostly passing the numerical tests
This commit is contained in:
parent
bb082aca5d
commit
0cd232d8cf
16 changed files with 107 additions and 18 deletions
|
@ -9,13 +9,23 @@
|
||||||
//__FBSDID("$FreeBSD: src/lib/msun/amd64/e_remainderl.S,v 1.2 2011/01/07 16:13:12 kib Exp $")
|
//__FBSDID("$FreeBSD: src/lib/msun/amd64/e_remainderl.S,v 1.2 2011/01/07 16:13:12 kib Exp $")
|
||||||
|
|
||||||
ENTRY(remainderl)
|
ENTRY(remainderl)
|
||||||
|
#ifndef _WIN64
|
||||||
fldt 24(%rsp)
|
fldt 24(%rsp)
|
||||||
fldt 8(%rsp)
|
fldt 8(%rsp)
|
||||||
|
#else
|
||||||
|
fldt (%r8)
|
||||||
|
fldt (%rdx)
|
||||||
|
#endif
|
||||||
1: fprem1
|
1: fprem1
|
||||||
fstsw %ax
|
fstsw %ax
|
||||||
testw $0x400,%ax
|
testw $0x400,%ax
|
||||||
jne 1b
|
jne 1b
|
||||||
fstp %st(1)
|
fstp %st(1)
|
||||||
|
#ifdef _WIN64
|
||||||
|
mov %rcx,%rax
|
||||||
|
movq $0x0,0x8(%rcx)
|
||||||
|
fstpt (%rcx)
|
||||||
|
#endif
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -28,8 +28,15 @@
|
||||||
//__FBSDID("$FreeBSD: src/lib/msun/amd64/e_sqrtl.S,v 1.2 2011/01/07 16:13:12 kib Exp $")
|
//__FBSDID("$FreeBSD: src/lib/msun/amd64/e_sqrtl.S,v 1.2 2011/01/07 16:13:12 kib Exp $")
|
||||||
|
|
||||||
ENTRY(sqrtl)
|
ENTRY(sqrtl)
|
||||||
|
#ifndef _WIN64
|
||||||
fldt 8(%rsp)
|
fldt 8(%rsp)
|
||||||
fsqrt
|
fsqrt
|
||||||
|
#else
|
||||||
|
fldt (%rdx)
|
||||||
|
fsqrt
|
||||||
|
mov %rcx,%rax
|
||||||
|
movq $0x0,0x8(%rcx)
|
||||||
|
fstpt (%rcx)
|
||||||
|
#endif
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#include <amd64/bsd_asm.h>
|
#include <amd64/bsd_asm.h>
|
||||||
//__FBSDID("$FreeBSD: src/lib/msun/amd64/s_llrint.S,v 1.3 2011/02/04 21:54:06 kib Exp $")
|
//__FBSDID("$FreeBSD: src/lib/msun/amd64/s_llrint.S,v 1.3 2011/02/04 21:54:06 kib Exp $")
|
||||||
|
|
||||||
/* sizeof(long) == sizeof(long long) */
|
ENTRY(llrint)
|
||||||
#define fn llrint
|
cvtsd2si %xmm0, %rax
|
||||||
#include "s_lrint.S"
|
ret
|
||||||
|
END(llrint)
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#include <amd64/bsd_asm.h>
|
#include <amd64/bsd_asm.h>
|
||||||
//__FBSDID("$FreeBSD: src/lib/msun/amd64/s_llrintf.S,v 1.3 2011/02/04 21:54:06 kib Exp $")
|
//__FBSDID("$FreeBSD: src/lib/msun/amd64/s_llrintf.S,v 1.3 2011/02/04 21:54:06 kib Exp $")
|
||||||
|
|
||||||
/* sizeof(long) == sizeof(long long) */
|
ENTRY(llrintf)
|
||||||
#define fn llrintf
|
cvtss2si %xmm0, %rax
|
||||||
#include "s_lrintf.S"
|
ret
|
||||||
|
END(llrintf)
|
||||||
|
|
||||||
|
|
|
@ -28,10 +28,14 @@
|
||||||
//__FBSDID("$FreeBSD: src/lib/msun/amd64/s_llrintl.S,v 1.2 2011/01/07 16:13:12 kib Exp $");
|
//__FBSDID("$FreeBSD: src/lib/msun/amd64/s_llrintl.S,v 1.2 2011/01/07 16:13:12 kib Exp $");
|
||||||
|
|
||||||
ENTRY(llrintl)
|
ENTRY(llrintl)
|
||||||
|
#ifndef _WIN64
|
||||||
fldt 8(%rsp)
|
fldt 8(%rsp)
|
||||||
|
#else
|
||||||
|
fldt (%rcx)
|
||||||
|
#endif
|
||||||
subq $8,%rsp
|
subq $8,%rsp
|
||||||
fistpll (%rsp)
|
fistpll (%rsp)
|
||||||
popq %rax
|
popq %rax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -8,9 +8,18 @@
|
||||||
//__FBSDID("$FreeBSD: src/lib/msun/amd64/s_logbl.S,v 1.4 2011/01/07 16:13:12 kib Exp $")
|
//__FBSDID("$FreeBSD: src/lib/msun/amd64/s_logbl.S,v 1.4 2011/01/07 16:13:12 kib Exp $")
|
||||||
|
|
||||||
ENTRY(logbl)
|
ENTRY(logbl)
|
||||||
|
#ifndef _WIN64
|
||||||
fldt 8(%rsp)
|
fldt 8(%rsp)
|
||||||
|
#else
|
||||||
|
fldt (%rdx)
|
||||||
|
#endif
|
||||||
fxtract
|
fxtract
|
||||||
fstp %st
|
fstp %st
|
||||||
|
#ifdef _WIN64
|
||||||
|
mov %rcx,%rax
|
||||||
|
movq $0x0,0x8(%rcx)
|
||||||
|
fstpt (%rcx)
|
||||||
|
#endif
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -26,14 +26,15 @@
|
||||||
|
|
||||||
#include <amd64/bsd_asm.h>
|
#include <amd64/bsd_asm.h>
|
||||||
|
|
||||||
#ifndef fn
|
|
||||||
//__FBSDID("$FreeBSD: src/lib/msun/amd64/s_lrint.S,v 1.3 2011/01/07 16:13:12 kib Exp $")
|
//__FBSDID("$FreeBSD: src/lib/msun/amd64/s_lrint.S,v 1.3 2011/01/07 16:13:12 kib Exp $")
|
||||||
#define fn lrint
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ENTRY(fn)
|
ENTRY(lrint)
|
||||||
|
#ifndef _WIN64
|
||||||
cvtsd2si %xmm0, %rax
|
cvtsd2si %xmm0, %rax
|
||||||
|
#else
|
||||||
|
cvtsd2si %xmm0, %eax
|
||||||
|
#endif
|
||||||
ret
|
ret
|
||||||
END(fn)
|
END(lrint)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -26,14 +26,15 @@
|
||||||
|
|
||||||
#include <amd64/bsd_asm.h>
|
#include <amd64/bsd_asm.h>
|
||||||
|
|
||||||
#ifndef fn
|
|
||||||
//__FBSDID("$FreeBSD: src/lib/msun/amd64/s_lrintf.S,v 1.3 2011/01/07 16:13:12 kib Exp $")
|
//__FBSDID("$FreeBSD: src/lib/msun/amd64/s_lrintf.S,v 1.3 2011/01/07 16:13:12 kib Exp $")
|
||||||
#define fn lrintf
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ENTRY(fn)
|
ENTRY(lrintf)
|
||||||
|
#ifndef _WIN64
|
||||||
cvtss2si %xmm0, %rax
|
cvtss2si %xmm0, %rax
|
||||||
|
#else
|
||||||
|
cvtss2si %xmm0, %eax
|
||||||
|
#endif
|
||||||
ret
|
ret
|
||||||
END(fn)
|
END(lrintf)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,11 @@
|
||||||
//__FBSDID("$FreeBSD: src/lib/msun/amd64/s_lrintl.S,v 1.2 2011/01/07 16:13:12 kib Exp $");
|
//__FBSDID("$FreeBSD: src/lib/msun/amd64/s_lrintl.S,v 1.2 2011/01/07 16:13:12 kib Exp $");
|
||||||
|
|
||||||
ENTRY(lrintl)
|
ENTRY(lrintl)
|
||||||
|
#ifndef _WIN64
|
||||||
fldt 8(%rsp)
|
fldt 8(%rsp)
|
||||||
|
#else
|
||||||
|
fldt (%rcx)
|
||||||
|
#endif
|
||||||
subq $8,%rsp
|
subq $8,%rsp
|
||||||
fistpll (%rsp)
|
fistpll (%rsp)
|
||||||
popq %rax
|
popq %rax
|
||||||
|
|
|
@ -59,7 +59,11 @@ ENTRY(remquo)
|
||||||
andl $1,%ecx
|
andl $1,%ecx
|
||||||
addl %ecx,%eax
|
addl %ecx,%eax
|
||||||
/* Store the quotient and return. */
|
/* Store the quotient and return. */
|
||||||
|
#ifndef _WIN64
|
||||||
movl %eax,(%rdi)
|
movl %eax,(%rdi)
|
||||||
|
#else
|
||||||
|
movl %eax,(%r8)
|
||||||
|
#endif
|
||||||
fstpl -8(%rsp)
|
fstpl -8(%rsp)
|
||||||
movsd -8(%rsp),%xmm0
|
movsd -8(%rsp),%xmm0
|
||||||
ret
|
ret
|
||||||
|
|
|
@ -59,7 +59,11 @@ ENTRY(remquof)
|
||||||
andl $1,%ecx
|
andl $1,%ecx
|
||||||
addl %ecx,%eax
|
addl %ecx,%eax
|
||||||
/* Store the quotient and return. */
|
/* Store the quotient and return. */
|
||||||
|
#ifndef _WIN64
|
||||||
movl %eax,(%rdi)
|
movl %eax,(%rdi)
|
||||||
|
#else
|
||||||
|
movl %eax,(%r8)
|
||||||
|
#endif
|
||||||
fstps -4(%rsp)
|
fstps -4(%rsp)
|
||||||
movss -4(%rsp),%xmm0
|
movss -4(%rsp),%xmm0
|
||||||
ret
|
ret
|
||||||
|
|
|
@ -32,8 +32,14 @@
|
||||||
//__FBSDID("$FreeBSD: src/lib/msun/amd64/s_remquol.S,v 1.2 2011/01/07 16:13:12 kib Exp $");
|
//__FBSDID("$FreeBSD: src/lib/msun/amd64/s_remquol.S,v 1.2 2011/01/07 16:13:12 kib Exp $");
|
||||||
|
|
||||||
ENTRY(remquol)
|
ENTRY(remquol)
|
||||||
|
#ifndef _WIN64
|
||||||
fldt 24(%rsp)
|
fldt 24(%rsp)
|
||||||
fldt 8(%rsp)
|
fldt 8(%rsp)
|
||||||
|
#else
|
||||||
|
fldt (%r8)
|
||||||
|
fldt (%rdx)
|
||||||
|
mov %rcx,%r8
|
||||||
|
#endif
|
||||||
1: fprem1
|
1: fprem1
|
||||||
fstsw %ax
|
fstsw %ax
|
||||||
btw $10,%ax
|
btw $10,%ax
|
||||||
|
@ -58,7 +64,14 @@ ENTRY(remquol)
|
||||||
andl $1,%ecx
|
andl $1,%ecx
|
||||||
addl %ecx,%eax
|
addl %ecx,%eax
|
||||||
/* Store the quotient and return. */
|
/* Store the quotient and return. */
|
||||||
|
#ifndef _WIN64
|
||||||
movl %eax,(%rdi)
|
movl %eax,(%rdi)
|
||||||
|
#else
|
||||||
|
movl %eax,(%r9)
|
||||||
|
mov %r8,%rax
|
||||||
|
movq $0x0,0x8(%r8)
|
||||||
|
fstpt (%r8)
|
||||||
|
#endif
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,16 @@
|
||||||
#include <amd64/bsd_asm.h>
|
#include <amd64/bsd_asm.h>
|
||||||
|
|
||||||
ENTRY(rintl)
|
ENTRY(rintl)
|
||||||
|
#ifndef _WIN64
|
||||||
fldt 8(%rsp)
|
fldt 8(%rsp)
|
||||||
frndint
|
frndint
|
||||||
|
#else
|
||||||
|
fldt (%rdx)
|
||||||
|
frndint
|
||||||
|
mov %rcx,%rax
|
||||||
|
movq $0x0,0x8(%rcx)
|
||||||
|
fstpt (%rcx)
|
||||||
|
#endif
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,11 @@
|
||||||
|
|
||||||
ENTRY(scalbn)
|
ENTRY(scalbn)
|
||||||
movsd %xmm0,-8(%rsp)
|
movsd %xmm0,-8(%rsp)
|
||||||
|
#ifndef _WIN64
|
||||||
movl %edi,-12(%rsp)
|
movl %edi,-12(%rsp)
|
||||||
|
#else
|
||||||
|
movl %edx,-12(%rsp)
|
||||||
|
#endif
|
||||||
fildl -12(%rsp)
|
fildl -12(%rsp)
|
||||||
fldl -8(%rsp)
|
fldl -8(%rsp)
|
||||||
fscale
|
fscale
|
||||||
|
|
|
@ -29,7 +29,11 @@
|
||||||
|
|
||||||
ENTRY(scalbnf)
|
ENTRY(scalbnf)
|
||||||
movss %xmm0,-8(%rsp)
|
movss %xmm0,-8(%rsp)
|
||||||
|
#ifndef _WIN64
|
||||||
movl %edi,-4(%rsp)
|
movl %edi,-4(%rsp)
|
||||||
|
#else
|
||||||
|
movl %edx,-4(%rsp)
|
||||||
|
#endif
|
||||||
fildl -4(%rsp)
|
fildl -4(%rsp)
|
||||||
flds -8(%rsp)
|
flds -8(%rsp)
|
||||||
fscale
|
fscale
|
||||||
|
|
|
@ -8,11 +8,23 @@
|
||||||
/* //RCSID("$NetBSD: s_scalbnf.S,v 1.4 1999/01/02 05:15:40 kristerw Exp $") */
|
/* //RCSID("$NetBSD: s_scalbnf.S,v 1.4 1999/01/02 05:15:40 kristerw Exp $") */
|
||||||
|
|
||||||
ENTRY(scalbnl)
|
ENTRY(scalbnl)
|
||||||
|
#ifndef _WIN64
|
||||||
movl %edi,-4(%rsp)
|
movl %edi,-4(%rsp)
|
||||||
fildl -4(%rsp)
|
fildl -4(%rsp)
|
||||||
fldt 8(%rsp)
|
fldt 8(%rsp)
|
||||||
|
#else
|
||||||
|
mov %r8,%rax
|
||||||
|
movl %eax,-4(%rsp)
|
||||||
|
fildl -4(%rsp)
|
||||||
|
fldt (%rdx)
|
||||||
|
#endif
|
||||||
fscale
|
fscale
|
||||||
fstp %st(1)
|
fstp %st(1)
|
||||||
|
#ifdef _WIN64
|
||||||
|
mov %rcx,%rax
|
||||||
|
movq $0x0,0x8(%rcx)
|
||||||
|
fstpt (%rcx)
|
||||||
|
#endif
|
||||||
ret
|
ret
|
||||||
END(scalbnl)
|
END(scalbnl)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue