mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-27 03:29:22 +02:00
* optimize mov/and sequences on x86-64
git-svn-id: trunk@20883 -
This commit is contained in:
parent
86c8b19336
commit
9e105677db
@ -105,6 +105,25 @@ begin
|
||||
not(getsupreg(taicpu(p).oper[1]^.reg) in UsedRegs) then
|
||||
taicpu(p).opcode := A_TEST;*)
|
||||
end;
|
||||
A_MOV:
|
||||
{ removes superfluous And's after mov's }
|
||||
begin
|
||||
if (taicpu(p).oper[1]^.typ = top_reg) and
|
||||
GetNextInstruction(p, hp1) and
|
||||
(tai(hp1).typ = ait_instruction) and
|
||||
(taicpu(hp1).opcode = A_AND) and
|
||||
(taicpu(hp1).oper[0]^.typ = top_const) and
|
||||
(taicpu(hp1).oper[1]^.typ = top_reg) and
|
||||
(taicpu(hp1).oper[1]^.reg = taicpu(p).oper[1]^.reg) then
|
||||
case taicpu(p).opsize Of
|
||||
S_L:
|
||||
if (taicpu(hp1).oper[0]^.val = $ffffffff) then
|
||||
begin
|
||||
asml.remove(hp1);
|
||||
hp1.free;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
A_MOVSX,
|
||||
A_MOVZX:
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user