diff options
author | Torbjorn Granlund <tege@gmplib.org> | 2011-12-01 19:41:05 +0100 |
---|---|---|
committer | Torbjorn Granlund <tege@gmplib.org> | 2011-12-01 19:41:05 +0100 |
commit | fccb9163716f134759ab68908c264d2e8cf4e098 (patch) | |
tree | cb17a0921e7463b9ca74fd8f5eb2b3b7458f95f6 /mpn/x86_64/core2 | |
parent | e20f6dd1c4a6810e911a715862f2b01f12b8a525 (diff) | |
download | gmp-fccb9163716f134759ab68908c264d2e8cf4e098.tar.gz |
Add DOS64 ABI support.
Diffstat (limited to 'mpn/x86_64/core2')
-rw-r--r-- | mpn/x86_64/core2/divrem_1.asm | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/mpn/x86_64/core2/divrem_1.asm b/mpn/x86_64/core2/divrem_1.asm index 05822fdda..8058b2fb0 100644 --- a/mpn/x86_64/core2/divrem_1.asm +++ b/mpn/x86_64/core2/divrem_1.asm @@ -57,10 +57,19 @@ define(`un', `%rbx') C rax rbx rcx rdx rsi rdi rbp r8 r9 r10 r11 r12 r13 r14 r15 C cnt qp d dinv +ABI_SUPPORT(DOS64) +ABI_SUPPORT(STD64) + +IFSTD(`define(`CNTOFF', `40($1)')') +IFDOS(`define(`CNTOFF', `104($1)')') + ASM_START() TEXT ALIGN(16) PROLOGUE(mpn_preinv_divrem_1) + DOS64_ENTRY(4) +IFDOS(` mov 56(%rsp), %r8 ') +IFDOS(` mov 64(%rsp), %r9 ') xor R32(%rax), R32(%rax) push %r13 push %r12 @@ -74,13 +83,15 @@ PROLOGUE(mpn_preinv_divrem_1) lea -8(qp,un_param,8), qp - mov 40(%rsp), R8(cnt) + mov CNTOFF(%rsp), R8(cnt) shl R8(cnt), d jmp L(ent) EPILOGUE() ALIGN(16) PROLOGUE(mpn_divrem_1) + DOS64_ENTRY(4) +IFDOS(` mov 56(%rsp), %r8 ') xor R32(%rax), R32(%rax) push %r13 push %r12 @@ -114,14 +125,15 @@ L(44): sal R8(%rcx), %rbp push %rcx - push %rdi - push %rsi +IFSTD(` push %rdi ') +IFSTD(` push %rsi ') push %r8 - mov d, %rdi +IFSTD(` mov d, %rdi ') +IFDOS(` mov d, %rcx ') CALL( mpn_invert_limb) pop %r8 - pop %rsi - pop %rdi +IFSTD(` pop %rsi ') +IFSTD(` pop %rdi ') pop %rcx mov %rax, dinv @@ -210,5 +222,6 @@ L(ret): pop %rbx pop %rbp pop %r12 pop %r13 + DOS64_EXIT() ret EPILOGUE() |