[FFmpeg-devel] [PATCH] Set -mfpmath=sse for cpus that support it
Vitor Sessak
vitor1001
Thu Aug 27 21:44:14 CEST 2009
M?ns Rullg?rd wrote:
> Vitor Sessak <vitor1001 at gmail.com> writes:
>
>> M?ns Rullg?rd wrote:
>>> 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.
>> I can't just call "check_cflags -mfpmath=sse" for every x86 CPU
>> because GCC does not fail with "-march=386 -mfpmath=sse", it gives a
>> warning and uses 387 (so check_cflags would always add it).
>
> Does any gcc version not have that flag?
Would not all this be too much GCC-specific? My original patch should be
safe for any sane compiler (even one that happily generate SSE code with
no warnings for -march=386 -mfpmath=sse).
-Vitor
More information about the ffmpeg-devel
mailing list