Search
lxdream.org :: lxdream/src/sh4/ia64abi.h :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/ia64abi.h
changeset 930:07e5b11419db
prev927:17b6b9e245d8
next939:6f2302afeb89
author nkeynes
date Sat Dec 27 02:18:17 2008 +0000 (15 years ago)
branchlxdream-mem
permissions -rw-r--r--
last change Simplify xlat_lut slightly (cache now always initialized even if we're not
translating, just for efficiency)
file annotate diff log raw
1.1 --- a/src/sh4/ia64abi.h Mon Dec 15 10:44:56 2008 +0000
1.2 +++ b/src/sh4/ia64abi.h Sat Dec 27 02:18:17 2008 +0000
1.3 @@ -24,6 +24,14 @@
1.4
1.5 #define load_ptr( reg, ptr ) load_imm64( reg, (uint64_t)ptr );
1.6
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], %rcx
1.13 +}
1.14 +
1.15 /**
1.16 * Note: clobbers EAX to make the indirect call - this isn't usually
1.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.21
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 16
1.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.34
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 35
1.44 /**
1.45 * Write a double (64-bit) value into memory, with the first word in arg2a, and
.