On Wed, May 13, 2015 at 01:46:49PM +0200, Luca Barbato wrote:
> --- a/libavutil/ppc/cpu.c
> +++ b/libavutil/ppc/cpu.c
> @@ -85,6 +85,14 @@ int ff_get_cpu_flags_ppc(void)
>              if (buf[i] == AT_HWCAP) {
>                  if (buf[i + 1] & PPC_FEATURE_HAS_ALTIVEC)
>                      ret = AV_CPU_FLAG_ALTIVEC;
> +#ifdef PPC_FEATURE_HAS_VSX
> +                if (buf[i + 1] & PPC_FEATURE_HAS_VSX)
> +                    ret |= AV_CPU_FLAG_VSX;
> +#endif
> +#ifdef PPC_FEATURE_ARCH_2_07
> +                if (buf[i + 1] & PPC_FEATURE_HAS_POWER8)
> +                    ret |= AV_CPU_FLAG_POWER8;
> +#endif
>                  goto out;

Are these ifdefs necessary?  I.e. do headers w/o these flag definitions exist?

> @@ -118,8 +126,14 @@ out:
>          proc_ver == PVR_POWER7   ||
>          proc_ver == PVR_POWER8   ||
>          proc_ver == PVR_CELL_PPU)
> -        return AV_CPU_FLAG_ALTIVEC;
> -    return 0;
> +        ret = AV_CPU_FLAG_ALTIVEC;
> +    if (proc_ver == PVR_POWER7 ||
> +        proc_ver == PVR_POWER8)
> +        ret |= AV_CPU_FLAG_VSX;
> +    if (proc_ver == PVR_POWER8)
> +        ret |= AV_CPU_FLAG_POWER8;
> +
> +    return ret;

Aren't you skipping the following bit here:

        if (proc_ver  & 0x8000)

?

> --- a/libavutil/ppc/cpu.h
> +++ b/libavutil/ppc/cpu.h
> @@ -24,5 +24,7 @@
>  #include "libavutil/cpu_internal.h"
>  
>  #define PPC_ALTIVEC(flags) CPUEXT(flags, ALTIVEC)
> +#define PPC_VSX(flags) CPUEXT(flags, VSX)
> +#define PPC_POWER8(flags) CPUEXT(flags, POWER8)

Maintain vertical alignment, like the other cpu.h headers.

Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to