[FFmpeg-devel] [PATCH] Set -mfpmath=sse for cpus that support it

Måns Rullgård mans
Thu Aug 27 06:55:18 CEST 2009


Vitor Sessak <vitor1001 at gmail.com> writes:

> $subj, 10% faster TwinVQ decoding.
>
> As a side note, this option is not enabled even when passing
> "-march=native -mtune=native" to GCC. A possible reason for it,
> quoting the GCC doc, is "The resulting code should be considerably
> faster [...] but may break some existing code that expects temporaries
> to be 80bit.".
>
> -Vitor
>
> Index: configure
> ===================================================================
> --- configure	(revision 19681)
> +++ configure	(working copy)
> @@ -1649,22 +1649,27 @@
>          cpuflags="-mcpu=cell"
>          enable ldbrx
>      ;;
> -    # targets that do NOT support conditional mov (cmov)
>      i[345]86|pentium|pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3)
>          cpuflags="-march=$cpu"
>          disable cmov
>      ;;
> -    # targets that do support conditional mov (cmov)
> -    i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64|k8|opteron|athlon-fx|core2)
> +    i686|pentiumpro|pentium2|athlon|athlon-tbird)
>          cpuflags="-march=$cpu"
>          enable cmov
>          enable fast_cmov
>      ;;
> +    pentium3|pentium-m|athlon-4|athlon-[mx]p|athlon64|k8|opteron|athlon-fx|core2)
> +        cpuflags="-march=$cpu"
> +        enable cmov
> +        enable fast_cmov
> +        check_cflags -mfpmath=sse
> +    ;;
>      # targets that do support conditional mov but on which it's slow
>      pentium4|pentium4m|prescott|nocona)
>          cpuflags="-march=$cpu"
>          enable cmov
>          disable fast_cmov
> +        check_cflags -mfpmath=sse
>      ;;
>      sparc64)
>          cpuflags="-mcpu=v9"

You can't use check_cflags there.  Is there any reason to not attempt
using this flag with --cpu values?  I imagine a simple check_cflags
line together with the other x86 stuff (ebx checks etc) should be
enough.

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list