mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 22:39:36 +02:00
* do not split statements following A_IT* instructions on arm thumb2 when inserting constant pools
git-svn-id: trunk@25347 -
This commit is contained in:
parent
8884f1c0bf
commit
b4c7b40049
@ -1033,21 +1033,50 @@ implementation
|
|||||||
end;
|
end;
|
||||||
{ special case for case jump tables }
|
{ special case for case jump tables }
|
||||||
if SimpleGetNextInstruction(curtai,hp) and
|
if SimpleGetNextInstruction(curtai,hp) and
|
||||||
(tai(hp).typ=ait_instruction) and
|
(tai(hp).typ=ait_instruction) then
|
||||||
(taicpu(hp).opcode=A_LDR) and
|
|
||||||
(taicpu(hp).oper[0]^.typ=top_reg) and
|
|
||||||
(taicpu(hp).oper[0]^.reg=NR_PC) then
|
|
||||||
begin
|
begin
|
||||||
penalty:=1*multiplier;
|
case taicpu(hp).opcode of
|
||||||
hp:=tai(hp.next);
|
A_LDR:
|
||||||
{ skip register allocations and comments inserted by the optimizer }
|
if (taicpu(hp).oper[0]^.typ=top_reg) and
|
||||||
while assigned(hp) and (hp.typ in [ait_comment,ait_regalloc]) do
|
(taicpu(hp).oper[0]^.reg=NR_PC) then
|
||||||
hp:=tai(hp.next);
|
begin
|
||||||
while assigned(hp) and (hp.typ=ait_const) do
|
penalty:=multiplier;
|
||||||
begin
|
hp:=tai(hp.next);
|
||||||
inc(penalty,multiplier);
|
{ skip register allocations and comments inserted by the optimizer }
|
||||||
hp:=tai(hp.next);
|
while assigned(hp) and (hp.typ in [ait_comment,ait_regalloc]) do
|
||||||
end;
|
hp:=tai(hp.next);
|
||||||
|
while assigned(hp) and (hp.typ=ait_const) do
|
||||||
|
begin
|
||||||
|
inc(penalty,multiplier);
|
||||||
|
hp:=tai(hp.next);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
A_IT:
|
||||||
|
if current_settings.cputype in cpu_thumb2 then
|
||||||
|
penalty:=multiplier;
|
||||||
|
A_ITE,
|
||||||
|
A_ITT:
|
||||||
|
if current_settings.cputype in cpu_thumb2 then
|
||||||
|
penalty:=2*multiplier;
|
||||||
|
A_ITEE,
|
||||||
|
A_ITTE,
|
||||||
|
A_ITET,
|
||||||
|
A_ITTT:
|
||||||
|
if current_settings.cputype in cpu_thumb2 then
|
||||||
|
penalty:=3*multiplier;
|
||||||
|
A_ITEEE,
|
||||||
|
A_ITTEE,
|
||||||
|
A_ITETE,
|
||||||
|
A_ITTTE,
|
||||||
|
A_ITEET,
|
||||||
|
A_ITTET,
|
||||||
|
A_ITETT,
|
||||||
|
A_ITTTT:
|
||||||
|
if current_settings.cputype in cpu_thumb2 then
|
||||||
|
penalty:=4*multiplier;
|
||||||
|
else
|
||||||
|
penalty:=0;
|
||||||
|
end;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
penalty:=0;
|
penalty:=0;
|
||||||
|
Loading…
Reference in New Issue
Block a user