Kaynağa Gözat

* Xtensa: handle localsize > 32760

git-svn-id: trunk@44840 -
florian 5 yıl önce
ebeveyn
işleme
c2df0f2300

+ 17 - 1
compiler/xtensa/cgcpu.pas

@@ -619,6 +619,7 @@ implementation
          regoffset : LongInt;
          stack_parameters : Boolean;
          registerarea : PtrInt;
+         l : TAsmLabel;
       begin
         LocalSize:=align(LocalSize,4);
         stack_parameters:=current_procinfo.procdef.stack_tainting_parameter(calleeside);
@@ -705,7 +706,22 @@ implementation
                       localsize:=align(localsize,current_settings.alignment.localalignmax);
                     end;
 
-                  list.concat(taicpu.op_reg_const(A_ENTRY,NR_STACK_POINTER_REG,localsize));
+                  if localsize>32760 then
+                    begin
+                      list.concat(taicpu.op_reg_const(A_ENTRY,NR_STACK_POINTER_REG,32));
+
+                      reference_reset(ref,4,[]);
+                      current_asmdata.getjumplabel(l);
+                      cg.a_label(current_procinfo.aktlocaldata,l);
+                      current_procinfo.aktlocaldata.concat(tai_const.Create_32bit(longint(localsize-32)));
+                      ref.symbol:=l;
+                      list.concat(taicpu.op_reg_ref(A_L32R,NR_A8,ref));
+
+                      list.concat(taicpu.op_reg_reg_reg(A_SUB,NR_A8,NR_STACK_POINTER_REG,NR_A8));
+                      list.concat(taicpu.op_reg_reg(A_MOVSP,NR_STACK_POINTER_REG,NR_A8));
+                    end
+                  else
+                    list.concat(taicpu.op_reg_const(A_ENTRY,NR_STACK_POINTER_REG,localsize));
                 end;
               else
                 Internalerror(2020031401);

+ 1 - 0
compiler/xtensa/xtensaatt.inc

@@ -28,6 +28,7 @@
 'j',
 'j.l',
 'mov',
+'movsp',
 'mov.s',
 'movnez',
 'movi',

+ 1 - 0
compiler/xtensa/xtensaop.inc

@@ -28,6 +28,7 @@ A_LSI,
 A_J,
 A_J_L,
 A_MOV,
+A_MOVSP,
 A_MOV_S,
 A_MOVNEZ,
 A_MOVI,