drc: clear dirty flag when deallocating a reg
authornotaz <notasas@gmail.com>
Thu, 27 Jan 2022 22:02:09 +0000 (00:02 +0200)
committernotaz <notasas@gmail.com>
Thu, 27 Jan 2022 23:36:13 +0000 (01:36 +0200)
In later stages it may place special regs like AGEN there, and things
like AGEN being marked dirty seemed wrong, although probably harmless
as there is no code to writeback AGEN.

libpcsxcore/new_dynarec/new_dynarec.c

index de44448..1b2479b 100644 (file)
@@ -8508,6 +8508,8 @@ int new_recompile_block(u_int addr)
           {
             regs[i].regmap[hr]=-1;
             regs[i].isconst&=~(1<<hr);
+            regs[i].dirty&=~(1<<hr);
+            regs[i+1].wasdirty&=~(1<<hr);
             if((branch_regs[i].regmap[hr]&63)!=dops[i].rs1 && (branch_regs[i].regmap[hr]&63)!=dops[i].rs2 &&
                (branch_regs[i].regmap[hr]&63)!=dops[i].rt1 && (branch_regs[i].regmap[hr]&63)!=dops[i].rt2 &&
                (branch_regs[i].regmap[hr]&63)!=dops[i+1].rt1 && (branch_regs[i].regmap[hr]&63)!=dops[i+1].rt2 &&
@@ -8561,6 +8563,8 @@ int new_recompile_block(u_int addr)
               }
               regs[i].regmap[hr]=-1;
               regs[i].isconst&=~(1<<hr);
+              regs[i].dirty&=~(1<<hr);
+              regs[i+1].wasdirty&=~(1<<hr);
             }
           }
         }