mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 21:09:24 +02:00
Allow FoldShiftLdrStr for all sizes of LDR/STR, and disable it for references that post/pre increment the base register on Thumb-2 targets.
git-svn-id: trunk@26671 -
This commit is contained in:
parent
a72a3f4e01
commit
6861cbcf16
@ -1358,8 +1358,10 @@ Implementation
|
||||
(taicpu(p).oppostfix = PF_NONE) and
|
||||
GetNextInstructionUsingReg(p, hp1, taicpu(p).oper[0]^.reg) and
|
||||
{Only LDR, LDRB, STR, STRB can handle scaled register indexing}
|
||||
MatchInstruction(hp1, [A_LDR, A_STR], [taicpu(p).condition],
|
||||
[PF_None, PF_B]) and
|
||||
(MatchInstruction(hp1, [A_LDR, A_STR], [taicpu(p).condition], [PF_None, PF_B]) or
|
||||
(GenerateThumb2Code and
|
||||
MatchInstruction(hp1, [A_LDR, A_STR], [taicpu(p).condition], [PF_None, PF_B, PF_SB, PF_H, PF_SH]))
|
||||
) and
|
||||
(
|
||||
{If this is address by offset, one of the two registers can be used}
|
||||
((taicpu(hp1).oper[1]^.ref^.addressmode=AM_OFFSET) and
|
||||
@ -1373,7 +1375,8 @@ Implementation
|
||||
(
|
||||
(taicpu(hp1).oper[1]^.ref^.index = taicpu(p).oper[0]^.reg) and
|
||||
(taicpu(hp1).oper[1]^.ref^.base <> taicpu(p).oper[0]^.reg)
|
||||
)
|
||||
) and
|
||||
(not GenerateThumb2Code)
|
||||
)
|
||||
) and
|
||||
{ Only fold if there isn't another shifterop already, and offset is zero. }
|
||||
|
Loading…
Reference in New Issue
Block a user