* changed darwin/ppc32 jumptable code to be the same as the darwin/ppc64

code, because that's also what gcc does in all cases and it's pic-safe

git-svn-id: trunk@8643 -
This commit is contained in:
Jonas Maebe 2007-09-25 17:56:23 +00:00
parent f110c6d506
commit 2de2b6e17f

View File

@ -87,7 +87,7 @@ implementation
i:=last+1; i:=last+1;
while i<=t^._low-1 do while i<=t^._low-1 do
begin begin
if (target_info.system<>system_powerpc64_darwin) then if not(target_info.system in [system_powerpc_darwin,system_powerpc64_darwin]) then
list.concat(Tai_const.Create_sym(elselabel)) list.concat(Tai_const.Create_sym(elselabel))
else else
list.concat(Tai_const.Create_rel_sym(aitconst_32bit,table,elselabel)); list.concat(Tai_const.Create_rel_sym(aitconst_32bit,table,elselabel));
@ -96,7 +96,7 @@ implementation
i:=t^._low; i:=t^._low;
while i<=t^._high do while i<=t^._high do
begin begin
if (target_info.system<>system_powerpc64_darwin) then if not(target_info.system in [system_powerpc_darwin,system_powerpc64_darwin]) then
list.concat(Tai_const.Create_sym(blocklabel(t^.blockid))) list.concat(Tai_const.Create_sym(blocklabel(t^.blockid)))
else else
list.concat(Tai_const.Create_rel_sym(aitconst_32bit,table,blocklabel(t^.blockid))); list.concat(Tai_const.Create_rel_sym(aitconst_32bit,table,blocklabel(t^.blockid)));
@ -126,14 +126,14 @@ implementation
end; end;
current_asmdata.getjumplabel(table); current_asmdata.getjumplabel(table);
{ create reference, indexreg := indexreg * sizeof(OS_ADDR) } { create reference, indexreg := indexreg * sizeof(OS_ADDR) }
if (target_info.system<>system_powerpc64_darwin) then if not(target_info.system in [system_powerpc_darwin,system_powerpc64_darwin]) then
mulfactor:=tcgsize2size[OS_ADDR] mulfactor:=tcgsize2size[OS_ADDR]
else else
mulfactor:=4; mulfactor:=4;
cg.a_op_const_reg(current_asmdata.CurrAsmList, OP_MUL, OS_INT, mulfactor, indexreg); cg.a_op_const_reg(current_asmdata.CurrAsmList, OP_MUL, OS_INT, mulfactor, indexreg);
reference_reset_symbol(href, table, (-aint(min_)) * mulfactor); reference_reset_symbol(href, table, (-aint(min_)) * mulfactor);
if (target_info.system<>system_powerpc64_darwin) then if not(target_info.system in [system_powerpc_darwin,system_powerpc64_darwin]) then
begin begin
href.index := indexreg; href.index := indexreg;
cg.a_load_ref_reg(current_asmdata.CurrAsmList, OS_INT, OS_INT, href, indexreg); cg.a_load_ref_reg(current_asmdata.CurrAsmList, OS_INT, OS_INT, href, indexreg);
@ -153,7 +153,7 @@ implementation
current_asmdata.CurrAsmList.concat(taicpu.op_none(A_BCTR)); current_asmdata.CurrAsmList.concat(taicpu.op_none(A_BCTR));
{ generate jump table } { generate jump table }
if (target_info.system<>system_powerpc64_darwin) then if not(target_info.system in [system_powerpc_darwin,system_powerpc64_darwin]) then
begin begin
new_section(current_procinfo.aktlocaldata,sec_rodata,current_procinfo.procdef.mangledname,sizeof(aint)); new_section(current_procinfo.aktlocaldata,sec_rodata,current_procinfo.procdef.mangledname,sizeof(aint));
current_procinfo.aktlocaldata.concat(Tai_label.Create(table)); current_procinfo.aktlocaldata.concat(Tai_label.Create(table));