mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-28 12:08:21 +02:00
- MIPS,SPARC and ARM-wince: removed remaining references to softfloat stuff.
git-svn-id: trunk@27204 -
This commit is contained in:
parent
cfd2600b24
commit
7b56c90d82
@ -80,13 +80,11 @@ function _controlfp(new: DWORD; mask: DWORD): DWORD; cdecl; external 'coredll';
|
|||||||
{$define FPC_SYSTEM_HAS_SYSRESETFPU}
|
{$define FPC_SYSTEM_HAS_SYSRESETFPU}
|
||||||
Procedure SysResetFPU;{$ifdef SYSTEMINLINE}inline;{$endif}
|
Procedure SysResetFPU;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||||
begin
|
begin
|
||||||
softfloat_exception_flags:=0;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{$define FPC_SYSTEM_HAS_SYSINITFPU}
|
{$define FPC_SYSTEM_HAS_SYSINITFPU}
|
||||||
Procedure SysInitFPU;{$ifdef SYSTEMINLINE}inline;{$endif}
|
Procedure SysInitFPU;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||||
begin
|
begin
|
||||||
softfloat_exception_mask:=float_flag_underflow or float_flag_inexact or float_flag_denormal;
|
|
||||||
{ Enable FPU exceptions, but disable INEXACT, UNDERFLOW, DENORMAL }
|
{ Enable FPU exceptions, but disable INEXACT, UNDERFLOW, DENORMAL }
|
||||||
{ FPU precision 64 bit, rounding to nearest, affine infinity }
|
{ FPU precision 64 bit, rounding to nearest, affine infinity }
|
||||||
_controlfp($000C0003, $030F031F);
|
_controlfp($000C0003, $030F031F);
|
||||||
|
@ -91,16 +91,6 @@ function SetRoundMode(const RoundMode: TFPURoundingMode): TFPURoundingMode;
|
|||||||
var
|
var
|
||||||
c: dword;
|
c: dword;
|
||||||
begin
|
begin
|
||||||
case (RoundMode) of
|
|
||||||
rmNearest :
|
|
||||||
softfloat_rounding_mode := float_round_nearest_even;
|
|
||||||
rmTruncate :
|
|
||||||
softfloat_rounding_mode := float_round_to_zero;
|
|
||||||
rmUp :
|
|
||||||
softfloat_rounding_mode := float_round_up;
|
|
||||||
rmDown :
|
|
||||||
softfloat_rounding_mode := float_round_down;
|
|
||||||
end;
|
|
||||||
c:=Ord(RoundMode) shl 16;
|
c:=Ord(RoundMode) shl 16;
|
||||||
c:=_controlfp(c, _MCW_RC);
|
c:=_controlfp(c, _MCW_RC);
|
||||||
Result:=TFPURoundingMode((c shr 16) and 3);
|
Result:=TFPURoundingMode((c shr 16) and 3);
|
||||||
@ -170,7 +160,6 @@ 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:=FPUExceptionMaskToSoftFloatMask(mask);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure ClearExceptions(RaisePending: Boolean =true);
|
procedure ClearExceptions(RaisePending: Boolean =true);
|
||||||
|
@ -36,24 +36,6 @@ const
|
|||||||
fpu_rounding_plus_inf = 2;
|
fpu_rounding_plus_inf = 2;
|
||||||
fpu_rounding_minus_inf = 3;
|
fpu_rounding_minus_inf = 3;
|
||||||
|
|
||||||
|
|
||||||
function FPUExceptionMaskToSoftFloatMask(const Mask: TFPUExceptionMask): byte;
|
|
||||||
begin
|
|
||||||
result:=0;
|
|
||||||
if exInvalidOp in Mask then
|
|
||||||
result:=result or (1 shl ord(exInvalidOp));
|
|
||||||
if exDenormalized in Mask then
|
|
||||||
result:=result or (1 shl ord(exDenormalized));
|
|
||||||
if exZeroDivide in Mask then
|
|
||||||
result:=result or (1 shl ord(exZeroDivide));
|
|
||||||
if exOverflow in Mask then
|
|
||||||
result:=result or (1 shl ord(exOverflow));
|
|
||||||
if exUnderflow in Mask then
|
|
||||||
result:=result or (1 shl ord(exUnderflow));
|
|
||||||
if exPrecision in Mask then
|
|
||||||
result:=result or (1 shl ord(exPrecision));
|
|
||||||
end;
|
|
||||||
|
|
||||||
const
|
const
|
||||||
roundmode2fsr : array [TFPURoundingMode] of byte=(
|
roundmode2fsr : array [TFPURoundingMode] of byte=(
|
||||||
fpu_rounding_nearest,
|
fpu_rounding_nearest,
|
||||||
@ -78,7 +60,6 @@ function SetRoundMode(const RoundMode: TFPURoundingMode): TFPURoundingMode;
|
|||||||
var
|
var
|
||||||
fsr: longword;
|
fsr: longword;
|
||||||
begin
|
begin
|
||||||
softfloat_rounding_mode:=byte(RoundMode);
|
|
||||||
fsr:=get_fsr;
|
fsr:=get_fsr;
|
||||||
result:=fsr2roundmode[fsr and fpu_rounding_mask];
|
result:=fsr2roundmode[fsr and fpu_rounding_mask];
|
||||||
set_fsr((fsr and not fpu_rounding_mask) or roundmode2fsr[RoundMode]);
|
set_fsr((fsr and not fpu_rounding_mask) or roundmode2fsr[RoundMode]);
|
||||||
@ -160,8 +141,6 @@ function SetExceptionMask(const Mask: TFPUExceptionMask): TFPUExceptionMask;
|
|||||||
|
|
||||||
{ update control register contents }
|
{ update control register contents }
|
||||||
set_fsr(fsr);
|
set_fsr(fsr);
|
||||||
|
|
||||||
softfloat_exception_mask:=FPUExceptionMaskToSoftFloatMask(mask);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
@ -16,23 +16,6 @@
|
|||||||
function get_fsr : dword;external name 'FPC_GETFSR';
|
function get_fsr : dword;external name 'FPC_GETFSR';
|
||||||
procedure set_fsr(fsr : dword);external name 'FPC_SETFSR';
|
procedure set_fsr(fsr : dword);external name 'FPC_SETFSR';
|
||||||
|
|
||||||
function FPUExceptionMaskToSoftFloatMask(const Mask: TFPUExceptionMask): byte;
|
|
||||||
begin
|
|
||||||
result:=0;
|
|
||||||
if exInvalidOp in Mask then
|
|
||||||
result:=result or (1 shl ord(exInvalidOp));
|
|
||||||
if exDenormalized in Mask then
|
|
||||||
result:=result or (1 shl ord(exDenormalized));
|
|
||||||
if exZeroDivide in Mask then
|
|
||||||
result:=result or (1 shl ord(exZeroDivide));
|
|
||||||
if exOverflow in Mask then
|
|
||||||
result:=result or (1 shl ord(exOverflow));
|
|
||||||
if exUnderflow in Mask then
|
|
||||||
result:=result or (1 shl ord(exUnderflow));
|
|
||||||
if exPrecision in Mask then
|
|
||||||
result:=result or (1 shl ord(exPrecision));
|
|
||||||
end;
|
|
||||||
|
|
||||||
function GetRoundMode: TFPURoundingMode;
|
function GetRoundMode: TFPURoundingMode;
|
||||||
begin
|
begin
|
||||||
result:=TFPURoundingMode(get_fsr shr 30);
|
result:=TFPURoundingMode(get_fsr shr 30);
|
||||||
@ -40,16 +23,6 @@ function GetRoundMode: TFPURoundingMode;
|
|||||||
|
|
||||||
function SetRoundMode(const RoundMode: TFPURoundingMode): TFPURoundingMode;
|
function SetRoundMode(const RoundMode: TFPURoundingMode): TFPURoundingMode;
|
||||||
begin
|
begin
|
||||||
case (RoundMode) of
|
|
||||||
rmNearest :
|
|
||||||
softfloat_rounding_mode := float_round_nearest_even;
|
|
||||||
rmTruncate :
|
|
||||||
softfloat_rounding_mode := float_round_to_zero;
|
|
||||||
rmUp :
|
|
||||||
softfloat_rounding_mode := float_round_up;
|
|
||||||
rmDown :
|
|
||||||
softfloat_rounding_mode := float_round_down;
|
|
||||||
end;
|
|
||||||
set_fsr((get_fsr and $3fffffff) or (dword(RoundMode) shl 30));
|
set_fsr((get_fsr and $3fffffff) or (dword(RoundMode) shl 30));
|
||||||
result:=TFPURoundingMode(get_fsr shr 30);
|
result:=TFPURoundingMode(get_fsr shr 30);
|
||||||
end;
|
end;
|
||||||
@ -134,8 +107,6 @@ function SetExceptionMask(const Mask: TFPUExceptionMask): TFPUExceptionMask;
|
|||||||
|
|
||||||
{ update control register contents }
|
{ update control register contents }
|
||||||
set_fsr(fsr);
|
set_fsr(fsr);
|
||||||
|
|
||||||
softfloat_exception_mask:=FPUExceptionMaskToSoftFloatMask(mask);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
@ -49,7 +49,6 @@ function get_got : pointer;assembler;nostackframe;[public, alias: 'FPC_GETGOT'];
|
|||||||
{$define FPC_SYSTEM_HAS_SYSINITFPU}
|
{$define FPC_SYSTEM_HAS_SYSINITFPU}
|
||||||
Procedure SysInitFPU;{$ifdef SYSTEMINLINE}inline;{$endif}
|
Procedure SysInitFPU;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||||
begin
|
begin
|
||||||
softfloat_exception_mask:=float_flag_underflow or float_flag_inexact or float_flag_denormal;
|
|
||||||
{ enable div by 0 and invalid operation fpu exceptions
|
{ enable div by 0 and invalid operation fpu exceptions
|
||||||
round towards zero; ieee compliant arithmetics }
|
round towards zero; ieee compliant arithmetics }
|
||||||
set_fsr((get_fsr and $3fbfffff) or $09000000);
|
set_fsr((get_fsr and $3fbfffff) or $09000000);
|
||||||
@ -58,7 +57,6 @@ Procedure SysInitFPU;{$ifdef SYSTEMINLINE}inline;{$endif}
|
|||||||
{$define FPC_SYSTEM_HAS_SYSRESETFPU}
|
{$define FPC_SYSTEM_HAS_SYSRESETFPU}
|
||||||
Procedure SysResetFPU;{$ifdef SYSTEMINLINE}inline;{$endif}
|
Procedure SysResetFPU;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||||
begin
|
begin
|
||||||
softfloat_exception_flags:=0;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user