diff --git a/src/linux/cpu.c b/src/linux/cpu.c index 362f9a11323d7815c6ed71fa364a8a800217e2c2..8fe5b378c932404a7e19adc9de79421e6b09d980 100644 --- a/src/linux/cpu.c +++ b/src/linux/cpu.c @@ -70,14 +70,23 @@ unsigned vlc_CPU_raw(void) return flags; } +#elif defined (__powerpc__) /* both 32- and 64-bit */ +unsigned vlc_CPU_raw(void) +{ + const unsigned long hwcap = getauxval(AT_HWCAP); + unsigned int flags = 0; + + if (hwcap & PPC_FEATURE_HAS_ALTIVEC) + flags |= VLC_CPU_ALTIVEC; + + return flags; +} + #else #undef CPU_FLAGS #if defined (__i386__) || defined (__x86_64__) # define CPU_FLAGS "flags" -#elif defined (__powerpc__) || defined (__powerpc64__) -# define CPU_FLAGS "cpu" - #elif defined (__riscv) # include <vlc_strings.h> # define CPU_FLAGS "isa" @@ -197,10 +206,6 @@ unsigned vlc_CPU_raw(void) core_caps |= VLC_CPU_XOP; if (!strcmp (cap, "fma4")) core_caps |= VLC_CPU_FMA4; - -#elif defined (__powerpc__) || defined (__powerpc64__) - if (!strcmp (cap, "altivec supported")) - core_caps |= VLC_CPU_ALTIVEC; #endif } #endif