* 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:
Yuriy Sydorov 2021-09-15 00:27:13 +03:00
parent e2624fdaaa
commit a7e234254f

View File

@ -9659,23 +9659,6 @@ unit aoptx86;
{ 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
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);
Result:=true;
Exit;