while (getline (&line, &linelen, info) != -1)
{
- if (strncmp (line, CPU_FLAGS, strlen (CPU_FLAGS)))
- continue;
-
char *p = line, *cap;
uint_fast32_t core_caps = 0;
+#if defined (__arm__)
+ unsigned ver;
+ if (sscanf (line, "Processor\t: ARMv%u", &ver) >= 1 && ver >= 6)
+ core_caps |= VLC_CPU_ARMv6;
+#endif
+ if (strncmp (line, CPU_FLAGS, strlen (CPU_FLAGS)))
+ continue;
+
while ((cap = strsep (&p, " ")) != NULL)
{
#if defined (__arm__)
core_caps |= VLC_CPU_SSE3;
if (!strcmp (cap, "ssse3"))
core_caps |= VLC_CPU_SSSE3;
-# ifndef __SSE4_1__
if (!strcmp (cap, "sse4_1"))
- core_caps |= CPU_CAPABILITY_SSE4_1;
-# endif
-# ifndef __SSE4_2__
+ core_caps |= VLC_CPU_SSE4_1;
if (!strcmp (cap, "sse4_2"))
- core_caps |= CPU_CAPABILITY_SSE4_1;
-# endif
+ core_caps |= VLC_CPU_SSE4_2;
if (!strcmp (cap, "sse4a"))
- core_caps |= CPU_CAPABILITY_SSE4A;
-# ifndef __3dNOW__
+ core_caps |= VLC_CPU_SSE4A;
+ if (!strcmp (cap, "avx"))
+ core_caps |= VLC_CPU_AVX;
+ if (!strcmp (cap, "avx2"))
+ core_caps |= VLC_CPU_AVX2;
if (!strcmp (cap, "3dnow"))
- core_caps |= CPU_CAPABILITY_3DNOW;
-# endif
+ core_caps |= VLC_CPU_3dNOW;
+ if (!strcmp (cap, "xop"))
+ core_caps |= VLC_CPU_XOP;
+ if (!strcmp (cap, "fma4"))
+ core_caps |= VLC_CPU_FMA4;
#elif defined (__powerpc__) || defined (__powerpc64__)
if (!strcmp (cap, "altivec supported"))
if (all_caps == 0xFFFFFFFF) /* Error parsing of cpuinfo? */
all_caps = 0; /* Do not assume any capability! */
- /* Always enable capabilities that were forced during compilation */
-#if defined (__i386__) || defined (__x86_64__)
-# ifdef __SSE4_1__
- all_caps |= CPU_CAPABILITY_SSE4_1;
-# endif
-# ifdef __SSE4_2__
- all_caps |= CPU_CAPABILITY_SSE4_2;
-# endif
-# ifdef __3dNOW__
- all_caps |= CPU_CAPABILITY_3DNOW;
-# endif
-
-#endif
cpu_flags = all_caps;
}