summaryrefslogtreecommitdiff
path: root/src/common/x64/abi.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/x64/abi.h')
-rw-r--r--src/common/x64/abi.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/common/x64/abi.h b/src/common/x64/abi.h
index de6d62fdd..eaaf81d89 100644
--- a/src/common/x64/abi.h
+++ b/src/common/x64/abi.h
@@ -12,7 +12,8 @@
12 12
13// Windows 64-bit 13// Windows 64-bit
14// * 4-reg "fastcall" variant, very new-skool stack handling 14// * 4-reg "fastcall" variant, very new-skool stack handling
15// * Callee moves stack pointer, to make room for shadow regs for the biggest function _it itself calls_ 15// * Callee moves stack pointer, to make room for shadow regs for the biggest function _it itself
16// calls_
16// * Parameters passed in RCX, RDX, ... further parameters are MOVed into the allocated stack space. 17// * Parameters passed in RCX, RDX, ... further parameters are MOVed into the allocated stack space.
17// Scratch: RAX RCX RDX R8 R9 R10 R11 18// Scratch: RAX RCX RDX R8 R9 R10 R11
18// Callee-save: RBX RSI RDI RBP R12 R13 R14 R15 19// Callee-save: RBX RSI RDI RBP R12 R13 R14 R15
@@ -35,10 +36,10 @@
35#define ABI_PARAM4 R9 36#define ABI_PARAM4 R9
36 37
37// xmm0-xmm15 use the upper 16 bits in the functions that push/pop registers. 38// xmm0-xmm15 use the upper 16 bits in the functions that push/pop registers.
38#define ABI_ALL_CALLER_SAVED \ 39#define ABI_ALL_CALLER_SAVED \
39 (BitSet32 { RAX, RCX, RDX, R8, R9, R10, R11, \ 40 (BitSet32{RAX, RCX, RDX, R8, R9, R10, R11, XMM0 + 16, XMM1 + 16, XMM2 + 16, XMM3 + 16, \
40 XMM0+16, XMM1+16, XMM2+16, XMM3+16, XMM4+16, XMM5+16 }) 41 XMM4 + 16, XMM5 + 16})
41#else //64-bit Unix / OS X 42#else // 64-bit Unix / OS X
42 43
43#define ABI_PARAM1 RDI 44#define ABI_PARAM1 RDI
44#define ABI_PARAM2 RSI 45#define ABI_PARAM2 RSI
@@ -49,9 +50,7 @@
49 50
50// TODO: Avoid pushing all 16 XMM registers when possible. Most functions we call probably 51// TODO: Avoid pushing all 16 XMM registers when possible. Most functions we call probably
51// don't actually clobber them. 52// don't actually clobber them.
52#define ABI_ALL_CALLER_SAVED \ 53#define ABI_ALL_CALLER_SAVED (BitSet32{RAX, RCX, RDX, RDI, RSI, R8, R9, R10, R11} | ABI_ALL_FPRS)
53 (BitSet32 { RAX, RCX, RDX, RDI, RSI, R8, R9, R10, R11 } | \
54 ABI_ALL_FPRS)
55#endif // WIN32 54#endif // WIN32
56 55
57#define ABI_ALL_CALLEE_SAVED (~ABI_ALL_CALLER_SAVED) 56#define ABI_ALL_CALLEE_SAVED (~ABI_ALL_CALLER_SAVED)