Explorar o código

* New constant system_needs_16_byte_stack_alignment
defined in system.pas
used in x86/cgx86.pas
and x86_64/cgcpu.pas


git-svn-id: trunk@14401 -

pierre %!s(int64=15) %!d(string=hai) anos
pai
achega
e67307aa66
Modificáronse 3 ficheiros con 14 adicións e 6 borrados
  1. 11 0
      compiler/systems.pas
  2. 2 5
      compiler/x86/cgx86.pas
  3. 1 1
      compiler/x86_64/cgcpu.pas

+ 11 - 0
compiler/systems.pas

@@ -449,6 +449,17 @@ interface
        { all symbian systems }
        systems_symbian = [system_i386_symbian,system_arm_symbian];
 
+       { all systems for which istack must be at a 16 byte boundary 
+         when calling a function }
+       system_needs_16_byte_stack_alignment = [
+      	system_i386_darwin,
+        system_x86_64_darwin,
+        system_x86_64_win64,
+        system_x86_64_linux,
+        system_x86_64_freebsd,
+	system_x86_64_solaris];
+
+
        cpu2str : array[TSystemCpu] of string[10] =
             ('','i386','m68k','alpha','powerpc','sparc','vm','ia64','x86_64',
              'mips','arm', 'powerpc64', 'avr', 'mipsel');

+ 2 - 5
compiler/x86/cgx86.pas

@@ -147,7 +147,6 @@ unit cgx86;
       winstackpagesize = 4096;
 {$endif NOTARGETWIN}
 
-
   implementation
 
     uses
@@ -2116,14 +2115,12 @@ unit cgx86;
 
             { allocate stackframe space }
             if (localsize<>0) or
-               ((target_info.system in [system_i386_darwin,system_x86_64_darwin,
-                 system_x86_64_win64,system_x86_64_linux,system_x86_64_freebsd]) and
+               ((target_info.system in system_needs_16_byte_stack_alignment) and
                 (stackmisalignment <> 0) and
                 ((pi_do_call in current_procinfo.flags) or
                  (po_assembler in current_procinfo.procdef.procoptions))) then
               begin
-                if (target_info.system in [system_i386_darwin,system_x86_64_darwin,
-                      system_x86_64_win64,system_x86_64_linux,system_x86_64_freebsd]) then
+                if (target_info.system in system_needs_16_byte_stack_alignment) then
                   localsize := align(localsize+stackmisalignment,16)-stackmisalignment;
                 cg.g_stackpointer_alloc(list,localsize);
                 if current_procinfo.framepointer=NR_STACK_POINTER_REG then

+ 1 - 1
compiler/x86_64/cgcpu.pas

@@ -168,7 +168,7 @@ unit cgcpu;
             if (current_procinfo.framepointer=NR_STACK_POINTER_REG) then
               begin
                 stacksize:=current_procinfo.calc_stackframe_size;
-                if (target_info.system in [system_x86_64_win64,system_x86_64_linux,system_x86_64_freebsd,system_x86_64_darwin]) and
+                if (target_info.system in system_needs_16_byte_stack_alignment) and
                    ((stacksize <> 0) or
                     (pi_do_call in current_procinfo.flags) or
                     { can't detect if a call in this case -> use nostackframe }