mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-09 19:08:15 +02:00
m68k: clear the FPU Control Register at program start. This fixes some testcode randomly failing on AmigaOS, where the FPCR state is inherited from the parent task. Also added the FPCR layout and rounding modes info, based on the Motorola 68k PRMm68k.inc
git-svn-id: trunk@30060 -
This commit is contained in:
parent
7acc709ac0
commit
7758ad9313
@ -29,6 +29,54 @@
|
||||
{****************************************************************************}
|
||||
|
||||
|
||||
{ 68881/2 FPCR Encodings
|
||||
Rounding Mode Rounding Precision
|
||||
(RND Field) Encoding (PREC Field)
|
||||
To Nearest (RN) 0 0 Extend (X)
|
||||
To Zero (RZ) 0 1 Single (S)
|
||||
To Minus Infinity (RM) 1 0 Double (D)
|
||||
To Plus Infinity (RP) 1 1 Undefined
|
||||
}
|
||||
|
||||
{ 68881/2 FPCR layout }
|
||||
{ Exception Enable Byte: }
|
||||
{ 15 - BSUN - Branch/Set on Unordered }
|
||||
{ 14 - SNAN - Signal Not A Number }
|
||||
{ 13 - OPERR - Operand Error }
|
||||
{ 12 - OVFL - Overflow }
|
||||
{ 11 - UNFL - Underflow }
|
||||
{ 10 - DZ - Divide by Zero }
|
||||
{ 09 - INEX2 - Inexact Operation }
|
||||
{ 08 - INEX1 - Inexact Decimal Input }
|
||||
{ Mode Control Byte: }
|
||||
{ 07 - PREC - Rounding Precision }
|
||||
{ 06 - PREC - Rounding Precision }
|
||||
{ 05 - RND - Rounding Mode }
|
||||
{ 04 - RND - Rounding Mode }
|
||||
{ 03 - 0 - Reserved, Set to zero }
|
||||
{ 02 - 0 - Reserved, Set to zero }
|
||||
{ 01 - 0 - Reserved, Set to zero }
|
||||
{ 00 - 0 - Reserved, Set to zero }
|
||||
|
||||
|
||||
{$IFNDEF FPU_SOFT}
|
||||
{$DEFINE FPC_SYSTEM_HAS_SYSRESETFPU}
|
||||
procedure SysResetFPU; assembler;
|
||||
asm
|
||||
clr.l d0
|
||||
fmove.l d0,fpcr
|
||||
end;
|
||||
|
||||
{$DEFINE FPC_SYSTEM_HAS_SYSINITFPU}
|
||||
procedure SysInitFPU; assembler;
|
||||
asm
|
||||
clr.l d0
|
||||
// FIX ME:
|
||||
// move.w 0,d0 // enable a sane set of exception flags here
|
||||
fmove.l d0,fpcr
|
||||
end;
|
||||
{$ENDIF}
|
||||
|
||||
procedure fpc_cpuinit;
|
||||
begin
|
||||
SysResetFPU;
|
||||
|
Loading…
Reference in New Issue
Block a user