drc: fix bad gte unneeded reg assumption
authornotaz <notasas@gmail.com>
Sat, 10 Dec 2011 17:20:33 +0000 (19:20 +0200)
committernotaz <notasas@gmail.com>
Sat, 10 Dec 2011 23:39:13 +0000 (01:39 +0200)
libpcsxcore/new_dynarec/assem_arm.c
libpcsxcore/new_dynarec/new_dynarec.c

index 984b0ce..ebf733b 100644 (file)
@@ -4492,8 +4492,8 @@ static void c2op_assemble(int i,struct regstat *i_regs)
   if (gte_handlers[c2op]!=NULL) {
     need_flags=!(gte_unneeded[i+1]>>63); // +1 because of how liveness detection works
     need_ir=(gte_unneeded[i+1]&0xe00)!=0xe00;
-    assem_debug("gte unneeded %016llx, need_flags %d, need_ir %d\n",
-      gte_unneeded[i+1],need_flags,need_ir);
+    assem_debug("gte op %08x, unneeded %016llx, need_flags %d, need_ir %d\n",
+      source[i],gte_unneeded[i+1],need_flags,need_ir);
     if(new_dynarec_hacks&NDHACK_GTE_NO_FLAGS)
       need_flags=0;
     int shift = (source[i] >> 19) & 1;
index 8cf8dfb..37706bc 100644 (file)
@@ -7025,7 +7025,7 @@ void unneeded_registers(int istart,int iend,int r)
     uu&=~(1LL<<us2[i]);
     gte_u&=~gte_rs[i];
     if(gte_rs[i]&&rt1[i]&&(unneeded_reg[i+1]&(1ll<<rt1[i])))
-      gte_u|=gte_rs[i] // MFC2/CFC2 to dead register, unneeded
+      gte_u|=gte_rs[i]&gte_unneeded[i+1]; // MFC2/CFC2 to dead register, unneeded
     // Source-target dependencies
     uu&=~(tdep<<dep1[i]);
     uu&=~(tdep<<dep2[i]);