Search
lxdream.org :: lxdream :: r800:0d1be79c9b33
lxdream 0.9.1
released Jun 29
Download Now
changeset800:0d1be79c9b33
parent799:8aeb9906d7b9
child801:92b518a2e915
authornkeynes
dateMon Aug 04 06:00:11 2008 +0000 (11 years ago)
Fix x86-64 bugs (only visible on OS X)
src/sh4/ia64abi.h
src/sh4/sh4x86.in
src/sh4/x86op.h
1.1 --- a/src/sh4/ia64abi.h Mon Aug 04 05:58:53 2008 +0000
1.2 +++ b/src/sh4/ia64abi.h Mon Aug 04 06:00:11 2008 +0000
1.3 @@ -39,15 +39,15 @@
1.4 #define CALL_FUNC1_SIZE 14
1.5 static inline void call_func1( void *ptr, int arg1 )
1.6 {
1.7 - MOV_r32_r32(arg1, R_EDI);
1.8 + REXW(); MOV_r32_r32(arg1, R_EDI);
1.9 call_func0(ptr);
1.10 }
1.11
1.12 #define CALL_FUNC2_SIZE 16
1.13 static inline void call_func2( void *ptr, int arg1, int arg2 )
1.14 {
1.15 - MOV_r32_r32(arg1, R_EDI);
1.16 - MOV_r32_r32(arg2, R_ESI);
1.17 + REXW(); MOV_r32_r32(arg1, R_EDI);
1.18 + REXW(); MOV_r32_r32(arg2, R_ESI);
1.19 call_func0(ptr);
1.20 }
1.21
2.1 --- a/src/sh4/sh4x86.in Mon Aug 04 05:58:53 2008 +0000
2.2 +++ b/src/sh4/sh4x86.in Mon Aug 04 06:00:11 2008 +0000
2.3 @@ -166,7 +166,7 @@
2.4 /**
2.5 * Load an immediate 64-bit quantity (note: x86-64 only)
2.6 */
2.7 -static inline void load_imm64( int x86reg, uint32_t value ) {
2.8 +static inline void load_imm64( int x86reg, uint64_t value ) {
2.9 /* mov #value, reg */
2.10 REXW();
2.11 OP(0xB8 + x86reg);
2.12 @@ -2288,7 +2288,7 @@
2.13 load_spreg( R_ECX, R_FPSCR );
2.14 TEST_imm32_r32( FPSCR_PR, R_ECX );
2.15 JNE_rel8(doubleprec );
2.16 - LEA_sh4r_r32( REG_OFFSET(fr[0][FRn&0x0E]), R_ECX );
2.17 + LEA_sh4r_rptr( REG_OFFSET(fr[0][FRn&0x0E]), R_ECX );
2.18 load_spreg( R_EDX, R_FPUL );
2.19 call_func2( sh4_fsca, R_EDX, R_ECX );
2.20 JMP_TARGET(doubleprec);
2.21 @@ -2326,7 +2326,7 @@
2.22 load_spreg( R_ECX, R_FPSCR );
2.23 TEST_imm32_r32( FPSCR_PR, R_ECX );
2.24 JNE_rel8( doubleprec );
2.25 - LEA_sh4r_r32( REG_OFFSET(fr[0][FVn<<2]), R_EDX );
2.26 + LEA_sh4r_rptr( REG_OFFSET(fr[0][FVn<<2]), R_EDX );
2.27 call_func1( sh4_ftrv, R_EDX ); // 12
2.28 JMP_TARGET(doubleprec);
2.29 sh4_x86.tstate = TSTATE_NONE;
3.1 --- a/src/sh4/x86op.h Mon Aug 04 05:58:53 2008 +0000
3.2 +++ b/src/sh4/x86op.h Mon Aug 04 06:00:11 2008 +0000
3.3 @@ -52,6 +52,7 @@
3.4 #if SIZEOF_VOID_P == 8
3.5 #define OPPTR(x) OP64((uint64_t)(x))
3.6 #define AND_imm8s_rptr(imm, r1) REXW(); AND_imm8s_r32( imm, r1 )
3.7 +#define LEA_sh4r_rptr(disp, r1) REXW(); LEA_sh4r_r32(disp,r1)
3.8 #define MOV_moffptr_EAX(offptr) REXW(); MOV_moff32_EAX( offptr )
3.9 #define STACK_ALIGN 16
3.10 #define POP_r32(r1) OP(0x58 + r1);
3.11 @@ -63,6 +64,7 @@
3.12 #else /* 32-bit system */
3.13 #define OPPTR(x) OP32((uint32_t)(x))
3.14 #define AND_imm8s_rptr(imm, r1) AND_imm8s_r32( imm, r1 )
3.15 +#define LEA_sh4r_rptr(disp, r1) LEA_sh4r_r32(disp,r1)
3.16 #define MOV_moffptr_EAX(offptr) MOV_moff32_EAX( offptr )
3.17 #define POP_realigned_r32(r1) POP_r32(r1)
3.18 #define PUSH_realigned_r32(r1) PUSH_r32(r1)
.