Bladeren bron

* MIPS: ".set macro"/".set nomacro" directives around ".cprestore" are necessary only when offset is outside smallint range. Otherwise they just clutter the assembler file.

git-svn-id: trunk@25767 -
sergei 11 jaren geleden
bovenliggende
commit
e10e383b8e
1 gewijzigde bestanden met toevoegingen van 6 en 2 verwijderingen
  1. 6 2
      compiler/mips/cgcpu.pas

+ 6 - 2
compiler/mips/cgcpu.pas

@@ -1196,6 +1196,7 @@ var
   href:  treference;
   reg : Tsuperregister;
   helplist : TAsmList;
+  largeoffs : boolean;
 begin
   a_reg_alloc(list,NR_STACK_POINTER_REG);
 
@@ -1306,9 +1307,12 @@ begin
   if (cs_create_pic in current_settings.moduleswitches) and
      (pi_needs_got in current_procinfo.flags) then
     begin
-      list.concat(Taicpu.op_none(A_P_SET_MACRO));
+      largeoffs:=(TMIPSProcinfo(current_procinfo).save_gp_ref.offset>simm16hi);
+      if largeoffs then
+        list.concat(Taicpu.op_none(A_P_SET_MACRO));
       list.concat(Taicpu.op_const(A_P_CPRESTORE,TMIPSProcinfo(current_procinfo).save_gp_ref.offset));
-      list.concat(Taicpu.op_none(A_P_SET_NOMACRO));
+      if largeoffs then
+        list.concat(Taicpu.op_none(A_P_SET_NOMACRO));
     end;
 
   href.base:=NR_STACK_POINTER_REG;