Sfoglia il codice sorgente

+ AddAdc2Add
+ SubSbc2Sub

git-svn-id: trunk@38485 -

florian 7 anni fa
parent
commit
52cb8fbb98
1 ha cambiato i file con 32 aggiunte e 0 eliminazioni
  1. 32 0
      compiler/avr/aoptcpu.pas

+ 32 - 0
compiler/avr/aoptcpu.pas

@@ -546,6 +546,38 @@ Implementation
                         result:=true;
                       end;
                   end;
+                A_ADD:
+                  begin
+                    if (taicpu(p).oper[1]^.reg=NR_R1) and
+                    GetNextInstruction(p, hp1) and
+                    MatchInstruction(hp1,A_ADC) then
+                    begin
+                      DebugMsg('Peephole AddAdc2Add performed', p);
+
+                      taicpu(hp1).opcode:=A_ADD;
+
+                      asml.Remove(p);
+                      p.Free;
+                      p:=hp1;
+                      result:=true;
+                    end;
+                  end;
+                A_SUB:
+                  begin
+                    if (taicpu(p).oper[1]^.reg=NR_R1) and
+                    GetNextInstruction(p, hp1) and
+                    MatchInstruction(hp1,A_SBC) then
+                    begin
+                      DebugMsg('Peephole SubSbc2Sub performed', p);
+
+                      taicpu(hp1).opcode:=A_SUB;
+
+                      asml.Remove(p);
+                      p.Free;
+                      p:=hp1;
+                      result:=true;
+                    end;
+                  end;
                 A_CLR:
                   begin
                     { turn the common