VLC_RESTORE_FLAGS
AS_IF([test "$ac_cv_neon_inline" != "no"], [
NEON_CFLAGS="$ac_cv_neon_inline"
- AC_DEFINE([CAN_COMPILE_NEON], 1, [Define to 1 if NEON (and ARMv6) assembly is available with NEON_CFLAGS.])
])
], [
ac_cv_neon_inline="no"
# else
# define HAVE_FPU 0
# endif
-# define CPU_CAPABILITY_NEON (1<<24)
+# define VLC_CPU_ARM_NEON 2
+
+# ifdef __ARM_NEON__
+# define vlc_CPU_ARM_NEON() (1)
+# else
+# define vlc_CPU_ARM_NEON() ((vlc_CPU() & VLC_CPU_ARM_NEON) != 0)
+# endif
# elif defined (__sparc__)
# define HAVE_FPU 1
{
filter_t *filter = (filter_t *)obj;
- if (!(vlc_CPU() & CPU_CAPABILITY_NEON))
+ if (!vlc_CPU_ARM_NEON())
return VLC_EGENERIC;
if (!AOUT_FMTS_SIMILAR (&filter->fmt_in.audio, &filter->fmt_out.audio))
return VLC_EGENERIC;
{
filter_t *filter = (filter_t *)obj;
- if (!(vlc_CPU() & CPU_CAPABILITY_NEON))
+ if (!vlc_CPU_ARM_NEON())
return VLC_EGENERIC;
if ((filter->fmt_in.video.i_width != filter->fmt_out.video.i_width)
|| (filter->fmt_in.video.i_height != filter->fmt_out.video.i_height))
{
filter_t *filter = (filter_t *)obj;
- if (!(vlc_CPU() & CPU_CAPABILITY_NEON))
+ if (!vlc_CPU_ARM_NEON())
return VLC_EGENERIC;
if (((filter->fmt_in.video.i_width | filter->fmt_in.video.i_height) & 1)
i_accel |= MPEG2_ACCEL_ARM;
# endif
# ifdef MPEG2_ACCEL_ARM_NEON
- if( vlc_CPU() & CPU_CAPABILITY_NEON )
+ if( vlc_CPU_ARM_NEON() )
i_accel |= MPEG2_ACCEL_ARM_NEON;
# endif
else
#endif
#if defined __ARM_NEON__ // FIXME: runtime detect support
- if( chroma->pixel_size == 1 && (vlc_CPU() & CPU_CAPABILITY_NEON) )
+ if( chroma->pixel_size == 1 && vlc_CPU_ARM_NEON() )
{
p_sys->pf_merge = MergeNEON;
p_sys->pf_end_merge = NULL;
# endif
#elif defined ( __arm__)
- #ifdef __ARM_NEON__
- i_capabilities |= CPU_CAPABILITY_NEON;
- #elif defined (CAN_COMPILE_NEON)
- #ifdef __ANDROID__
- if (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON)
- i_capabilities |= CPU_CAPABILITY_NEON;
- #endif
- #endif
+# ifdef __ANDROID__
+ if (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON)
+ i_capabilities |= VLC_CPU_ARM_NEON;
+# endif
+
#endif
cpu_flags = i_capabilities;
void vlc_CPU_dump (vlc_object_t *obj)
{
- const unsigned flags = vlc_CPU();
char buf[200], *p = buf;
+#if defined (__i386__) || defined (__x86_64__)
+ const unsigned flags = vlc_CPU();
#define PRINT_CAPABILITY( capability, string ) \
if (flags & (capability)) \
p += sprintf (p, "%s ", (string) )
-#if defined (__i386__) || defined (__x86_64__)
PRINT_CAPABILITY(CPU_CAPABILITY_MMX, "MMX");
PRINT_CAPABILITY(CPU_CAPABILITY_3DNOW, "3DNow!");
PRINT_CAPABILITY(CPU_CAPABILITY_MMXEXT, "MMXEXT");
PRINT_CAPABILITY(CPU_CAPABILITY_SSE4A, "SSE4A");
#elif defined (__powerpc__) || defined (__ppc__) || defined (__ppc64__)
- PRINT_CAPABILITY(CPU_CAPABILITY_ALTIVEC, "AltiVec");
+ if (vlc_CPU() & CPU_CAPABILITY_ALTIVEC)
+ p += sprintf (p, "AltiVec");
#elif defined (__arm__)
- PRINT_CAPABILITY(CPU_CAPABILITY_NEON, "NEONv1");
-
-#else
- (void) flags;
+ if (vlc_CPU_ARM_NEON()) p += sprintf (p, "ARM_NEON ");
#endif
while ((cap = strsep (&p, " ")) != NULL)
{
#if defined (__arm__)
-# ifndef __ARM_NEON__
if (!strcmp (cap, "neon"))
- core_caps |= CPU_CAPABILITY_NEON;
-# endif
+ core_caps |= VLC_CPU_ARM_NEON;
#elif defined (__i386__) || defined (__x86_64__)
# ifndef __MMX__
all_caps = 0; /* Do not assume any capability! */
/* Always enable capabilities that were forced during compilation */
-#if defined (__arm__)
-# ifdef __ARM_NEON__
- all_caps |= CPU_CAPABILITY_NEON;
-# endif
-
-#elif defined (__i386__) || defined (__x86_64__)
+#if defined (__i386__) || defined (__x86_64__)
# ifdef __MMX__
all_caps |= CPU_CAPABILITY_MMX;
# endif