mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 19:29:26 +02:00
+ create defines with FPU capabilites
+ make use of FPU capability defines in the rtl git-svn-id: trunk@42681 -
This commit is contained in:
parent
10ffed0528
commit
c418d63c16
@ -1059,6 +1059,7 @@ Const
|
||||
|
||||
tfpuflags =
|
||||
(
|
||||
FPUARM_HAS_FPA, { fpu is an fpa based FPU }
|
||||
FPUARM_HAS_VFP_EXTENSION, { fpu is a vfp extension }
|
||||
FPUARM_HAS_VFP_DOUBLE, { vfp has double support }
|
||||
FPUARM_HAS_VFP_SINGLE_ONLY, { vfp has only single support, disjunct to FPUARM_HAS_VFP_DOUBLE, for error checking }
|
||||
@ -1096,9 +1097,9 @@ Const
|
||||
( { fpu_none } [],
|
||||
{ fpu_soft } [],
|
||||
{ fpu_libgcc } [],
|
||||
{ fpu_fpa } [],
|
||||
{ fpu_fpa10 } [],
|
||||
{ fpu_fpa11 } [],
|
||||
{ fpu_fpa } [FPUARM_HAS_FPA],
|
||||
{ fpu_fpa10 } [FPUARM_HAS_FPA],
|
||||
{ fpu_fpa11 } [FPUARM_HAS_FPA],
|
||||
{ fpu_vfpv2 } [FPUARM_HAS_VFP_EXTENSION,FPUARM_HAS_VFP_DOUBLE],
|
||||
{ fpu_vfpv3 } [FPUARM_HAS_VFP_EXTENSION,FPUARM_HAS_VFP_DOUBLE,FPUARM_HAS_32REGS,FPUARM_HAS_VMOV_CONST],
|
||||
{ fpu_neon_vfpv3 } [FPUARM_HAS_VFP_EXTENSION,FPUARM_HAS_VFP_DOUBLE,FPUARM_HAS_32REGS,FPUARM_HAS_VMOV_CONST,FPUARM_HAS_NEON],
|
||||
|
@ -177,6 +177,7 @@
|
||||
{$define cputargethasfixedstack}
|
||||
{$define cpurefshaveindexreg}
|
||||
{$define cpucapabilities}
|
||||
{$define fpucapabilities}
|
||||
{$define SUPPORT_SAFECALL}
|
||||
{$define SUPPORT_GET_FRAME}
|
||||
{ default to armel }
|
||||
|
@ -3772,8 +3772,13 @@ var
|
||||
cmdstr : TCmdStr;
|
||||
{$if defined(cpucapabilities)}
|
||||
cpuflag : tcpuflags;
|
||||
hs : string;
|
||||
{$endif defined(cpucapabilities)}
|
||||
{$if defined(fpucapabilities)}
|
||||
fpuflag : tfpuflags;
|
||||
{$endif defined(fpucapabilities)}
|
||||
{$if defined(cpucapabilities) or defined(fpucapabilities)}
|
||||
hs : string;
|
||||
{$endif defined(cpucapabilities) or defined(fpucapabilities)}
|
||||
begin
|
||||
option:=coption.create;
|
||||
disable_configfile:=false;
|
||||
@ -4395,6 +4400,16 @@ begin
|
||||
undef_system_macro(hs);
|
||||
end;
|
||||
{$endif defined(cpucapabilities)}
|
||||
{$if defined(fpucapabilities)}
|
||||
for fpuflag:=low(fpuflag) to high(fpuflag) do
|
||||
begin
|
||||
str(fpuflag,hs);
|
||||
if fpuflag in fpu_capabilities[init_settings.fputype] then
|
||||
def_system_macro(hs)
|
||||
else
|
||||
undef_system_macro(hs);
|
||||
end;
|
||||
{$endif defined(fpucapabilities)}
|
||||
|
||||
if init_settings.fputype<>fpu_none then
|
||||
begin
|
||||
|
@ -35,7 +35,15 @@ const
|
||||
{$if not(defined(wince)) and not(defined(gba)) and not(defined(nds)) and not(defined(FPUSOFT)) and not(defined(FPULIBGCC))}
|
||||
|
||||
{$define FPC_SYSTEM_HAS_SYSINITFPU}
|
||||
{$if not defined(darwin) and not defined(FPUVFPV2) and not defined(FPUVFPV3) and not defined(FPUVFPV4) and not defined(FPUVFPV3_D16)}
|
||||
|
||||
{ for bootstrapping with 3.0.x/3.2.x }
|
||||
{$if not defined(darwin) and not defined(FPUVFPV2) and not defined(FPUVFPV3) and not defined(FPUVFPV4) and not defined(FPUVFPV3_D16) and not defined(FPUARM_HAS_VFP_EXTENSION))}
|
||||
{$define FPUARM_HAS_FPA}
|
||||
{$else}
|
||||
{$define FPUARM_HAS_VFP_EXTENSION}
|
||||
{$endif}
|
||||
|
||||
{$if defined(FPUARM_HAS_FPA)}
|
||||
Procedure SysInitFPU;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||
begin
|
||||
{ Enable FPU exceptions, but disable INEXACT, UNDERFLOW, DENORMAL }
|
||||
@ -46,7 +54,7 @@ begin
|
||||
wfs r0
|
||||
end;
|
||||
end;
|
||||
{$else}
|
||||
{$elseif defined(FPUARM_HAS_VFP_EXTENSION)}
|
||||
|
||||
|
||||
const
|
||||
|
@ -14,7 +14,16 @@
|
||||
|
||||
**********************************************************************}
|
||||
|
||||
{$if defined(FPUFPA) or defined(FPUFPA10) or defined(FPUFPA11) or defined(FPUVFPV2) or defined(FPUVFPV3) or defined(FPUVFPV4) or defined(FPUVFPV3_D16)}
|
||||
|
||||
{ for bootstrapping with 3.0.x/3.2.x }
|
||||
{$if defined(FPUFPA) or defined(FPUFPA10) or defined(FPUFPA11)}
|
||||
{$define FPUARM_HAS_FPA}
|
||||
{$endif}
|
||||
{$if defined(FPUVFPV2) or defined(FPUVFPV3) or defined(FPUVFPV4) or defined(FPUVFPV3_D16)}
|
||||
{$define FPUARM_HAS_VFP_EXTENSION}
|
||||
{$endif}
|
||||
|
||||
{$if defined(FPUARM_HAS_FPA) or defined(FPUARM_HAS_VFP_EXTENSION)}
|
||||
{$ifndef FPC_SYSTEM_HAS_ABS}
|
||||
{$define FPC_SYSTEM_HAS_ABS}
|
||||
function fpc_abs_real(d : ValReal) : ValReal;compilerproc;
|
||||
|
@ -12,6 +12,11 @@
|
||||
|
||||
**********************************************************************}
|
||||
|
||||
{ for bootstrapping with 3.0.x/3.2.x }
|
||||
{$if defined(darwin) or defined(FPUVFPV2) or defined(FPUVFPV3) or defined(FPUVFPV4) or defined(FPUVFPV3_d16) or defined(FPUFPV4_s16)}
|
||||
{$define FPUARM_HAS_VFP_EXTENSION}
|
||||
{$endif}
|
||||
|
||||
{$if defined(wince)}
|
||||
|
||||
const
|
||||
@ -132,7 +137,7 @@ procedure ClearExceptions(RaisePending: Boolean =true);
|
||||
begin
|
||||
end;
|
||||
|
||||
{$elseif defined(darwin) or defined(FPUVFPV2) or defined(FPUVFPV3) or defined(FPUVFPV4) or defined(FPUVFPV3_d16) or defined(FPUFPV4_s16)}
|
||||
{$elseif defined(FPUARM_HAS_VFP_EXTENSION)}
|
||||
|
||||
const
|
||||
_VFP_ENABLE_IM = 1 shl 8; { invalid operation }
|
||||
@ -287,7 +292,7 @@ procedure ClearExceptions(RaisePending: Boolean =true);
|
||||
VFP_SetCW(VFP_GetCW and (not _VFP_EXCEPTIONS_PENDING_MASK));
|
||||
end;
|
||||
|
||||
{$else wince/darwin/vfpv2/vfpv3}
|
||||
{$else FPUARM_HAS_VFP_EXTENSION}
|
||||
|
||||
{*****************************************************************************
|
||||
FPA code
|
||||
|
Loading…
Reference in New Issue
Block a user