mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 23:49:22 +02:00
+ optimize some slwi/rlwinm combos
git-svn-id: trunk@1378 -
This commit is contained in:
parent
9cf0865d0e
commit
4558cd705e
@ -122,6 +122,27 @@ const
|
|||||||
result := true;
|
result := true;
|
||||||
end;
|
end;
|
||||||
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:
|
A_SRWI:
|
||||||
begin
|
begin
|
||||||
if getnextinstruction(p,next1) and
|
if getnextinstruction(p,next1) and
|
||||||
|
Loading…
Reference in New Issue
Block a user