mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 18:29:09 +02:00
Fix broken peephole optimization that was testing the wrong register for modifications.
Fix tests on unsigned values. The flags were swapped. git-svn-id: trunk@30392 -
This commit is contained in:
parent
48b38994c8
commit
7fe4b13248
@ -238,7 +238,7 @@ Implementation
|
|||||||
(taicpu(p).oper[0]^.typ = top_reg) and
|
(taicpu(p).oper[0]^.typ = top_reg) and
|
||||||
(taicpu(p).oper[1]^.typ = top_reg) and
|
(taicpu(p).oper[1]^.typ = top_reg) and
|
||||||
GetNextInstructionUsingReg(p,hp1,taicpu(p).oper[0]^.reg) and
|
GetNextInstructionUsingReg(p,hp1,taicpu(p).oper[0]^.reg) and
|
||||||
(not RegModifiedBetween(taicpu(p).oper[0]^.reg, p, hp1)) and
|
(not RegModifiedBetween(taicpu(p).oper[1]^.reg, p, hp1)) and
|
||||||
(hp1.typ = ait_instruction) and
|
(hp1.typ = ait_instruction) and
|
||||||
(taicpu(hp1).opcode in [A_PUSH,A_MOV,A_CP,A_CPC,A_ADD,A_SUB,A_EOR,A_AND,A_OR]) and
|
(taicpu(hp1).opcode in [A_PUSH,A_MOV,A_CP,A_CPC,A_ADD,A_SUB,A_EOR,A_AND,A_OR]) and
|
||||||
RegInInstruction(taicpu(p).oper[0]^.reg, hp1) and
|
RegInInstruction(taicpu(p).oper[0]^.reg, hp1) and
|
||||||
|
@ -101,9 +101,9 @@ interface
|
|||||||
ltn:
|
ltn:
|
||||||
GetResFlags:=F_NotPossible;
|
GetResFlags:=F_NotPossible;
|
||||||
lten:
|
lten:
|
||||||
GetResFlags:=F_CS;
|
GetResFlags:=F_SH;
|
||||||
gtn:
|
gtn:
|
||||||
GetResFlags:=F_CC;
|
GetResFlags:=F_LO;
|
||||||
gten:
|
gten:
|
||||||
GetResFlags:=F_NotPossible;
|
GetResFlags:=F_NotPossible;
|
||||||
else
|
else
|
||||||
@ -112,13 +112,13 @@ interface
|
|||||||
else
|
else
|
||||||
case NodeType of
|
case NodeType of
|
||||||
ltn:
|
ltn:
|
||||||
GetResFlags:=F_CC;
|
GetResFlags:=F_LO;
|
||||||
lten:
|
lten:
|
||||||
GetResFlags:=F_NotPossible;
|
GetResFlags:=F_NotPossible;
|
||||||
gtn:
|
gtn:
|
||||||
GetResFlags:=F_NotPossible;
|
GetResFlags:=F_NotPossible;
|
||||||
gten:
|
gten:
|
||||||
GetResFlags:=F_CS;
|
GetResFlags:=F_SH;
|
||||||
else
|
else
|
||||||
internalerror(2014082023);
|
internalerror(2014082023);
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user