25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: cpu_sh_instr.c,v 1.2 2005/09/04 02:49:11 debug Exp $ |
* $Id: cpu_sh_instr.c,v 1.3 2005/11/06 22:41:12 debug Exp $ |
29 |
* |
* |
30 |
* SH instructions. |
* SH instructions. |
31 |
* |
* |
67 |
|
|
68 |
|
|
69 |
/* |
/* |
|
* sh_combine_instructions(): |
|
|
* |
|
|
* Combine two or more instructions, if possible, into a single function call. |
|
|
*/ |
|
|
void COMBINE_INSTRUCTIONS(struct cpu *cpu, struct sh_instr_call *ic, |
|
|
uint32_t addr) |
|
|
{ |
|
|
int n_back; |
|
|
n_back = (addr >> SH_INSTR_ALIGNMENT_SHIFT) |
|
|
& (SH_IC_ENTRIES_PER_PAGE-1); |
|
|
|
|
|
if (n_back >= 1) { |
|
|
/* TODO */ |
|
|
} |
|
|
|
|
|
/* TODO: Combine forward as well */ |
|
|
} |
|
|
|
|
|
|
|
|
/*****************************************************************************/ |
|
|
|
|
|
|
|
|
/* |
|
70 |
* sh_instr_to_be_translated(): |
* sh_instr_to_be_translated(): |
71 |
* |
* |
72 |
* Translate an instruction word into an sh_instr_call. ic is filled in with |
* Translate an instruction word into an sh_instr_call. ic is filled in with |
76 |
*/ |
*/ |
77 |
X(to_be_translated) |
X(to_be_translated) |
78 |
{ |
{ |
79 |
uint64_t addr, low_pc, tmp_addr; |
uint64_t addr, low_pc; |
80 |
uint32_t iword; |
uint32_t iword; |
81 |
unsigned char *page; |
unsigned char *page; |
82 |
unsigned char ib[4]; |
unsigned char ib[4]; |
83 |
int main_opcode, instr_size = 4; |
int main_opcode, instr_size = 4; |
84 |
void (*samepage_function)(struct cpu *, struct sh_instr_call *); |
/* void (*samepage_function)(struct cpu *, struct sh_instr_call *);*/ |
85 |
|
|
86 |
/* Figure out the (virtual) address of the instruction: */ |
/* Figure out the (virtual) address of the instruction: */ |
87 |
if (cpu->cd.sh.compact) { |
if (cpu->cd.sh.compact) { |