Browse Source

* 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 -

florian 13 years ago
parent
commit
4ea1d22c5a
1 changed files with 2 additions and 2 deletions
  1. 2 2
      compiler/arm/cgcpu.pas

+ 2 - 2
compiler/arm/cgcpu.pas

@@ -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))