]> git.sesse.net Git - vlc/commitdiff
ARM: detect VFP floating point unit
authorRémi Denis-Courmont <remi@remlab.net>
Wed, 25 Jan 2012 16:00:10 +0000 (18:00 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Thu, 26 Jan 2012 18:27:55 +0000 (20:27 +0200)
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. gcc -mfloat-abi=soft) is excluded
explicitly.

include/vlc_cpu.h

index 63cc97877b4ce812b1bdf57237305fdfd1038cc5..36f8da53345f763aff83126b9e356f64efa4f9bb 100644 (file)
@@ -91,7 +91,11 @@ 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__)
+#   define HAVE_FPU 1
+#  else
+#   define HAVE_FPU 0
+#  endif
 
 # elif defined (__sparc__)
 #  define HAVE_FPU 1