Search
lxdream.org :: lxdream/src/sh4/x86op.h :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/x86op.h
changeset 547:d6e00ffc4adc
prev539:75f3e594d4a7
next559:06714bc64271
next586:2a3ba82cf243
author nkeynes
date Thu Dec 06 10:37:55 2007 +0000 (12 years ago)
permissions -rw-r--r--
last change Fix stack alignment on x86-64
file annotate diff log raw
1.1 --- a/src/sh4/x86op.h Wed Nov 21 11:40:15 2007 +0000
1.2 +++ b/src/sh4/x86op.h Thu Dec 06 10:37:55 2007 +0000
1.3 @@ -56,12 +56,16 @@
1.4 #if SH4_TRANSLATOR == TARGET_X86_64
1.5 #define OPPTR(x) OP64((uint64_t)(x))
1.6 #define STACK_ALIGN 16
1.7 -#define POP_r32(r1) OP(0x58 + r1); sh4_x86.stack_posn -= 8;
1.8 -#define PUSH_r32(r1) OP(0x50 + r1); sh4_x86.stack_posn += 8;
1.9 -#define PUSH_imm32(imm) OP(0x68); OP32(imm); sh4_x86.stack_posn += 4;
1.10 -#define PUSH_imm64(imm) REXW(); OP(0x68); OP64(imm); sh4_x86.stack_posn += 8;
1.11 +#define POP_r32(r1) OP(0x58 + r1);
1.12 +#define POP_realigned_r32(r1) OP(0x58 + r1); REXW(); ADD_imm8s_r32(8,R_ESP)
1.13 +#define PUSH_r32(r1) OP(0x50 + r1);
1.14 +#define PUSH_realigned_r32(r1) REXW(); SUB_imm8s_r32(8, R_ESP); OP(0x50 + r1)
1.15 +#define PUSH_imm32(imm) OP(0x68); OP32(imm);
1.16 +#define PUSH_imm64(imm) REXW(); OP(0x68); OP64(imm);
1.17 #else
1.18 #define OPPTR(x) OP32((uint32_t)(x))
1.19 +#define POP_realigned_r32(r1) POP_r32(r1)
1.20 +#define PUSH_realigned_r32(r1) PUSH_r32(r1)
1.21 #ifdef APPLE_BUILD
1.22 #define STACK_ALIGN 16
1.23 #define POP_r32(r1) OP(0x58 + r1); sh4_x86.stack_posn -= 4;
.