mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 12:05:57 +02:00
* set index register correctly * index register might not be changed
git-svn-id: trunk@22229 -
This commit is contained in:
parent
245d8286d5
commit
58a85e79ce
@ -380,7 +380,10 @@ Implementation
|
|||||||
(taicpu(hp1).oper[1]^.reg=p.oper[1]^.ref^.base) and
|
(taicpu(hp1).oper[1]^.reg=p.oper[1]^.ref^.base) and
|
||||||
{ don't apply the optimization if the base register is loaded }
|
{ don't apply the optimization if the base register is loaded }
|
||||||
(p.oper[0]^.reg<>p.oper[1]^.ref^.base) and
|
(p.oper[0]^.reg<>p.oper[1]^.ref^.base) and
|
||||||
not(RegModifiedBetween(taicpu(hp1).oper[0]^.reg,p,hp1)) then
|
not(RegModifiedBetween(taicpu(hp1).oper[0]^.reg,p,hp1)) and
|
||||||
|
{ don't apply the optimization if the (new) index register is loaded }
|
||||||
|
(p.oper[0]^.reg<>taicpu(hp1).oper[2]^.reg) and
|
||||||
|
not(RegModifiedBetween(taicpu(hp1).oper[2]^.reg,p,hp1)) then
|
||||||
begin
|
begin
|
||||||
DebugMsg('Peephole Str/LdrAdd/Sub2Str/Ldr Postindex done', p);
|
DebugMsg('Peephole Str/LdrAdd/Sub2Str/Ldr Postindex done', p);
|
||||||
p.oper[1]^.ref^.addressmode:=AM_POSTINDEXED;
|
p.oper[1]^.ref^.addressmode:=AM_POSTINDEXED;
|
||||||
@ -393,7 +396,7 @@ Implementation
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
p.oper[1]^.ref^.index:=taicpu(hp1).oper[1]^.reg;
|
p.oper[1]^.ref^.index:=taicpu(hp1).oper[2]^.reg;
|
||||||
if taicpu(hp1).opcode=A_ADD then
|
if taicpu(hp1).opcode=A_ADD then
|
||||||
p.oper[1]^.ref^.signindex:=1
|
p.oper[1]^.ref^.signindex:=1
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user