[FFmpeg-devel] gcc: Remove auto-vectorization limitation.
Michael Niedermayer
michael at niedermayer.cc
Fri May 30 03:46:05 EEST 2025
On Mon, May 26, 2025 at 11:43:15AM +0300, Rémi Denis-Courmont wrote:
>
>
> Le 26 mai 2025 00:37:08 GMT+03:00, Michael Niedermayer <michael at niedermayer.cc> a écrit :
> >Hi Rémi
> >
> >On Sat, May 24, 2025 at 07:10:57PM +0300, Rémi Denis-Courmont wrote:
> >> Le torstaina 22. toukokuuta 2025, 9.32.18 Itä-Euroopan kesäaika Jiawei a écrit
> >> :
> >> > > The RISC-V autovectorised output looks like it has a warning "Odd
> >> > > rotation angle" which is not present in the non-autovectorised output.
> >> >
> >> > I found this occured when using '-ffast-math' in RISC-V, also occur in
> >> > -O3 -ffast-math -fno-tree-vectorize case(much slower due to the
> >> > -ffast-math),supplementary more comparison results here:
> >>
> >
> >> Unfortunately, the FFmpeg code is written with x87 semantics in mind.
> >
> >I dont remember ever writing code intentionally with x87 semantics. And i
> >have doubts other people did.
>
> It doesn't have to be intentional. FFmpeg was started and mostly developed with x86-32 then x86-64 in mind. It's entirely possible that this happened innocently.
>
> Specifically, FFmpeg uses open-code for minimum, maximum, absolute value and so on (see FFMIN, FFMAX, FFABS). They work nicely for integer maths. They also work nicely on x87 with the current set of FPU optimisations, but they differ from IEEE semantics because of NaNs, negative zeros and such.
>
> Because of that the compiler will *not* use the native FPU instructions on platforms with native IEEE floats.
replace all FFMIN with fminf() / fmin() where the arguments are float or
double, assuming that has no ill performance effects
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
If the United States is serious about tackling the national security threats
related to an insecure 5G network, it needs to rethink the extent to which it
values corporate profits and government espionage over security.-Bruce Schneier
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20250530/538f741d/attachment.sig>
More information about the ffmpeg-devel
mailing list