mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-02 03:50:35 +02:00
* x86: JccMovJmpMov2CMovCMov will no longer move
MOV instructions (fixes i40122)
This commit is contained in:
parent
8f7e61eef6
commit
4d676cd6fa
@ -12407,25 +12407,13 @@ unit aoptx86;
|
||||
if there are any opposing CMOV pairs that
|
||||
write to the same register }
|
||||
for x := 0 to w - 1 do
|
||||
if RegWrites[x] = taicpu(hp1).oper[1]^.reg then
|
||||
if (RegWrites[x] = taicpu(hp1).oper[1]^.reg) then
|
||||
begin
|
||||
{ We have a match. Move this instruction
|
||||
right to the top }
|
||||
{ We have a match. Keep this as a MOV }
|
||||
|
||||
hp2 := hp1;
|
||||
{ Move ahead in preparation }
|
||||
GetNextInstruction(hp1, hp1);
|
||||
|
||||
asml.Remove(hp2);
|
||||
asml.InsertAfter(hp2, hp_prev);
|
||||
|
||||
{ Note we can't use the trick of inserting before hp_prev
|
||||
and then calling TrySwapMovOp with hp_prev2, like with
|
||||
the MOV imm,reg optimisations, because hp2 may share a
|
||||
register with the comparison }
|
||||
if (hp_prev <> p) then
|
||||
TrySwapMovCmp(hp_prev, hp2);
|
||||
|
||||
RegMatch := True;
|
||||
Break;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user