Search
lxdream.org :: lxdream/src/sh4/sh4x86.in :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/sh4x86.in
changeset 526:ba3da45b5754
prev502:c4ecae2b1b5e
next527:14c9489f647e
author nkeynes
date Sat Nov 17 06:04:19 2007 +0000 (12 years ago)
permissions -rw-r--r--
last change Don't build the translator if the architecture is unsupported. Also tidy things up a little to allow (theoretically) different translators to be selected at build time.
file annotate diff log raw
1.1 --- a/src/sh4/sh4x86.in Thu Nov 08 11:54:16 2007 +0000
1.2 +++ b/src/sh4/sh4x86.in Sat Nov 17 06:04:19 2007 +0000
1.3 @@ -522,7 +522,7 @@
1.4 * @return true if the instruction marks the end of a basic block
1.5 * (eg a branch or
1.6 */
1.7 -uint32_t sh4_x86_translate_instruction( sh4addr_t pc )
1.8 +uint32_t sh4_translate_instruction( sh4addr_t pc )
1.9 {
1.10 uint32_t ir;
1.11 /* Read instruction */
1.12 @@ -1478,11 +1478,11 @@
1.13 sh4_x86.tstate = TSTATE_E;
1.14 }
1.15 OP(0x0F); OP(0x80+sh4_x86.tstate); uint32_t *patch = (uint32_t *)xlat_output; OP32(0); // JNE rel32
1.16 - sh4_x86_translate_instruction(pc+2);
1.17 + sh4_translate_instruction(pc+2);
1.18 exit_block( disp + pc + 4, pc+4 );
1.19 // not taken
1.20 *patch = (xlat_output - ((uint8_t *)patch)) - 4;
1.21 - sh4_x86_translate_instruction(pc+2);
1.22 + sh4_translate_instruction(pc+2);
1.23 return 4;
1.24 }
1.25 :}
1.26 @@ -1491,7 +1491,7 @@
1.27 SLOTILLEGAL();
1.28 } else {
1.29 sh4_x86.in_delay_slot = TRUE;
1.30 - sh4_x86_translate_instruction( pc + 2 );
1.31 + sh4_translate_instruction( pc + 2 );
1.32 exit_block( disp + pc + 4, pc+4 );
1.33 sh4_x86.branch_taken = TRUE;
1.34 return 4;
1.35 @@ -1506,7 +1506,7 @@
1.36 store_spreg( R_EAX, REG_OFFSET(pc) );
1.37 sh4_x86.in_delay_slot = TRUE;
1.38 sh4_x86.tstate = TSTATE_NONE;
1.39 - sh4_x86_translate_instruction( pc + 2 );
1.40 + sh4_translate_instruction( pc + 2 );
1.41 exit_block_pcset(pc+2);
1.42 sh4_x86.branch_taken = TRUE;
1.43 return 4;
1.44 @@ -1519,7 +1519,7 @@
1.45 load_imm32( R_EAX, pc + 4 );
1.46 store_spreg( R_EAX, R_PR );
1.47 sh4_x86.in_delay_slot = TRUE;
1.48 - sh4_x86_translate_instruction( pc + 2 );
1.49 + sh4_translate_instruction( pc + 2 );
1.50 exit_block( disp + pc + 4, pc+4 );
1.51 sh4_x86.branch_taken = TRUE;
1.52 return 4;
1.53 @@ -1535,7 +1535,7 @@
1.54 store_spreg( R_ECX, REG_OFFSET(pc) );
1.55 sh4_x86.in_delay_slot = TRUE;
1.56 sh4_x86.tstate = TSTATE_NONE;
1.57 - sh4_x86_translate_instruction( pc + 2 );
1.58 + sh4_translate_instruction( pc + 2 );
1.59 exit_block_pcset(pc+2);
1.60 sh4_x86.branch_taken = TRUE;
1.61 return 4;
1.62 @@ -1561,11 +1561,11 @@
1.63 sh4_x86.tstate = TSTATE_E;
1.64 }
1.65 OP(0x0F); OP(0x80+(sh4_x86.tstate^1)); uint32_t *patch = (uint32_t *)xlat_output; OP32(0); // JE rel32
1.66 - sh4_x86_translate_instruction(pc+2);
1.67 + sh4_translate_instruction(pc+2);
1.68 exit_block( disp + pc + 4, pc+4 );
1.69 // not taken
1.70 *patch = (xlat_output - ((uint8_t *)patch)) - 4;
1.71 - sh4_x86_translate_instruction(pc+2);
1.72 + sh4_translate_instruction(pc+2);
1.73 return 4;
1.74 }
1.75 :}
1.76 @@ -1576,7 +1576,7 @@
1.77 load_reg( R_ECX, Rn );
1.78 store_spreg( R_ECX, REG_OFFSET(pc) );
1.79 sh4_x86.in_delay_slot = TRUE;
1.80 - sh4_x86_translate_instruction(pc+2);
1.81 + sh4_translate_instruction(pc+2);
1.82 exit_block_pcset(pc+2);
1.83 sh4_x86.branch_taken = TRUE;
1.84 return 4;
1.85 @@ -1591,7 +1591,7 @@
1.86 load_reg( R_ECX, Rn );
1.87 store_spreg( R_ECX, REG_OFFSET(pc) );
1.88 sh4_x86.in_delay_slot = TRUE;
1.89 - sh4_x86_translate_instruction(pc+2);
1.90 + sh4_translate_instruction(pc+2);
1.91 exit_block_pcset(pc+2);
1.92 sh4_x86.branch_taken = TRUE;
1.93 return 4;
1.94 @@ -1610,7 +1610,7 @@
1.95 sh4_x86.priv_checked = FALSE;
1.96 sh4_x86.fpuen_checked = FALSE;
1.97 sh4_x86.tstate = TSTATE_NONE;
1.98 - sh4_x86_translate_instruction(pc+2);
1.99 + sh4_translate_instruction(pc+2);
1.100 exit_block_pcset(pc+2);
1.101 sh4_x86.branch_taken = TRUE;
1.102 return 4;
1.103 @@ -1623,7 +1623,7 @@
1.104 load_spreg( R_ECX, R_PR );
1.105 store_spreg( R_ECX, REG_OFFSET(pc) );
1.106 sh4_x86.in_delay_slot = TRUE;
1.107 - sh4_x86_translate_instruction(pc+2);
1.108 + sh4_translate_instruction(pc+2);
1.109 exit_block_pcset(pc+2);
1.110 sh4_x86.branch_taken = TRUE;
1.111 return 4;
.