mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-22 16:29:31 +02:00
* implemented SysResetFPU for arm-wince.
* set softfloat_exception_mask in SetExceptionMask for ARM. git-svn-id: trunk@6035 -
This commit is contained in:
parent
b6dbf981c9
commit
458abdef3e
@ -29,6 +29,20 @@ begin
|
|||||||
{$endif}
|
{$endif}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{$ifdef wince}
|
||||||
|
function _controlfp(new: DWORD; mask: DWORD): DWORD; cdecl; external 'coredll';
|
||||||
|
|
||||||
|
{$define FPC_SYSTEM_HAS_SYSRESETFPU}
|
||||||
|
Procedure SysResetFPU;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||||
|
begin
|
||||||
|
softfloat_exception_flags:=0;
|
||||||
|
softfloat_exception_mask:=float_flag_underflow or float_flag_inexact or float_flag_denormal;
|
||||||
|
{ Enable FPU exceptions, but disable INEXACT, UNDERFLOW, DENORMAL }
|
||||||
|
{ FPU precision 64 bit, rounding to nearest, affine infinity }
|
||||||
|
_controlfp($000C0003, $030F031F);
|
||||||
|
end;
|
||||||
|
{$endif wince}
|
||||||
|
|
||||||
{****************************************************************************
|
{****************************************************************************
|
||||||
stack frame related stuff
|
stack frame related stuff
|
||||||
****************************************************************************}
|
****************************************************************************}
|
||||||
|
@ -126,6 +126,7 @@ begin
|
|||||||
c:=c or _EM_INEXACT;
|
c:=c or _EM_INEXACT;
|
||||||
c:=_controlfp(c, _MCW_EM);
|
c:=_controlfp(c, _MCW_EM);
|
||||||
Result:=ConvertExceptionMask(c);
|
Result:=ConvertExceptionMask(c);
|
||||||
|
softfloat_exception_mask:=dword(Mask);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure ClearExceptions(RaisePending: Boolean =true);
|
procedure ClearExceptions(RaisePending: Boolean =true);
|
||||||
@ -308,6 +309,7 @@ function SetExceptionMask(const Mask: TFPUExceptionMask): TFPUExceptionMask;
|
|||||||
cw:=cw or _FPU_MASK_PM;
|
cw:=cw or _FPU_MASK_PM;
|
||||||
|
|
||||||
FPU_SetCW(cw);
|
FPU_SetCW(cw);
|
||||||
|
softfloat_exception_mask:=dword(Mask);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
@ -1452,7 +1452,6 @@ begin
|
|||||||
xorl %eax,%eax
|
xorl %eax,%eax
|
||||||
movw %ss,%ax
|
movw %ss,%ax
|
||||||
movl %eax,_SS
|
movl %eax,_SS
|
||||||
call SysResetFPU
|
|
||||||
xorl %ebp,%ebp
|
xorl %ebp,%ebp
|
||||||
call PASCALMAIN
|
call PASCALMAIN
|
||||||
popl %ebp
|
popl %ebp
|
||||||
@ -1725,7 +1724,6 @@ end;
|
|||||||
|
|
||||||
function _getstdfilex(fd: integer): pointer; cdecl; external 'coredll';
|
function _getstdfilex(fd: integer): pointer; cdecl; external 'coredll';
|
||||||
function _fileno(fd: pointer): THandle; cdecl; external 'coredll';
|
function _fileno(fd: pointer): THandle; cdecl; external 'coredll';
|
||||||
function _controlfp(new: DWORD; mask: DWORD): DWORD; cdecl; external 'coredll';
|
|
||||||
|
|
||||||
procedure SysInitStdIO;
|
procedure SysInitStdIO;
|
||||||
begin
|
begin
|
||||||
@ -1779,11 +1777,9 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
|
SysResetFPU;
|
||||||
StackLength := CheckInitialStkLen(InitialStkLen);
|
StackLength := CheckInitialStkLen(InitialStkLen);
|
||||||
StackBottom := StackTop - StackLength;
|
StackBottom := StackTop - StackLength;
|
||||||
{ Enable FPU exceptions, but disable INEXACT, UNDERFLOW, DENORMAL }
|
|
||||||
{ FPU precision 64 bit, rounding to nearest, affine infinity }
|
|
||||||
_controlfp($000C0003, $030F031F);
|
|
||||||
{ some misc stuff }
|
{ some misc stuff }
|
||||||
hprevinst:=0;
|
hprevinst:=0;
|
||||||
if not IsLibrary then
|
if not IsLibrary then
|
||||||
|
Loading…
Reference in New Issue
Block a user