diff --git a/rtl/morphos/system.pp b/rtl/morphos/system.pp index 33f51312f5..e65a76bb3b 100644 --- a/rtl/morphos/system.pp +++ b/rtl/morphos/system.pp @@ -303,6 +303,7 @@ end; begin + SysResetFPU; IsConsole := TRUE; IsLibrary := FALSE; StackLength := InitialStkLen; diff --git a/rtl/powerpc/powerpc.inc b/rtl/powerpc/powerpc.inc index 19b18b169b..ce9487b4f5 100644 --- a/rtl/powerpc/powerpc.inc +++ b/rtl/powerpc/powerpc.inc @@ -1147,3 +1147,17 @@ asm end; +{$IFDEF MORPHOS} +{ this is only required for MorphOS } +{$define FPC_SYSTEM_HAS_SYSRESETFPU} +procedure SysResetFPU;assembler;{$ifdef SYSTEMINLINE}inline;{$endif} +var tmp: array[0..1] of dword; +asm + { setting fpu to round to nearest mode } + li r3,0 + stw r3,8(r1) + stw r3,12(r1) + lfd f1,8(r1) + mtfsf 7,f1 +end; +{$ENDIF}