mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-03 21:18:33 +02:00
* x86: Do not replace inc/dec with add/sub 1 because this code path is
executed only for the C_Z,C_NZ,C_E,C_NE conditions, so inc/dec can be used.
This commit is contained in:
parent
e2624fdaaa
commit
a7e234254f
@ -9659,23 +9659,6 @@ unit aoptx86;
|
|||||||
{ and in case of carry for A(E)/B(E)/C/NC }
|
{ and in case of carry for A(E)/B(E)/C/NC }
|
||||||
(taicpu(hp2).condition in [C_Z,C_NZ,C_E,C_NE]) then
|
(taicpu(hp2).condition in [C_Z,C_NZ,C_E,C_NE]) then
|
||||||
begin
|
begin
|
||||||
case taicpu(hp1).opcode of
|
|
||||||
A_DEC, A_INC:
|
|
||||||
{ replace inc/dec with add/sub 1, because inc/dec doesn't set the carry flag }
|
|
||||||
begin
|
|
||||||
case taicpu(hp1).opcode Of
|
|
||||||
A_DEC: taicpu(hp1).opcode := A_SUB;
|
|
||||||
A_INC: taicpu(hp1).opcode := A_ADD;
|
|
||||||
else
|
|
||||||
;
|
|
||||||
end;
|
|
||||||
taicpu(hp1).loadoper(1,taicpu(hp1).oper[0]^);
|
|
||||||
taicpu(hp1).loadConst(0,1);
|
|
||||||
taicpu(hp1).ops:=2;
|
|
||||||
end;
|
|
||||||
else
|
|
||||||
;
|
|
||||||
end;
|
|
||||||
RemoveCurrentP(p, hp2);
|
RemoveCurrentP(p, hp2);
|
||||||
Result:=true;
|
Result:=true;
|
||||||
Exit;
|
Exit;
|
||||||
|
Loading…
Reference in New Issue
Block a user