Pārlūkot izejas kodu

* Removed SysInitFPU/SysResetFPU from (remaining) system units initialization code. It is redundant there because it is called from fpc_cpuinit, or, in case of i386, from fpc_cpucodeinit.
* It fixes regression of tw16283b after r27169.
* BeOS, Haiku: added fpc_cpucodeinit to compensate for removal of SysInitFPU, it also enables use of CPU features like SSE.

git-svn-id: trunk@27171 -

sergei 11 gadi atpakaļ
vecāks
revīzija
9801288cdc

+ 4 - 4
rtl/beos/system.pp

@@ -376,13 +376,13 @@ begin
   StackLength := CheckInitialStkLen(InitialStkLen);
   StackBottom := Sptr - StackLength;
 
-  SysResetFPU;
-  if not(IsLibrary) then
-    SysInitFPU;
-
   { Set up signals handlers (may be needed by init code to test cpu features) }
   InstallSignals;
 
+{$ifdef cpui386}
+  fpc_cpucodeinit;
+{$endif}
+
   { Setup heap }
   myheapsize:=4096*1;// $ 20000;
   myheaprealsize:=4096*1;// $ 20000;

+ 0 - 4
rtl/bsd/system.pp

@@ -330,10 +330,6 @@ Begin
   { Set up signals handlers (may be needed by init code to test cpu features) }
   InstallSignals;
 
-  SysResetFPU;
-  if not(IsLibrary) then
-    SysInitFPU;
-
 {$if defined(cpui386) or defined(cpuarm)}
   fpc_cpucodeinit;
 {$endif cpui386}

+ 2 - 0
rtl/embedded/system.pp

@@ -212,6 +212,8 @@ var
 
 begin
 {$ifdef FPC_HAS_FEATURE_FPU}
+  { Beware: The same code is executed from fpc_cpuinit, which is included
+    per-cpu unconditionally }
   SysResetFPU;
   if not(IsLibrary) then
     SysInitFPU;

+ 4 - 4
rtl/haiku/system.pp

@@ -409,13 +409,13 @@ begin
   StackBottom := Sptr - StackLength;
   ReturnNilIfGrowHeapFails := False;
   
-  SysResetFPU;
-  if not(IsLibrary) then
-    SysInitFPU;
-
   { Set up signals handlers }
   InstallSignals;
 
+{$ifdef cpui386}
+  fpc_cpucodeinit;
+{$endif}
+
   { Setup heap }
   myheapsize:=4096*100;// $ 20000;
   myheaprealsize:=4096*100;// $ 20000;

+ 0 - 3
rtl/linux/system.pp

@@ -341,9 +341,6 @@ begin
 {$endif}
 
 {$ifndef FPUNONE}
-  SysResetFPU;
-  if not(IsLibrary) then
-    SysInitFPU;
 {$if defined(cpupowerpc)}
   // some PPC kernels set the exception bits FE0/FE1 in the MSR to zero,
   // disabling all FPU exceptions. Enable them again.

+ 0 - 3
rtl/morphos/system.pp

@@ -402,9 +402,6 @@ begin
   IsConsole := TRUE;
   StackLength := CheckInitialStkLen(InitialStkLen);
   StackBottom := Sptr - StackLength;
-  SysResetFPU;
-  if not(IsLibrary) then
-    SysInitFPU;
 { OS specific startup }
   MOS_ambMsg:=nil;
   MOS_origDir:=0;

+ 0 - 1
rtl/os2/system.pas

@@ -1121,7 +1121,6 @@ begin
      xorl %eax,%eax
      movw %ss,%ax
      movl %eax,_SS
-     call SysResetFPU
     end;
 {$ENDIF OS2EXCEPTIONS}
     DosGetInfoBlocks (@TIB, @PIB);