Search
lxdream.org :: lxdream/src/sh4/ia64abi.h :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/ia64abi.h
changeset 927:17b6b9e245d8
prev926:68f3e0fe02f1
next930:07e5b11419db
next953:f4a156508ad1
author nkeynes
date Mon Dec 15 10:44:56 2008 +0000 (11 years ago)
permissions -rw-r--r--
last change Add return-address-modifying exception return code to mmu TLB lookups (a little bit faster)
file annotate diff log raw
1.1 --- a/src/sh4/ia64abi.h Sun Dec 14 07:50:48 2008 +0000
1.2 +++ b/src/sh4/ia64abi.h Mon Dec 15 10:44:56 2008 +0000
1.3 @@ -43,6 +43,13 @@
1.4 call_func0(ptr);
1.5 }
1.6
1.7 +static inline void call_func1_exc( void *ptr, int arg1, int pc )
1.8 +{
1.9 + REXW(); MOV_r32_r32(arg1, R_EDI);
1.10 + load_exc_backpatch(R_ESI);
1.11 + call_func0(ptr);
1.12 +}
1.13 +
1.14 #define CALL_FUNC2_SIZE 16
1.15 static inline void call_func2( void *ptr, int arg1, int arg2 )
1.16 {
1.17 @@ -230,16 +237,17 @@
1.18
1.19 for( i=0; i< sh4_x86.backpatch_posn; i++ ) {
1.20 uint32_t *fixup_addr = (uint32_t *)&xlat_current_block->code[sh4_x86.backpatch_list[i].fixup_offset];
1.21 - *fixup_addr = xlat_output - (uint8_t *)&xlat_current_block->code[sh4_x86.backpatch_list[i].fixup_offset] - 4;
1.22 if( sh4_x86.backpatch_list[i].exc_code < 0 ) {
1.23 + if( sh4_x86.backpatch_list[i].exc_code == -2 ) {
1.24 + *((uintptr_t *)fixup_addr) = (uintptr_t)xlat_output;
1.25 + } else {
1.26 + *fixup_addr = xlat_output - (uint8_t *)&xlat_current_block->code[sh4_x86.backpatch_list[i].fixup_offset] - 4;
1.27 + }
1.28 load_imm32( R_EDX, sh4_x86.backpatch_list[i].fixup_icount );
1.29 - int stack_adj = -1 - sh4_x86.backpatch_list[i].exc_code;
1.30 - if( stack_adj > 0 ) {
1.31 - REXW(); ADD_imm8s_r32( stack_adj*4, R_ESP );
1.32 - }
1.33 int rel = preexc_ptr - xlat_output;
1.34 JMP_rel(rel);
1.35 } else {
1.36 + *fixup_addr = xlat_output - (uint8_t *)&xlat_current_block->code[sh4_x86.backpatch_list[i].fixup_offset] - 4;
1.37 load_imm32( R_EDI, sh4_x86.backpatch_list[i].exc_code );
1.38 load_imm32( R_EDX, sh4_x86.backpatch_list[i].fixup_icount );
1.39 int rel = end_ptr - xlat_output;
.