diff mbox

[FFmpeg-devel] lavu/cpu: disable MMX warning on non x86 platforms

Message ID 20170628132118.1142-1-u@pkh.me
State Accepted
Commit 2658e66cd1be5d07f6db6f0cfacf7c69cec580d9
Headers show

Commit Message

Clément Bœsch June 28, 2017, 1:21 p.m. UTC
We have AV_CPU_FLAG_ARMV8 == AV_CPU_FLAG_SSE3 which causes a trigger of
this MMX warning on AArch64.
---
 libavutil/cpu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

James Almer June 29, 2017, 3:47 p.m. UTC | #1
On 6/28/2017 10:21 AM, Clément Bœsch wrote:
> We have AV_CPU_FLAG_ARMV8 == AV_CPU_FLAG_SSE3 which causes a trigger of
> this MMX warning on AArch64.
> ---
>  libavutil/cpu.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/libavutil/cpu.c b/libavutil/cpu.c
> index 16e0c9278f..a22da0fa8c 100644
> --- a/libavutil/cpu.c
> +++ b/libavutil/cpu.c
> @@ -61,7 +61,8 @@ static int get_cpu_flags(void)
>  }
>  
>  void av_force_cpu_flags(int arg){
> -    if (   (arg & ( AV_CPU_FLAG_3DNOW    |
> +    if (ARCH_X86 &&
> +           (arg & ( AV_CPU_FLAG_3DNOW    |
>                      AV_CPU_FLAG_3DNOWEXT |
>                      AV_CPU_FLAG_MMXEXT   |
>                      AV_CPU_FLAG_SSE      |
> 

LGTM of course. Goes to show how the CLI or anything where log messages
are clearly visible are barely used on non-x86 targets.

This should be backported as well. It's not simply a warning as it
blindly sets the first bit of the cpuflags variable (MMX on x86, altivec
on PPC, armv6 on arm, etc).
Clément Bœsch June 29, 2017, 4:02 p.m. UTC | #2
On Thu, Jun 29, 2017 at 12:47:58PM -0300, James Almer wrote:
> On 6/28/2017 10:21 AM, Clément Bœsch wrote:
> > We have AV_CPU_FLAG_ARMV8 == AV_CPU_FLAG_SSE3 which causes a trigger of
> > this MMX warning on AArch64.
> > ---
> >  libavutil/cpu.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/libavutil/cpu.c b/libavutil/cpu.c
> > index 16e0c9278f..a22da0fa8c 100644
> > --- a/libavutil/cpu.c
> > +++ b/libavutil/cpu.c
> > @@ -61,7 +61,8 @@ static int get_cpu_flags(void)
> >  }
> >  
> >  void av_force_cpu_flags(int arg){
> > -    if (   (arg & ( AV_CPU_FLAG_3DNOW    |
> > +    if (ARCH_X86 &&
> > +           (arg & ( AV_CPU_FLAG_3DNOW    |
> >                      AV_CPU_FLAG_3DNOWEXT |
> >                      AV_CPU_FLAG_MMXEXT   |
> >                      AV_CPU_FLAG_SSE      |
> > 
> 
> LGTM of course. Goes to show how the CLI or anything where log messages
> are clearly visible are barely used on non-x86 targets.
> 
> This should be backported as well. It's not simply a warning as it
> blindly sets the first bit of the cpuflags variable (MMX on x86, altivec
> on PPC, armv6 on arm, etc).

applied, feel free to backport
diff mbox

Patch

diff --git a/libavutil/cpu.c b/libavutil/cpu.c
index 16e0c9278f..a22da0fa8c 100644
--- a/libavutil/cpu.c
+++ b/libavutil/cpu.c
@@ -61,7 +61,8 @@  static int get_cpu_flags(void)
 }
 
 void av_force_cpu_flags(int arg){
-    if (   (arg & ( AV_CPU_FLAG_3DNOW    |
+    if (ARCH_X86 &&
+           (arg & ( AV_CPU_FLAG_3DNOW    |
                     AV_CPU_FLAG_3DNOWEXT |
                     AV_CPU_FLAG_MMXEXT   |
                     AV_CPU_FLAG_SSE      |