drc: split disassembly to separate pass

allows easier analysis
This commit is contained in:
notaz 2013-07-20 20:33:44 +03:00
parent 8cc76b4886
commit bf092a3631
6 changed files with 1001 additions and 338 deletions

File diff suppressed because it is too large Load diff

View file

@ -7,11 +7,12 @@ void sh2_drc_wcheck_da(unsigned int a, int val, int cpuid);
#define BLOCK_INSN_LIMIT 128
#define OP_FLAGS(pc) op_flags[((pc) - (base_pc)) / 2]
/* op_flags */
#define OF_DELAY_OP (1 << 0)
#define OF_BTARGET (1 << 1)
#define OF_T_SET (1 << 2) // T is known to be set
#define OF_T_CLEAR (1 << 3) // ... clear
void scan_block(unsigned int base_pc, int is_slave,
unsigned char *op_flags, unsigned int *end_pc);
unsigned char *op_flags, unsigned int *end_pc,
unsigned int *end_literals);

View file

@ -88,12 +88,14 @@ int sh2_execute(SH2 *sh2, int cycles)
{
#ifdef DRC_CMP
if (!sh2->delay) {
if (sh2->pc < base_pc || sh2->pc > end_pc) {
if (sh2->pc < base_pc || sh2->pc >= end_pc) {
base_pc = sh2->pc;
scan_block(base_pc, sh2->is_slave,
op_flags, &end_pc);
op_flags, &end_pc, NULL);
}
if ((OP_FLAGS(sh2->pc) & OF_BTARGET) || sh2->pc == base_pc) {
if ((op_flags[(sh2->pc - base_pc) / 2]
& OF_BTARGET) || sh2->pc == base_pc)
{
if (sh2->icount < 0)
break;
}