summaryrefslogtreecommitdiff
path: root/x86_64/README
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2014-06-01 22:46:34 +0200
committerNiels Möller <nisse@lysator.liu.se>2014-06-01 22:46:34 +0200
commitedf2b37fa461dc1b5919ce53f1c56cd0a449425e (patch)
tree5600f12f3e55d0ad8e203c634bc9ca7280fd1261 /x86_64/README
parent1851417eb69ca20c87167301aa20bf828fbdd316 (diff)
downloadnettle-edf2b37fa461dc1b5919ce53f1c56cd0a449425e.tar.gz
Fixes for w64 ABI.
Diffstat (limited to 'x86_64/README')
-rw-r--r--x86_64/README13
1 files changed, 10 insertions, 3 deletions
diff --git a/x86_64/README b/x86_64/README
index ae693be5..d04e5dfc 100644
--- a/x86_64/README
+++ b/x86_64/README
@@ -4,6 +4,8 @@ Up to 6 integer and pointer arguments are passed in registers. Nine
registers, %rax, %rcx, %rdx, %rsi, %rdi and %r8-%r11 can be used
freely. Integers and pointers are returned in %rax.
+At entry, it is required that %rsp == 8 (mod 16).
+
Registers May be Argument
clobbered number
@@ -51,14 +53,19 @@ Additional arguments are passed on the stack. "backing store" on the
stack for the four register arguments is also required. %xmm6 to
%xmm15 are callee-saved. The "long" type is just 32 bits.
-If we have five arguments, and push the additional callee-save
+If we have six arguments, and push the additional callee-save
registers %rdi and %rsi on the stack, we get a stack frame like
+64(%rsp): Sixth argument
56(%rsp): Fifth argument
48(%rsp): Space for fourth argument
40(%rsp): Space for third argument
32(%rsp): Space for second argument
24(%rsp): Space for first argument
16(%rsp): Return address
-8(%rsp): Saved %rsi
-(%rsp) : Saved %rdi
+8(%rsp) : Saved %rdi
+(%rsp): Saved %rsi
+
+If, in addition, we use more than 6 %xmm registers, we push them
+*after* %rdi (but before %rsi), so that they are stored at 16-byte
+aligned addresses.