improve macro logic for enabling arm math asm
authorRich Felker <dalias@aerifal.cx>
Thu, 18 Feb 2016 23:53:03 +0000 (23:53 +0000)
committerRich Felker <dalias@aerifal.cx>
Thu, 18 Feb 2016 23:53:03 +0000 (23:53 +0000)
in order to take advantage of the fpu in -mfloat-abi=softfp mode, the
__VFP_FP__ (presence of vfp fpu) was checked instead of checking for
__ARM_PCS_VFP (hardfloat EABI variant). however, the latter macro is
the one that's actually specified by the ABI documents rather than
being compiler-specific, and should also be checked in case __VFP_FP__
is not defined on some compilers or some configurations.

src/math/arm/sqrt.c
src/math/arm/sqrtf.c

index c9c0008..874af96 100644 (file)
@@ -1,6 +1,6 @@
 #include <math.h>
 
-#if __VFP_FP__ && !__SOFTFP__
+#if __ARM_PCS_VFP || (__VFP_FP__ && !__SOFTFP__)
 
 double sqrt(double x)
 {
index e657665..98858ec 100644 (file)
@@ -1,6 +1,6 @@
 #include <math.h>
 
-#if __VFP_FP__ && !__SOFTFP__
+#if __ARM_PCS_VFP || (__VFP_FP__ && !__SOFTFP__)
 
 float sqrtf(float x)
 {