Browse Source

powerpc64le: fix reading FPU control word after 0758aa1143

Also, missing rest of the commit message for that change:

The default implementation of SysResetFPU now sets the FPU control word that
was last set from any thread (Delphi and FPC i386/x86-64-compatible). No longer
call SysInitFPU when starting a new thread, only SysResetFPU. Combined, this
means that new FPC-started threads will always start out with that control
word on all architectures.

Added generic fpc_cpuinit implementation that is used unless
FPC_SYSTEM_HAS_FPC_CPUINIT has been defined.

Ensure that the softfloat exception mask is initially set to the same
value as the hardware fpu exception mask on architectures that use both.

SafeLoadLibrary now saves/restores the FPU control word on all platforms.

Removed outdated fpc_mtfsb0_corrected define check in powerpc64.inc

Resolves #38230
Jonas Maebe 2 years ago
parent
commit
c89848a00f
1 changed files with 4 additions and 0 deletions
  1. 4 0
      rtl/ppcgen/ppcfpuex.inc

+ 4 - 0
rtl/ppcgen/ppcfpuex.inc

@@ -44,7 +44,11 @@ var
 asm
   mffs f0
   stfd f0,temp
+{$ifdef FPC_BIG_ENDIAN}
   lwz  r3,temp.b
+{$else}
+  lwz  r3,temp.a
+{$endif}
 end;
 
 procedure fpc_set_ppc_fpsrc(cw: TNativeFPUControlWord);