[vlc-devel] [RFC] [PATCH] ARM: detect VFP floating point unit

Rémi Denis-Courmont remi at remlab.net
Wed Jan 25 17:07:24 CET 2012


This sets HAVE_FPU correctly on ARM targets if VFP instructions are
enabled. Note that __VFP_FP__ implies the use of the VFP floating point
format, not the availability of the VFP instructions. Thus software
floating emulation __SOFTFP__ (i.e. -mfloat-abi=softfp) is excluded
explicitly.

Alternatively, HAVE_FPU could be set only when the VFP Procedure
Calling Standard __ARM_VFP_PCS is enabled (i.e. -mfloat-abi=hard).
---
 include/vlc_cpu.h |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/include/vlc_cpu.h b/include/vlc_cpu.h
index 63cc978..28b67d7 100644
--- a/include/vlc_cpu.h
+++ b/include/vlc_cpu.h
@@ -91,7 +91,12 @@ VLC_API unsigned vlc_CPU( void );
 #  define HAVE_FPU 1
 
 # elif defined (__arm__)
-#  define HAVE_FPU 0 /* revisit later? */
+#  if defined (__VFP_FP__) && !defined (__SOFTFP__)
+                           // defined (__ARM_PCS_VFP)
+#   define HAVE_FPU 1
+#  else
+#   define HAVE_FPU 0
+#  endif
 
 # elif defined (__sparc__)
 #  define HAVE_FPU 1
-- 
1.7.8.3




More information about the vlc-devel mailing list