From 0d813c1bdebc389b627aa73413b9cad09328b820 Mon Sep 17 00:00:00 2001 From: Frode Solheim Date: Sun, 6 Sep 2015 23:54:41 +0200 Subject: [PATCH] JIT: more 64-bit updates --- jit/codegen_x86.cpp | 8 +++++--- jit/compemu_support.cpp | 8 ++++---- jit/exception_handler.cpp | 8 ++++++-- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/jit/codegen_x86.cpp b/jit/codegen_x86.cpp index ae909300..c840982d 100644 --- a/jit/codegen_x86.cpp +++ b/jit/codegen_x86.cpp @@ -97,13 +97,13 @@ only target, and it's easier this way... */ #define STACK_ALIGN 16 #define STACK_OFFSET sizeof(void *) -uae_u8 always_used[]={4,0xff}; +uae_s8 always_used[]={4,-1}; #if defined(CPU_x86_64) uae_s8 can_byte[]={0,1,2,3,5,6,7,8,9,10,11,12,13,14,15,-1}; uae_s8 can_word[]={0,1,2,3,5,6,7,8,9,10,11,12,13,14,15,-1}; #else -uae_u8 can_byte[]={0,1,2,3,0xff}; -uae_u8 can_word[]={0,1,2,3,5,6,7,0xff}; +uae_s8 can_byte[]={0,1,2,3,-1}; +uae_s8 can_word[]={0,1,2,3,5,6,7,-1}; #endif #if USE_OPTIMIZED_CALLS @@ -155,8 +155,10 @@ static const uae_u8 need_to_preserve[]={1,1,1,1,0,1,1,1}; #define CLOBBER_TEST clobber_flags() #define CLOBBER_CL16 #define CLOBBER_CL8 +#define CLOBBER_SE32 #define CLOBBER_SE16 #define CLOBBER_SE8 +#define CLOBBER_ZE32 #define CLOBBER_ZE16 #define CLOBBER_ZE8 #define CLOBBER_SW16 clobber_flags() diff --git a/jit/compemu_support.cpp b/jit/compemu_support.cpp index 225d8093..1bde629f 100644 --- a/jit/compemu_support.cpp +++ b/jit/compemu_support.cpp @@ -98,7 +98,7 @@ #include "uae.h" #include "uae/log.h" #define jit_log(format, ...) \ - uae_log("JIT: " format "\n", __func__, ##__VA_ARGS__); + uae_log("JIT: " format "\n", ##__VA_ARGS__); #define jit_log2(format, ...) #define MEMBaseDiff uae_ptr32(NATMEM_OFFSET) @@ -2535,9 +2535,9 @@ bool compiler_use_jit(void) void init_comp(void) { int i; - uae_u8* cb=can_byte; - uae_u8* cw=can_word; - uae_u8* au=always_used; + uae_s8* cb=can_byte; + uae_s8* cw=can_word; + uae_s8* au=always_used; #ifdef RECORD_REGISTER_USAGE for (i=0;i<16;i++) diff --git a/jit/exception_handler.cpp b/jit/exception_handler.cpp index 4b4eeb14..f5c11d95 100644 --- a/jit/exception_handler.cpp +++ b/jit/exception_handler.cpp @@ -47,8 +47,8 @@ typedef LPEXCEPTION_POINTERS CONTEXT_T; #define CONTEXT_CR2(context) ((uae_u32)(context->ExceptionRecord->ExceptionInformation[1])) #elif HAVE_STRUCT_UCONTEXT_UC_MCONTEXT_GREGS - #ifdef CPU_x86_64 + #define CONTEXT_RIP(context) (((struct ucontext *) context)->uc_mcontext.gregs[REG_RIP]) #define CONTEXT_RAX(context) (((struct ucontext *) context)->uc_mcontext.gregs[REG_RAX]) #define CONTEXT_RCX(context) (((struct ucontext *) context)->uc_mcontext.gregs[REG_RCX]) @@ -58,9 +58,12 @@ typedef LPEXCEPTION_POINTERS CONTEXT_T; #define CONTEXT_RBP(context) (((struct ucontext *) context)->uc_mcontext.gregs[REG_RBP]) #define CONTEXT_RSI(context) (((struct ucontext *) context)->uc_mcontext.gregs[REG_RSI]) #define CONTEXT_RDI(context) (((struct ucontext *) context)->uc_mcontext.gregs[REG_RDI]) + #else + typedef void *CONTEXT_T; #define HAVE_CONTEXT_T 1 + #define CONTEXT_EIP(context) (((struct ucontext *) context)->uc_mcontext.gregs[REG_EIP]) #define CONTEXT_EAX(context) (((struct ucontext *) context)->uc_mcontext.gregs[REG_EAX]) #define CONTEXT_ECX(context) (((struct ucontext *) context)->uc_mcontext.gregs[REG_ECX]) @@ -70,9 +73,10 @@ typedef void *CONTEXT_T; #define CONTEXT_EBP(context) (((struct ucontext *) context)->uc_mcontext.gregs[REG_EBP]) #define CONTEXT_ESI(context) (((struct ucontext *) context)->uc_mcontext.gregs[REG_ESI]) #define CONTEXT_EDI(context) (((struct ucontext *) context)->uc_mcontext.gregs[REG_EDI]) + #define CONTEXT_CR2(context) (((struct ucontext *) context)->uc_mcontext.cr2) -#endif +#endif #endif #if defined(CPU_64_BIT) -- 2.47.3