[FFmpeg-devel] [PATCH] lavu/arm: remove GCC 4.6- stuff

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Sat Jun 8 09:23:48 EEST 2024


Rémi Denis-Courmont:
> Le lauantaina 8. kesäkuuta 2024, 0.26.21 EEST Andreas Rheinhardt a écrit :
>> (Also: IIRC Clang actually parses inline assembler and optimize it;
> 
> That sounds sketchy. While FFmpeg only uses inline assembler as intrinsic 
> ersatz, other projects can and definitely do use them for weirder stuff. That 
> will fail miserably if the compiler modifies the sequence.

See https://godbolt.org/z/ozeGoWzK7: Clang is smart enough to know that
the x86-inline asm version of av_bswap32 is self-inverse. (It can also
evaluate it for constants at compile-time.)

> 
> The Linux kernel for instance pushes/pops sections or patches the byte 
> sequence at load time or even run time. Some code also assumes exact byte 
> offsets between instructions (not sure Linux specifically). So, AFAICT, the only 
> thing the compiler can sanely do is move, and maybe eliminate/replicate, the 
> entire assembler block.
> 



More information about the ffmpeg-devel mailing list