notaz.gp2x.de
/
pcsx_rearmed.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
drc: support RFE, remove ERET (it's not in r3k)
[pcsx_rearmed.git]
/
libpcsxcore
/
new_dynarec
/
assem_arm.c
diff --git
a/libpcsxcore/new_dynarec/assem_arm.c
b/libpcsxcore/new_dynarec/assem_arm.c
index
c8dab5b
..
a22c3c0
100644
(file)
--- a/
libpcsxcore/new_dynarec/assem_arm.c
+++ b/
libpcsxcore/new_dynarec/assem_arm.c
@@
-1003,6
+1003,15
@@
void emit_or_and_set_flags(int rs1,int rs2,int rt)
output_w32(0xe1900000|rd_rn_rm(rt,rs1,rs2));
}
output_w32(0xe1900000|rd_rn_rm(rt,rs1,rs2));
}
+void emit_orrshr_imm(u_int rs,u_int imm,u_int rt)
+{
+ assert(rs<16);
+ assert(rt<16);
+ assert(imm<32);
+ assem_debug("orr %s,%s,%s,lsr #%d\n",regname[rt],regname[rt],regname[rs],imm);
+ output_w32(0xe1800020|rd_rn_rm(rt,rt,rs)|(imm<<7));
+}
+
void emit_xor(u_int rs1,u_int rs2,u_int rt)
{
assem_debug("eor %s,%s,%s\n",regname[rt],regname[rs1],regname[rs2]);
void emit_xor(u_int rs1,u_int rs2,u_int rt)
{
assem_debug("eor %s,%s,%s\n",regname[rt],regname[rs1],regname[rs2]);
@@
-1938,7
+1947,7
@@
void emit_writebyte(int rt, int addr)
{
u_int offset = addr-(u_int)&dynarec_local;
assert(offset<4096);
{
u_int offset = addr-(u_int)&dynarec_local;
assert(offset<4096);
- assem_debug("str %s,fp+%d\n",regname[rt],offset);
+ assem_debug("str
b
%s,fp+%d\n",regname[rt],offset);
output_w32(0xe5c00000|rd_rn_rm(rt,FP,0)|offset);
}
void emit_writeword_imm(int imm, int addr)
output_w32(0xe5c00000|rd_rn_rm(rt,FP,0)|offset);
}
void emit_writeword_imm(int imm, int addr)
@@
-2912,7
+2921,7
@@
do_unalignedwritestub(int n)
#endif
emit_xorimm(temp,24,temp);
emit_movimm(-1,HOST_TEMPREG);
#endif
emit_xorimm(temp,24,temp);
emit_movimm(-1,HOST_TEMPREG);
- if (opcode[i]==0x2
e) { // SWR
+ if (opcode[i]==0x2
a) { // SWL
emit_bic_lsr(temp2,HOST_TEMPREG,temp,temp2);
emit_orrshr(rt,temp,temp2);
}else{
emit_bic_lsr(temp2,HOST_TEMPREG,temp,temp2);
emit_orrshr(rt,temp,temp2);
}else{
@@
-2959,15
+2968,19
@@
do_invstub(int n)
int do_dirty_stub(int i)
{
assem_debug("do_dirty_stub %x\n",start+i*4);
int do_dirty_stub(int i)
{
assem_debug("do_dirty_stub %x\n",start+i*4);
+ u_int addr=(int)start<(int)0xC0000000?(u_int)source:(u_int)start;
+ #ifdef PCSX
+ addr=(u_int)source;
+ #endif
// Careful about the code output here, verify_dirty needs to parse it.
#ifdef ARMv5_ONLY
// Careful about the code output here, verify_dirty needs to parse it.
#ifdef ARMv5_ONLY
- emit_loadlp(
(int)start<(int)0xC0000000?(int)source:(int)start
,1);
+ emit_loadlp(
addr
,1);
emit_loadlp((int)copy,2);
emit_loadlp(slen*4,3);
#else
emit_loadlp((int)copy,2);
emit_loadlp(slen*4,3);
#else
- emit_movw(
((int)start<(int)0xC0000000?(u_int)source:(u_int)start)
&0x0000FFFF,1);
+ emit_movw(
addr
&0x0000FFFF,1);
emit_movw(((u_int)copy)&0x0000FFFF,2);
emit_movw(((u_int)copy)&0x0000FFFF,2);
- emit_movt(
((int)start<(int)0xC0000000?(u_int)source:(u_int)start)
&0xFFFF0000,1);
+ emit_movt(
addr
&0xFFFF0000,1);
emit_movt(((u_int)copy)&0xFFFF0000,2);
emit_movw(slen*4,3);
#endif
emit_movt(((u_int)copy)&0xFFFF0000,2);
emit_movw(slen*4,3);
#endif
@@
-3459,6
+3472,16
@@
void cop0_assemble(int i,struct regstat *i_regs)
if((source[i]&0x3f)==0x08) // TLBP
emit_call((int)TLBP);
#endif
if((source[i]&0x3f)==0x08) // TLBP
emit_call((int)TLBP);
#endif
+#ifdef PCSX
+ if((source[i]&0x3f)==0x10) // RFE
+ {
+ emit_readword((int)&Status,0);
+ emit_andimm(0,0x3c,1);
+ emit_andimm(0,~0xf,0);
+ emit_orrshr_imm(1,2,0);
+ emit_writeword(0,(int)&Status);
+ }
+#else
if((source[i]&0x3f)==0x18) // ERET
{
int count=ccadj[i];
if((source[i]&0x3f)==0x18) // ERET
{
int count=ccadj[i];
@@
-3466,6
+3489,7
@@
void cop0_assemble(int i,struct regstat *i_regs)
emit_addimm(HOST_CCREG,CLOCK_DIVIDER*count,HOST_CCREG); // TODO: Should there be an extra cycle here?
emit_jmp((int)jump_eret);
}
emit_addimm(HOST_CCREG,CLOCK_DIVIDER*count,HOST_CCREG); // TODO: Should there be an extra cycle here?
emit_jmp((int)jump_eret);
}
+#endif
}
}
}
}