Selaa lähdekoodia

+ optimize some slwi/rlwinm combos

git-svn-id: trunk@1378 -
Jonas Maebe 20 vuotta sitten
vanhempi
commit
4558cd705e
1 muutettua tiedostoa jossa 21 lisäystä ja 0 poistoa
  1. 21 0
      compiler/powerpc/aoptcpu.pas

+ 21 - 0
compiler/powerpc/aoptcpu.pas

@@ -122,6 +122,27 @@ const
                       result := true;
                     end;
                 end;
+              A_SLWI:
+                begin
+                  if getnextinstruction(p,next1) and
+                     (next1.typ = ait_instruction) and
+                     (taicpu(next1).opcode = A_RLWINM) and
+                     (taicpu(next1).oper[0]^.reg = taicpu(p).oper[0]^.reg) and
+                     (taicpu(next1).oper[1]^.reg = taicpu(p).oper[0]^.reg) then
+                    begin
+                      if (taicpu(next1).oper[2]^.val = 0) then
+                        begin
+                          { convert slwi to rlwinm and see if the rlwinm }
+                          { optimization can do something with it        }
+                          taicpu(p).opcode := A_RLWINM;
+                          taicpu(p).ops := 5;
+                          taicpu(p).loadconst(2,taicpu(p).oper[2]^.val);
+                          taicpu(p).loadconst(3,0);
+                          taicpu(p).loadconst(4,31-taicpu(p).oper[2]^.val);
+                          result := true;
+                        end;
+                    end;
+                end;
               A_SRWI:
                 begin
                   if getnextinstruction(p,next1) and