Bladeren bron

+ AndiSb2Sb optimization

florian 1 dag geleden
bovenliggende
commit
0d2297c9ca
1 gewijzigde bestanden met toevoegingen van 14 en 0 verwijderingen
  1. 14 0
      compiler/riscv/aoptcpurv.pas

+ 14 - 0
compiler/riscv/aoptcpurv.pas

@@ -743,6 +743,20 @@ implementation
 
               RemoveInstr(p);
 
+              result:=true;
+            end
+          else if MatchInstruction(hp1,A_SB) and
+            (taicpu(hp1).ops=2) and
+            MatchOperand(taicpu(p).oper[0]^,taicpu(hp1).oper[0]^) and
+            (not RegModifiedBetween(taicpu(p).oper[1]^.reg, p,hp1)) and
+            RegEndOfLife(taicpu(p).oper[0]^.reg, taicpu(hp1)) then
+            begin
+              taicpu(hp1).loadreg(0,taicpu(p).oper[1]^.reg);
+
+              DebugMsg('Peephole AndiSb2Sb performed', hp1);
+
+              RemoveInstr(p);
+
               result:=true;
             end
 {$ifndef RISCV32}