Explorar o código

* make textrec/filerec unpacked, this improves the code significantly on arm etc.

git-svn-id: trunk@22057 -
florian %!s(int64=13) %!d(string=hai) anos
pai
achega
49246b6263
Modificáronse 3 ficheiros con 9 adicións e 11 borrados
  1. 3 3
      compiler/symdef.pas
  2. 3 1
      rtl/inc/filerec.inc
  3. 3 7
      rtl/inc/textrec.inc

+ 3 - 3
compiler/symdef.pas

@@ -2446,13 +2446,13 @@ implementation
         case filetyp of
           ft_text :
             if target_info.system in [system_x86_64_win64,system_ia64_win64] then
-              savesize:=634{+8}
+              savesize:=640
             else
-              savesize:=630{+8};
+              savesize:=632;
           ft_typed,
           ft_untyped :
             if target_info.system in [system_x86_64_win64,system_ia64_win64] then
-              savesize:=372
+              savesize:=376
             else
               savesize:=368;
         end;

+ 3 - 1
rtl/inc/filerec.inc

@@ -23,7 +23,9 @@
 const
   filerecnamelength = 255;
 type
-  FileRec = Packed Record
+ { using packed makes the compiler to generate ugly code on some CPUs, further
+    using packed causes the compiler to handle arrays of text wrongly, see  see tw0754 e.g. on arm  }
+  FileRec = {$ifdef VER2_6} packed {$endif} Record
     Handle    : THandle;
     Mode      : longint;
     RecSize   : SizeInt;

+ 3 - 7
rtl/inc/textrec.inc

@@ -25,7 +25,9 @@ const
 type
   TLineEndStr = string [3];
   TextBuf = array[0..TextRecBufSize-1] of char;
-  TextRec = Packed Record
+  { using packed makes the compiler to generate ugly code on some CPUs, further
+    using packed causes the compiler to handle arrays of text wrongly, see  see tw0754 e.g. on arm  }
+  TextRec = {$ifdef VER2_6} packed {$endif} Record
     Handle    : THandle;
     Mode      : longint;
     bufsize   : SizeInt;
@@ -44,11 +46,5 @@ type
 {$ifdef FPC_HAS_CPSTRING}
     CodePage  : TSystemCodePage;
 {$endif}
-{$ifndef VER2_6}
-{$ifdef CPU32}
-    { keep textrec size divedable by 4 for proper alignment of arrays of text, see tw0754 e.g. on arm }
-    Dummy : Word;
-{$endif CPU32}
-{$endif VER2_6}
   End;