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

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Sat Jun 8 16:41:13 EEST 2024


Rémi Denis-Courmont:
> Le lauantaina 8. kesäkuuta 2024, 9.23.48 EEST Andreas Rheinhardt a écrit :
>> 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.)
> 
> It seems that they have some heuristics not to touch assembler that they are 
> not sure that they "completely" understand. If you add just a dummy numeric 
> label, the optimisation is not done.
> 
> My preference would be to use builtin_bswap (as riscv/ does) on all 
> architectures on GCC and Clang, and keep the bespoke C for other compilers and 
> external header inclusion.
> 

Why would you not want to use the compiler builtins for external users?

- Andreas



More information about the ffmpeg-devel mailing list