mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 12:05:57 +02:00
Update jumptabel generation for ARM Thumb
git-svn-id: trunk@24636 -
This commit is contained in:
parent
c4263ced51
commit
e5066a5f43
@ -141,6 +141,7 @@ implementation
|
|||||||
procedure tarmcasenode.genjumptable(hp : pcaselabel;min_,max_ : aint);
|
procedure tarmcasenode.genjumptable(hp : pcaselabel;min_,max_ : aint);
|
||||||
var
|
var
|
||||||
last : TConstExprInt;
|
last : TConstExprInt;
|
||||||
|
basereg,
|
||||||
indexreg : tregister;
|
indexreg : tregister;
|
||||||
href : treference;
|
href : treference;
|
||||||
tablelabel: TAsmLabel;
|
tablelabel: TAsmLabel;
|
||||||
@ -208,6 +209,26 @@ implementation
|
|||||||
last:=min_;
|
last:=min_;
|
||||||
genitem_thumb2(current_asmdata.CurrAsmList,hp);
|
genitem_thumb2(current_asmdata.CurrAsmList,hp);
|
||||||
end
|
end
|
||||||
|
else if current_settings.cputype in cpu_thumb then
|
||||||
|
begin
|
||||||
|
cg.a_op_const_reg_reg(current_asmdata.CurrAsmList,OP_SUB,OS_ADDR,min_+1,indexreg,indexreg);
|
||||||
|
current_asmdata.getaddrlabel(tablelabel);
|
||||||
|
|
||||||
|
cg.a_op_const_reg(current_asmdata.CurrAsmList,OP_SHL,OS_ADDR,2,indexreg);
|
||||||
|
|
||||||
|
basereg:=cg.getintregister(current_asmdata.CurrAsmList, OS_ADDR);
|
||||||
|
reference_reset_symbol(href,tablelabel,0,4);
|
||||||
|
cg.a_loadaddr_ref_reg(current_asmdata.CurrAsmList, href, basereg);
|
||||||
|
|
||||||
|
cg.a_op_reg_reg(current_asmdata.CurrAsmList, OP_ADD, OS_ADDr, indexreg, basereg);
|
||||||
|
|
||||||
|
current_asmdata.CurrAsmList.Concat(taicpu.op_reg(A_BX, basereg));
|
||||||
|
|
||||||
|
cg.a_label(current_asmdata.CurrAsmList,tablelabel);
|
||||||
|
{ generate jump table }
|
||||||
|
last:=min_;
|
||||||
|
genitem(current_asmdata.CurrAsmList,hp);
|
||||||
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
{ adjust index }
|
{ adjust index }
|
||||||
|
Loading…
Reference in New Issue
Block a user