notaz.gp2x.de
/
pcsx_rearmed.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
909168d
)
drc: make BxxZAL implementation complete
author
notaz
<notasas@gmail.com>
Mon, 24 Jan 2011 22:54:51 +0000
(
00:54
+0200)
committer
notaz
<notasas@gmail.com>
Mon, 24 Jan 2011 22:54:51 +0000
(
00:54
+0200)
libpcsxcore/new_dynarec/new_dynarec.c
patch
|
blob
|
blame
|
history
diff --git
a/libpcsxcore/new_dynarec/new_dynarec.c
b/libpcsxcore/new_dynarec/new_dynarec.c
index
66a5a89
..
69e829f
100644
(file)
--- a/
libpcsxcore/new_dynarec/new_dynarec.c
+++ b/
libpcsxcore/new_dynarec/new_dynarec.c
@@
-5650,7
+5650,6
@@
void sjump_assemble(int i,struct regstat *i_regs)
// First test branch condition, then execute delay slot, then branch
ooo=0;
}
// First test branch condition, then execute delay slot, then branch
ooo=0;
}
- assert(opcode2[i]<0x10||ooo); // FIXME (BxxZALL)
if(ooo) {
s1l=get_reg(branch_regs[i].regmap,rs1[i]);
if(ooo) {
s1l=get_reg(branch_regs[i].regmap,rs1[i]);
@@
-5837,18
+5836,32
@@
void sjump_assemble(int i,struct regstat *i_regs)
// In-order execution (branch first)
//printf("IOE\n");
int nottaken=0;
// In-order execution (branch first)
//printf("IOE\n");
int nottaken=0;
+ if(rt1[i]==31) {
+ int rt,return_address;
+ assert(rt1[i+1]!=31);
+ assert(rt2[i+1]!=31);
+ rt=get_reg(branch_regs[i].regmap,31);
+ if(rt>=0) {
+ // Save the PC even if the branch is not taken
+ return_address=start+i*4+8;
+ emit_movimm(return_address,rt); // PC into link register
+ #ifdef IMM_PREFETCH
+ emit_prefetch(hash_table[((return_address>>16)^return_address)&0xFFFF]);
+ #endif
+ }
+ }
if(!unconditional) {
//printf("branch(%d): eax=%d ecx=%d edx=%d ebx=%d ebp=%d esi=%d edi=%d\n",i,branch_regs[i].regmap[0],branch_regs[i].regmap[1],branch_regs[i].regmap[2],branch_regs[i].regmap[3],branch_regs[i].regmap[5],branch_regs[i].regmap[6],branch_regs[i].regmap[7]);
if(!only32)
{
assert(s1h>=0);
if(!unconditional) {
//printf("branch(%d): eax=%d ecx=%d edx=%d ebx=%d ebp=%d esi=%d edi=%d\n",i,branch_regs[i].regmap[0],branch_regs[i].regmap[1],branch_regs[i].regmap[2],branch_regs[i].regmap[3],branch_regs[i].regmap[5],branch_regs[i].regmap[6],branch_regs[i].regmap[7]);
if(!only32)
{
assert(s1h>=0);
- if((opcode2[i]&0x
1d)==0) // BLTZ/BLTZ
L
+ if((opcode2[i]&0x
0d)==0) // BLTZ/BLTZL/BLTZAL/BLTZAL
L
{
emit_test(s1h,s1h);
nottaken=(int)out;
emit_jns(1);
}
{
emit_test(s1h,s1h);
nottaken=(int)out;
emit_jns(1);
}
- if((opcode2[i]&0x
1d)==1) // BGEZ/BGEZ
L
+ if((opcode2[i]&0x
0d)==1) // BGEZ/BGEZL/BGEZAL/BGEZAL
L
{
emit_test(s1h,s1h);
nottaken=(int)out;
{
emit_test(s1h,s1h);
nottaken=(int)out;
@@
-5858,13
+5871,13
@@
void sjump_assemble(int i,struct regstat *i_regs)
else
{
assert(s1l>=0);
else
{
assert(s1l>=0);
- if((opcode2[i]&0x
1d)==0) // BLTZ/BLTZ
L
+ if((opcode2[i]&0x
0d)==0) // BLTZ/BLTZL/BLTZAL/BLTZAL
L
{
emit_test(s1l,s1l);
nottaken=(int)out;
emit_jns(1);
}
{
emit_test(s1l,s1l);
nottaken=(int)out;
emit_jns(1);
}
- if((opcode2[i]&0x
1d)==1) // BGEZ/BGEZ
L
+ if((opcode2[i]&0x
0d)==1) // BGEZ/BGEZL/BGEZAL/BGEZAL
L
{
emit_test(s1l,s1l);
nottaken=(int)out;
{
emit_test(s1l,s1l);
nottaken=(int)out;