32x: drc: some constant propagation

git-svn-id: file:///home/notaz/opt/svn/PicoDrive@860 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
notaz 2010-01-15 21:04:42 +00:00
parent 5aec752dac
commit 2368651527
5 changed files with 532 additions and 200 deletions

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,6 @@
int sh2_drc_init(SH2 *sh2); int sh2_drc_init(SH2 *sh2);
void sh2_drc_finish(SH2 *sh2); void sh2_drc_finish(SH2 *sh2);
void sh2_drc_mem_setup(SH2 *sh2);
void sh2_drc_flush_all(void); void sh2_drc_flush_all(void);
void sh2_drc_wcheck_ram(unsigned int a, int val, int cpuid); void sh2_drc_wcheck_ram(unsigned int a, int val, int cpuid);
void sh2_drc_wcheck_da(unsigned int a, int val, int cpuid); void sh2_drc_wcheck_da(unsigned int a, int val, int cpuid);

View file

@ -490,7 +490,8 @@ static UINT32 op1000(char *buffer, UINT32 pc, UINT16 opcode)
static UINT32 op1001(char *buffer, UINT32 pc, UINT16 opcode) static UINT32 op1001(char *buffer, UINT32 pc, UINT16 opcode)
{ {
sprintf(buffer, "MOV.W @($%04X,PC),%s", (opcode & 0xff) * 2, regname[Rn]); sprintf(buffer, "MOV.W @($%02X,PC),%s ; @$%08x", (opcode & 0xff) * 2, regname[Rn],
pc + (opcode & 0xff) * 2 + 2);
return 0; return 0;
} }
@ -566,8 +567,8 @@ static UINT32 op1100(char *buffer, UINT32 pc, UINT16 opcode)
static UINT32 op1101(char *buffer, UINT32 pc, UINT16 opcode) static UINT32 op1101(char *buffer, UINT32 pc, UINT16 opcode)
{ {
sprintf(buffer, "MOV.L @($%02X,PC),%s ; #$%06x", (opcode * 4) & 0x3ff, regname[Rn], sprintf(buffer, "MOV.L @($%02X,PC),%s ; @$%08x", (opcode & 0xff) * 4, regname[Rn],
(pc + ((opcode * 4) & 0x3ff) + 2) & ~3); (pc + (opcode & 0xff) * 4 + 2) & ~3);
return 0; return 0;
} }

View file

@ -33,6 +33,10 @@ typedef struct SH2_
// drc stuff // drc stuff
int drc_tmp; // 70 int drc_tmp; // 70
int irq_cycles; int irq_cycles;
void *p_bios; // convenience pointers
void *p_da;
void *p_sdram;
void *p_rom;
// interpreter stuff // interpreter stuff
int icount; // cycles left in current timeslice int icount; // cycles left in current timeslice

View file

@ -1521,8 +1521,8 @@ void PicoMemSetup32x(void)
msh2.read8_map = ssh2.read8_map = sh2_read8_map; msh2.read8_map = ssh2.read8_map = sh2_read8_map;
msh2.read16_map = ssh2.read16_map = sh2_read16_map; msh2.read16_map = ssh2.read16_map = sh2_read16_map;
msh2.write8_tab = ssh2.write8_tab = (const void **)sh2_write8_map; msh2.write8_tab = ssh2.write8_tab = (const void **)(void *)sh2_write8_map;
msh2.write16_tab = ssh2.write16_tab = (const void **)sh2_write16_map; msh2.write16_tab = ssh2.write16_tab = (const void **)(void *)sh2_write16_map;
// setup poll detector // setup poll detector
m68k_poll.flag = P32XF_68KPOLL; m68k_poll.flag = P32XF_68KPOLL;
@ -1531,6 +1531,11 @@ void PicoMemSetup32x(void)
sh2_poll[0].cyc_max = 21; sh2_poll[0].cyc_max = 21;
sh2_poll[1].flag = P32XF_SSH2POLL; sh2_poll[1].flag = P32XF_SSH2POLL;
sh2_poll[1].cyc_max = 16; sh2_poll[1].cyc_max = 16;
#ifdef DRC_SH2
sh2_drc_mem_setup(&msh2);
sh2_drc_mem_setup(&ssh2);
#endif
} }
// vim:shiftwidth=2:expandtab // vim:shiftwidth=2:expandtab