emit_movimm(value,HOST_TEMPREG);
}
emit_storereg(i_regmap[hr],HOST_TEMPREG);
+#ifndef FORCE32
if((i_is32>>i_regmap[hr])&1) {
if(value!=-1&&value!=0) emit_sarimm(HOST_TEMPREG,31,HOST_TEMPREG);
emit_storereg(i_regmap[hr]|64,HOST_TEMPREG);
}
+#endif
}
}
}
assert((ptr[3]&0x0e)==0xa);
emit_loadlp(target,0);
emit_loadlp(addr,1);
- assert(addr>=0x7000000&&addr<0x7FFFFFF);
+ assert(addr>=BASE_ADDR&&addr<(BASE_ADDR+(1<<TARGET_SIZE_2)));
//assert((target>=0x80000000&&target<0x80800000)||(target>0xA4000000&&target<0xA4001000));
//DEBUG >
#ifdef DEBUG_CYCLE_COUNT
ftable=(int)readmemh;
if(type==LOADW_STUB)
ftable=(int)readmem;
+#ifndef FORCE32
if(type==LOADD_STUB)
ftable=(int)readmemd;
+#endif
+ assert(ftable!=0);
emit_writeword(rs,(int)&address);
//emit_pusha();
save_regs(reglist);
ftable=(int)readmemh;
if(type==LOADW_STUB)
ftable=(int)readmem;
+#ifndef FORCE32
if(type==LOADD_STUB)
ftable=(int)readmemd;
+#endif
+ assert(ftable!=0);
emit_writeword(rs,(int)&address);
//emit_pusha();
save_regs(reglist);
ftable=(int)writememh;
if(type==STOREW_STUB)
ftable=(int)writemem;
+#ifndef FORCE32
if(type==STORED_STUB)
ftable=(int)writememd;
+#endif
+ assert(ftable!=0);
emit_writeword(rs,(int)&address);
//emit_shrimm(rs,16,rs);
//emit_movmem_indexedx4(ftable,rs,rs);
ftable=(int)writememh;
if(type==STOREW_STUB)
ftable=(int)writemem;
+#ifndef FORCE32
if(type==STORED_STUB)
ftable=(int)writememd;
+#endif
+ assert(ftable!=0);
emit_writeword(rs,(int)&address);
//emit_shrimm(rs,16,rs);
//emit_movmem_indexedx4(ftable,rs,rs);
// as a 64-bit value later.
void wb_sx(signed char pre[],signed char entry[],uint64_t dirty,uint64_t is32_pre,uint64_t is32,uint64_t u,uint64_t uu)
{
+#ifndef FORCE32
if(is32_pre==is32) return;
int hr,reg;
for(hr=0;hr<HOST_REGS;hr++) {
//}
}
}
+#endif
}
void wb_valid(signed char pre[],signed char entry[],u_int dirty_pre,u_int dirty,uint64_t is32_pre,uint64_t u,uint64_t uu)
if((dirty>>hr)&1) {
if(regmap[hr]<64) {
emit_storereg(r,hr);
+#ifndef FORCE32
if((is32>>regmap[hr])&1) {
emit_sarimm(hr,31,hr);
emit_storereg(r|64,hr);
}
+#endif
}else{
emit_storereg(r|64,hr);
}
if((i_dirty>>hr)&1) {
if(i_regmap[hr]<64) {
emit_storereg(i_regmap[hr],hr);
+#ifndef FORCE32
if( ((i_is32>>i_regmap[hr])&1) ) {
#ifdef DESTRUCTIVE_WRITEBACK
emit_sarimm(hr,31,hr);
emit_storereg(i_regmap[hr]|64,HOST_TEMPREG);
#endif
}
+#endif
}else{
if( !((i_is32>>(i_regmap[hr]&63))&1) ) {
emit_storereg(i_regmap[hr],hr);
if((i_dirty>>hr)&1) {
if(i_regmap[hr]<64) {
emit_storereg(i_regmap[hr],hr);
+#ifndef FORCE32
if( ((i_is32>>i_regmap[hr])&1) ) {
#ifdef DESTRUCTIVE_WRITEBACK
emit_sarimm(hr,31,hr);
emit_storereg(i_regmap[hr]|64,HOST_TEMPREG);
#endif
}
+#endif
}else{
if( !((i_is32>>(i_regmap[hr]&63))&1) ) {
emit_storereg(i_regmap[hr],hr);
// Save it
unneeded_reg[i]=u;
unneeded_reg_upper[i]=uu;
+#ifdef FORCE32
+ unneeded_reg_upper[i]=-1LL;
+#endif
/*
printf("ur (%d,%d) %x: ",istart,iend,start+i*4);
printf("U:");
memory_map[n]=((u_int)rdram-0x80000000)>>2;
for(n=526336;n<1048576;n++) // 0x80800000 .. 0xFFFFFFFF
memory_map[n]=-1;
+#ifdef MUPEN64
for(n=0;n<0x8000;n++) { // 0 .. 0x7FFFFFFF
writemem[n] = write_nomem_new;
writememb[n] = write_nomemb_new;
writememh[n] = write_nomemh_new;
+#ifndef FORCE32
writememd[n] = write_nomemd_new;
+#endif
readmem[n] = read_nomem_new;
readmemb[n] = read_nomemb_new;
readmemh[n] = read_nomemh_new;
+#ifndef FORCE32
readmemd[n] = read_nomemd_new;
+#endif
}
for(n=0x8000;n<0x8080;n++) { // 0x80000000 .. 0x807FFFFF
writemem[n] = write_rdram_new;
writememb[n] = write_rdramb_new;
writememh[n] = write_rdramh_new;
+#ifndef FORCE32
writememd[n] = write_rdramd_new;
+#endif
}
for(n=0xC000;n<0x10000;n++) { // 0xC0000000 .. 0xFFFFFFFF
writemem[n] = write_nomem_new;
writememb[n] = write_nomemb_new;
writememh[n] = write_nomemh_new;
+#ifndef FORCE32
writememd[n] = write_nomemd_new;
+#endif
readmem[n] = read_nomem_new;
readmemb[n] = read_nomemb_new;
readmemh[n] = read_nomemh_new;
+#ifndef FORCE32
readmemd[n] = read_nomemd_new;
+#endif
}
+#endif
tlb_hacks();
arch_init();
}
current.is32=temp_is32;
}
}
+#ifdef FORCE32
+ memset(p32, 0xff, sizeof(p32));
+ current.is32=-1LL;
+#endif
+
memcpy(regmap_pre[i],current.regmap,sizeof(current.regmap));
regs[i].wasconst=current.isconst;
regs[i].was32=current.is32;