Search
lxdream.org :: lxdream/src/sh4/ia32mac.h :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/ia32mac.h
changeset 590:4db6a084ca3c
prev586:2a3ba82cf243
next596:dfc0c93d882e
author nkeynes
date Wed Jan 16 09:39:16 2008 +0000 (13 years ago)
permissions -rw-r--r--
last change Ensure PC correctness in presence of delay-slot exceptions
file annotate diff log raw
1.1 --- a/src/sh4/ia32mac.h Tue Jan 15 20:50:23 2008 +0000
1.2 +++ b/src/sh4/ia32mac.h Wed Jan 16 09:39:16 2008 +0000
1.3 @@ -138,14 +138,13 @@
1.4 }
1.5
1.6 /**
1.7 - * Exit the block with sh4r.pc already written
1.8 - * Bytes: 15
1.9 + * Exit the block with sh4r.new_pc written with the target pc
1.10 */
1.11 void exit_block_pcset( sh4addr_t pc )
1.12 {
1.13 load_imm32( R_ECX, ((pc - sh4_x86.block_start_pc)>>1)*sh4_cpu_period ); // 5
1.14 ADD_r32_sh4r( R_ECX, REG_OFFSET(slice_cycle) ); // 6
1.15 - load_spreg( R_EAX, REG_OFFSET(pc) );
1.16 + load_spreg( R_EAX, R_PC );
1.17 if( sh4_x86.tlb_on ) {
1.18 call_func1(xlat_get_code_by_vma,R_EAX);
1.19 } else {
1.20 @@ -155,6 +154,25 @@
1.21 RET();
1.22 }
1.23
1.24 +/**
1.25 + * Exit the block with sh4r.new_pc written with the target pc
1.26 + */
1.27 +void exit_block_newpcset( sh4addr_t pc )
1.28 +{
1.29 + load_imm32( R_ECX, ((pc - sh4_x86.block_start_pc)>>1)*sh4_cpu_period ); // 5
1.30 + ADD_r32_sh4r( R_ECX, REG_OFFSET(slice_cycle) ); // 6
1.31 + load_spreg( R_EAX, R_NEW_PC );
1.32 + store_spreg( R_EAX, R_PC );
1.33 + if( sh4_x86.tlb_on ) {
1.34 + call_func1(xlat_get_code_by_vma,R_EAX);
1.35 + } else {
1.36 + call_func1(xlat_get_code,R_EAX);
1.37 + }
1.38 + POP_r32(R_EBP);
1.39 + RET();
1.40 +}
1.41 +
1.42 +
1.43 #define EXIT_BLOCK_SIZE(pc) (24 + (IS_IN_ICACHE(pc)?5:CALL_FUNC1_SIZE))
1.44
1.45
.