* patch by Nico Erfruth: Support BX for function returns on armv5+

BX is supported from ARMv4T onwards, but i don't have a armv4t device to
test it.

Using BX instead of mov pc,lr allows for a better pipeline utilization
by enabling the CPUs branch predictor to work properly.

git-svn-id: trunk@21505 -
This commit is contained in:
florian 2012-06-06 19:42:26 +00:00
parent 12553a9367
commit 4ea1d22c5a

View File

@ -1788,7 +1788,7 @@ unit cgcpu;
if regs=[] then
begin
if (current_settings.cputype<cpu_armv6) then
if (current_settings.cputype<cpu_armv5) then
list.concat(taicpu.op_reg_reg(A_MOV,NR_PC,NR_R14))
else
list.concat(taicpu.op_reg(A_BX,NR_R14))
@ -1809,7 +1809,7 @@ unit cgcpu;
list.concat(setoppostfix(taicpu.op_ref_regset(A_LDM,ref,R_INTREGISTER,R_SUBWHOLE,regs),PF_EA));
end;
end
else if (current_settings.cputype<cpu_armv6) then
else if (current_settings.cputype<cpu_armv5) then
list.concat(taicpu.op_reg_reg(A_MOV,NR_PC,NR_R14))
else
list.concat(taicpu.op_reg(A_BX,NR_R14))