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.
> 

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to