diff options
author | James R. McKaskill <jmckaskill@gmail.com> | 2011-07-15 04:32:24 +0400 |
---|---|---|
committer | James R. McKaskill <jmckaskill@gmail.com> | 2011-07-15 04:32:24 +0400 |
commit | 24b26c8e59fd7b8f0556b06d7748df70ba503af9 (patch) | |
tree | 353d9b20306403386999cacca44393234659a233 /call_x86.dasc | |
parent | b75e86b227f663d7546789ae9875ebea398641aa (diff) |
linux 64bit fixes
Diffstat (limited to 'call_x86.dasc')
-rw-r--r-- | call_x86.dasc | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/call_x86.dasc b/call_x86.dasc index 93690cc..cd6ab15 100644 --- a/call_x86.dasc +++ b/call_x86.dasc @@ -252,12 +252,13 @@ int x86_stack_required(lua_State* L, int usr) return ret;
}
-#if defined _WIN32 && defined _WIN64
-#define MAX_REGISTER_ARGS 4 /* rcx, rdx, r8, r9 */
-#elif defined __amd64__
-#define MAX_REGISTER_ARGS 14 /* rdi, rsi, rdx, rcx, r8, r9, xmm0-7 */
-#else
-#define MAX_REGISTER_ARGS 0
+#ifdef _WIN64
+#define MAX_REGISTERS 4 /* rcx, rdx, r8, r9 */
+#endif
+
+#ifdef __amd64__
+#define MAX_INT_REGISTERS 6 /* rdi, rsi, rdx, rcx, r8, r9 */
+#define MAX_FLOAT_REGISTERS 8 /* xmm0-7 */
#endif
struct reg_alloc {
@@ -551,7 +552,7 @@ void push_function(jit_t* jit, lua_State* L, function_t func, int ct_usr, const | call_i, &SetLastError, eax
/* remove the stack space to call local functions */
- |.if WIN and not X64
+ |.if X32WIN
| add rsp, 28 // SetLastError will have already popped 4
|.else
| add rsp, 32
@@ -589,6 +590,7 @@ void push_function(jit_t* jit, lua_State* L, function_t func, int ct_usr, const | mov rcx, [rsp]
}
case 0:
+ break;
}
/* don't remove the space for the registers as we need 32 bytes of register overflow space */
@@ -614,6 +616,7 @@ void push_function(jit_t* jit, lua_State* L, function_t func, int ct_usr, const case 1:
| movq xmm0, qword [rsp + 8*(MAX_INT_REGISTERS)]
case 0:
+ break;
}
switch (regs.ints) {
@@ -630,6 +633,7 @@ void push_function(jit_t* jit, lua_State* L, function_t func, int ct_usr, const case 1:
| mov rdi, [rsp]
case 0:
+ break;
}
| add rsp, REGISTER_STACK_SPACE
|