diff --git a/vm/cpu-x86.32.S b/vm/cpu-x86.32.S index cc55532768..2e85be0f81 100644 --- a/vm/cpu-x86.32.S +++ b/vm/cpu-x86.32.S @@ -7,7 +7,8 @@ #define DS_REG %esi #define RETURN_REG %eax -#define NV_TEMP_REG %ebx +#define NV0 %ebx +#define NV1 %ebp #define ARITH_TEMP_1 %ebp #define ARITH_TEMP_2 %ebx @@ -82,7 +83,7 @@ DEF(void,set_x87_env,(const void*)): ret DEF(F_FASTCALL void,throw_impl,(CELL quot, F_STACK_FRAME *rewind_to, void *vm)): - mov ARG2,NV_TEMP_REG /* remember vm ptr in case quot_xt = lazy_jit_compile */ + mov ARG2,NV0 /* remember vm ptr in case quot_xt = lazy_jit_compile */ /* clear x87 stack, but preserve rounding mode and exception flags */ sub $2,STACK_REG fnstcw (STACK_REG) @@ -90,7 +91,7 @@ DEF(F_FASTCALL void,throw_impl,(CELL quot, F_STACK_FRAME *rewind_to, void *vm)): fldcw (STACK_REG) /* rewind_to */ mov ARG1,STACK_REG - mov NV_TEMP_REG,ARG1 + mov NV0,ARG1 jmp *QUOT_XT_OFFSET(ARG0) DEF(F_FASTCALL void,lazy_jit_compile,(CELL quot, void *vm)): diff --git a/vm/cpu-x86.64.S b/vm/cpu-x86.64.S index 90d274e711..5e307f0500 100644 --- a/vm/cpu-x86.64.S +++ b/vm/cpu-x86.64.S @@ -7,7 +7,8 @@ #define CELL_SIZE 8 #define STACK_PADDING 56 -#define NV_TEMP_REG %rbp +#define NV0 %rbp +#define NV1 %r12 #define ARITH_TEMP_1 %r8 #define ARITH_TEMP_2 %r9 diff --git a/vm/cpu-x86.S b/vm/cpu-x86.S index e9116f8f65..c497a0aad2 100644 --- a/vm/cpu-x86.S +++ b/vm/cpu-x86.S @@ -41,7 +41,8 @@ multiply_overflow: DEF(F_FASTCALL void,c_to_factor,(CELL quot, void *vm)): PUSH_NONVOLATILE - mov ARG0,NV_TEMP_REG + mov ARG0,NV0 + mov ARG1,NV1 /* Create register shadow area for Win64 */ sub $32,STACK_REG @@ -51,7 +52,8 @@ DEF(F_FASTCALL void,c_to_factor,(CELL quot, void *vm)): call MANGLE(save_callstack_bottom) /* Call quot-xt */ - mov NV_TEMP_REG,ARG0 + mov NV0,ARG0 + mov NV1,ARG1 call *QUOT_XT_OFFSET(ARG0) /* Tear down register shadow area */