Prechádzať zdrojové kódy

+ AndiSb2Sb optimization

florian 1 deň pred
rodič
commit
0d2297c9ca
1 zmenil súbory, kde vykonal 14 pridanie a 0 odobranie
  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}