filename | src/sh4/ia64abi.h |
changeset | 930:07e5b11419db |
prev | 927:17b6b9e245d8 |
next | 939:6f2302afeb89 |
author | nkeynes |
date | Fri Dec 26 14:25:23 2008 +0000 (15 years ago) |
branch | lxdream-mem |
permissions | -rw-r--r-- |
last change | Change RAM regions to use static arrays rather than mmap regions, for a 2-3% performance gain. General mem cleanups, including some save state fixes that break states again. |
file | annotate | diff | log | raw |
1.1 --- a/src/sh4/ia64abi.h Mon Dec 15 10:44:56 2008 +00001.2 +++ b/src/sh4/ia64abi.h Fri Dec 26 14:25:23 2008 +00001.3 @@ -24,6 +24,14 @@1.5 #define load_ptr( reg, ptr ) load_imm64( reg, (uint64_t)ptr );1.7 +static inline decode_address( int addr_reg )1.8 +{1.9 + MOV_r32_r32( addr_reg, R_ECX );1.10 + SHR_imm8_r32( 12, R_ECX );1.11 + load_ptr( R_EDI, sh4_address_space );1.12 + REXW(); OP(0x8B); OP(0x0C); OP(0xCF); // mov.q [%rdi + %rcx*8], %rcx1.13 +}1.14 +1.15 /**1.16 * Note: clobbers EAX to make the indirect call - this isn't usually1.17 * a problem since the callee will usually clobber it anyway.1.18 @@ -50,6 +58,12 @@1.19 call_func0(ptr);1.20 }1.22 +static inline void call_func1_r32disp8( int preg, uint32_t disp8, int arg1 )1.23 +{1.24 + REXW(); MOV_r32_r32(arg1, R_EDI);1.25 + CALL_r32disp8(preg, disp8);1.26 +}1.27 +1.28 #define CALL_FUNC2_SIZE 161.29 static inline void call_func2( void *ptr, int arg1, int arg2 )1.30 {1.31 @@ -58,6 +72,14 @@1.32 call_func0(ptr);1.33 }1.35 +static inline void call_func2_r32disp8( int preg, uint32_t disp8, int arg1, int arg2 )1.36 +{1.37 + REXW(); MOV_r32_r32(arg1, R_EDI);1.38 + REXW(); MOV_r32_r32(arg2, R_ESI);1.39 + CALL_r32disp8(preg, disp8);1.40 +}1.41 +1.42 +1.43 #define MEM_WRITE_DOUBLE_SIZE 351.44 /**1.45 * Write a double (64-bit) value into memory, with the first word in arg2a, and
.