diff mbox series

[FFmpeg-devel] configure: rework parsing --cpu arguments to support all features unless blacklisted

Message ID 20230917184915.16678-1-jamrial@gmail.com
State Accepted
Commit abc346de735cae1b9316b7b853aa2d2661ab40fb
Headers show
Series [FFmpeg-devel] configure: rework parsing --cpu arguments to support all features unless blacklisted | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

James Almer Sept. 17, 2023, 6:49 p.m. UTC
Keeping an ever growing list of CPUs just to pass -march to the compiler and
enable fast_cmov is a waste of time. Every CPU we know has limitations is
already handled here, so just fallback to enabling everything when a passed in
argument is not covered by those.

This will enable optimizations for CPU architectures released in the past 7 or
so years with supported GCC and clang compilers when using them as argument in
configure, instead of silently ignoring them.

Signed-off-by: James Almer <jamrial@gmail.com>
---
 configure | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

Comments

James Almer Sept. 18, 2023, 3:37 p.m. UTC | #1
On 9/17/2023 3:49 PM, James Almer wrote:
> Keeping an ever growing list of CPUs just to pass -march to the compiler and
> enable fast_cmov is a waste of time. Every CPU we know has limitations is
> already handled here, so just fallback to enabling everything when a passed in
> argument is not covered by those.
> 
> This will enable optimizations for CPU architectures released in the past 7 or
> so years with supported GCC and clang compilers when using them as argument in
> configure, instead of silently ignoring them.
> 
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
>   configure | 14 ++++++--------
>   1 file changed, 6 insertions(+), 8 deletions(-)
> 
> diff --git a/configure b/configure
> index bd7f7697c8..27602c8e14 100755
> --- a/configure
> +++ b/configure
> @@ -5445,20 +5445,18 @@ elif enabled x86; then
>               cpuflags="-march=$cpu"
>               disable i686
>           ;;
> -        # targets that do support nopl and conditional mov (cmov)
> -        i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64*|k8*|opteron*|athlon-fx\
> -        |core*|atom|bonnell|nehalem|westmere|silvermont|sandybridge|ivybridge|haswell|broadwell|skylake*|knl\
> -        |amdfam10|barcelona|b[dt]ver*|znver*)
> -            cpuflags="-march=$cpu"
> -            enable i686
> -            enable fast_cmov
> -        ;;
>           # targets that do support conditional mov but on which it's slow
>           pentium4|pentium4m|prescott|nocona)
>               cpuflags="-march=$cpu"
>               enable i686
>               disable fast_cmov
>           ;;
> +        # everything else should support nopl and conditional mov (cmov)
> +        *)
> +            cpuflags="-march=$cpu"
> +            enable i686
> +            enable fast_cmov
> +        ;;
>       esac
>   
>   fi

Will apply.
diff mbox series

Patch

diff --git a/configure b/configure
index bd7f7697c8..27602c8e14 100755
--- a/configure
+++ b/configure
@@ -5445,20 +5445,18 @@  elif enabled x86; then
             cpuflags="-march=$cpu"
             disable i686
         ;;
-        # targets that do support nopl and conditional mov (cmov)
-        i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64*|k8*|opteron*|athlon-fx\
-        |core*|atom|bonnell|nehalem|westmere|silvermont|sandybridge|ivybridge|haswell|broadwell|skylake*|knl\
-        |amdfam10|barcelona|b[dt]ver*|znver*)
-            cpuflags="-march=$cpu"
-            enable i686
-            enable fast_cmov
-        ;;
         # targets that do support conditional mov but on which it's slow
         pentium4|pentium4m|prescott|nocona)
             cpuflags="-march=$cpu"
             enable i686
             disable fast_cmov
         ;;
+        # everything else should support nopl and conditional mov (cmov)
+        *)
+            cpuflags="-march=$cpu"
+            enable i686
+            enable fast_cmov
+        ;;
     esac
 
 fi