Преглед изворни кода

m68k: allow the optimizer to fold of two differently sized ANDs, but use the larger size in the resulting instruction

Karoly Balogh пре 14 часа
родитељ
комит
820f0b2907
1 измењених фајлова са 3 додато и 1 уклоњено
  1. 3 1
      compiler/m68k/aoptcpu.pas

+ 3 - 1
compiler/m68k/aoptcpu.pas

@@ -231,11 +231,13 @@ unit aoptcpu;
 
       if ((taicpu(p).oper[0]^.typ=top_const) and (taicpu(p).oper[1]^.typ=top_reg)) and
         GetNextInstruction(p,next) and
-        MatchInstruction(next,A_AND,[taicpu(p).opsize]) and
+        MatchInstruction(next,A_AND,[]) and
         (taicpu(next).oper[0]^.typ=top_const) and
         MatchOperand(taicpu(p).oper[1]^,taicpu(next).oper[1]^) then
        begin
          DebugMsg('Optimizer: folding double AND',p);
+         if taicpu(p).opsize<taicpu(next).opsize then
+           taicpu(p).opsize:=taicpu(next).opsize;
          taicpu(p).oper[0]^.val:=taicpu(p).oper[0]^.val and taicpu(next).oper[0]^.val;
          RemoveInstruction(next);
          result:=true;