mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 09:09:19 +02:00
* replace lea by add if possible
git-svn-id: trunk@25907 -
This commit is contained in:
parent
80f8f66c6e
commit
a16ceb6cdf
@ -1033,6 +1033,7 @@ begin
|
|||||||
(getsupreg(taicpu(p).oper[0]^.ref^.base) in [RS_EAX..RS_ESP]) and
|
(getsupreg(taicpu(p).oper[0]^.ref^.base) in [RS_EAX..RS_ESP]) and
|
||||||
(taicpu(p).oper[0]^.ref^.index = NR_NO) and
|
(taicpu(p).oper[0]^.ref^.index = NR_NO) and
|
||||||
(not(Assigned(taicpu(p).oper[0]^.ref^.Symbol))) then
|
(not(Assigned(taicpu(p).oper[0]^.ref^.Symbol))) then
|
||||||
|
begin
|
||||||
if (taicpu(p).oper[0]^.ref^.base <> taicpu(p).oper[1]^.reg) and
|
if (taicpu(p).oper[0]^.ref^.base <> taicpu(p).oper[1]^.reg) and
|
||||||
(taicpu(p).oper[0]^.ref^.offset = 0) then
|
(taicpu(p).oper[0]^.ref^.offset = 0) then
|
||||||
begin
|
begin
|
||||||
@ -1085,6 +1086,27 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
end
|
||||||
|
else if MatchReference(taicpu(p).oper[0]^.ref^,taicpu(p).oper[1]^.reg,NR_INVALID) then
|
||||||
|
begin
|
||||||
|
hp1:=taicpu.op_reg_reg(A_ADD,S_L,taicpu(p).oper[0]^.ref^.index,
|
||||||
|
taicpu(p).oper[0]^.ref^.base);
|
||||||
|
InsertLLItem(asml,p.previous,p.next, hp1);
|
||||||
|
DebugMsg('Peephole Lea2AddBase done',hp1);
|
||||||
|
p.free;
|
||||||
|
p:=hp1;
|
||||||
|
continue;
|
||||||
|
end
|
||||||
|
else if MatchReference(taicpu(p).oper[0]^.ref^,NR_INVALID,taicpu(p).oper[1]^.reg) then
|
||||||
|
begin
|
||||||
|
hp1:=taicpu.op_reg_reg(A_ADD,S_L,taicpu(p).oper[0]^.ref^.base,
|
||||||
|
taicpu(p).oper[0]^.ref^.index);
|
||||||
|
InsertLLItem(asml,p.previous,p.next,hp1);
|
||||||
|
DebugMsg('Peephole Lea2AddIndex done',hp1);
|
||||||
|
p.free;
|
||||||
|
p:=hp1;
|
||||||
|
continue;
|
||||||
|
end
|
||||||
end;
|
end;
|
||||||
A_MOV:
|
A_MOV:
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user