On Tue, May 26, 2020 at 12:23:41PM -0700, Dale Curtis wrote: > On Fri, May 22, 2020 at 1:34 PM Michael Niedermayer <mich...@niedermayer.cc> > wrote: > > > > > does this produce faster / better code ? > > that is do compilers actually fail to optimize this from plain > > clean C code ? > > > > Here's the difference: > clang trunk: https://godbolt.org/z/6SHmEo
interresting tool but I tried it locally (plain C version with -O9) av_sat_add64_c: # @av_sat_add64_c .cfi_startproc movabsq $9223372036854775807, %rax # imm = 0x7FFFFFFFFFFFFFFF testq %rsi, %rsi js .LBB0_2 movq %rax, %rcx subq %rsi, %rcx cmpq %rdi, %rcx jg .LBB0_2 retq .LBB0_2: addq $1, %rax movq %rax, %rcx subq %rsi, %rcx leaq (%rsi,%rdi), %rdx cmpq %rdi, %rcx cmovlq %rdx, %rax testq %rsi, %rsi cmovgq %rdx, %rax retq .Lfunc_end0: .size av_sat_add64_c, .Lfunc_end0-av_sat_add64_c .cfi_endproc # -- End function .ident "clang version 9.0.0 (https://github.com/llvm/llvm-project/ 49b965079b18f8aa485dd1156dd088d40b7ee465)" and the builtin one: av_sat_add64_c: # @av_sat_add64_c .cfi_startproc leaq (%rdi,%rsi), %rcx movabsq $9223372036854775807, %rax # imm = 0x7FFFFFFFFFFFFFFF leaq 1(%rax), %rdx testq %rcx, %rcx cmovnsq %rdx, %rax addq %rsi, %rdi cmovnoq %rdi, %rax retq so the builtin does better and both locally do better than clang on the web tool [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Into a blind darkness they enter who follow after the Ignorance, they as if into a greater darkness enter who devote themselves to the Knowledge alone. -- Isha Upanishad
signature.asc
Description: PGP signature
_______________________________________________ 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".