From 0bce584bae71e56e0362a82a8f77c8c28047a8a5 Mon Sep 17 00:00:00 2001 From: florian Date: Sun, 11 May 2014 12:15:27 +0000 Subject: [PATCH] + set defines if fast fma is available git-svn-id: trunk@27768 - --- compiler/options.pas | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/compiler/options.pas b/compiler/options.pas index c800086040..3503eee347 100644 --- a/compiler/options.pas +++ b/compiler/options.pas @@ -27,7 +27,7 @@ interface uses cfileutl, - globtype,globals,verbose,systems,cpuinfo, comprsrc; + globtype,globals,verbose,systems,cpuinfo,comprsrc; Type TOption=class @@ -3542,6 +3542,16 @@ if (target_info.abi = abi_eabihf) then def_system_macro('FPC_HAS_INTERNAL_BSF'); def_system_macro('FPC_HAS_INTERNAL_BSR'); {$endif} + +{ hardware FMA support } +{$if defined(i386) or defined(x86_64)} + if (cpu_capabilities[current_settings.cputype]*[CPUX86_HAS_FMA,CPUX86_HAS_FMA4])<>[] + begin + def_system_macro('FPC_HAS_FAST_FMA_SINGLE'); + def_system_macro('FPC_HAS_FAST_FMA_DOUBLE'); + end; +{$endif defined(i386) or defined(x86_64)} + {$if defined(arm)} { it is determined during system unit compilation if clz is used for bsf or not, this is not perfect but the current implementation bsf/bsr does not allow another