mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 01:09:31 +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);
|
||||
var
|
||||
last : TConstExprInt;
|
||||
basereg,
|
||||
indexreg : tregister;
|
||||
href : treference;
|
||||
tablelabel: TAsmLabel;
|
||||
@ -208,6 +209,26 @@ implementation
|
||||
last:=min_;
|
||||
genitem_thumb2(current_asmdata.CurrAsmList,hp);
|
||||
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
|
||||
begin
|
||||
{ adjust index }
|
||||
|
Loading…
Reference in New Issue
Block a user