summaryrefslogtreecommitdiff
path: root/rtl/arm
diff options
context:
space:
mode:
authorflorian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2>2019-08-13 22:12:49 +0000
committerflorian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2>2019-08-13 22:12:49 +0000
commit7a9abce7f3283677ed7f2a395a667d9ecfff22cd (patch)
treef7faf58a3689febcf5e79db7a017ac96252366e6 /rtl/arm
parent58f553e5c02f1133ebb08f5eb59e8e903e215825 (diff)
downloadfpc-7a9abce7f3283677ed7f2a395a667d9ecfff22cd.tar.gz
+ create defines with FPU capabilites
+ make use of FPU capability defines in the rtl git-svn-id: https://svn.freepascal.org/svn/fpc/trunk@42681 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'rtl/arm')
-rw-r--r--rtl/arm/arm.inc12
-rw-r--r--rtl/arm/math.inc11
-rw-r--r--rtl/arm/mathu.inc9
3 files changed, 27 insertions, 5 deletions
diff --git a/rtl/arm/arm.inc b/rtl/arm/arm.inc
index 5c3188c3f2..365216c17c 100644
--- a/rtl/arm/arm.inc
+++ b/rtl/arm/arm.inc
@@ -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
diff --git a/rtl/arm/math.inc b/rtl/arm/math.inc
index 87826d4b98..5e215870c5 100644
--- a/rtl/arm/math.inc
+++ b/rtl/arm/math.inc
@@ -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;
diff --git a/rtl/arm/mathu.inc b/rtl/arm/mathu.inc
index 4c318b32bf..3727969431 100644
--- a/rtl/arm/mathu.inc
+++ b/rtl/arm/mathu.inc
@@ -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