Re: [FFmpeg-devel] [PATCH 2/2] Use gcc/clang builtins for av_sat_(add|sub)_64_c if available.

2020-05-27 Thread Michael Niedermayer
On Wed, May 27, 2020 at 11:27:14AM -0700, Dale Curtis wrote: > On Wed, May 27, 2020 at 11:10 AM Michael Niedermayer > wrote: > > > so the builtin does better and both locally do better than clang on the web > > tool > > > > Ah, sorry I forgot godbolt is compiling without any options, if you type

Re: [FFmpeg-devel] [PATCH 2/2] Use gcc/clang builtins for av_sat_(add|sub)_64_c if available.

2020-05-27 Thread Dale Curtis
On Wed, May 27, 2020 at 11:10 AM Michael Niedermayer wrote: > so the builtin does better and both locally do better than clang on the web > tool > Ah, sorry I forgot godbolt is compiling without any options, if you type -O9 in the compiler options fields you get: clang: https://godbolt.org/z/CAM

Re: [FFmpeg-devel] [PATCH 2/2] Use gcc/clang builtins for av_sat_(add|sub)_64_c if available.

2020-05-27 Thread Michael Niedermayer
On Tue, May 26, 2020 at 12:23:41PM -0700, Dale Curtis wrote: > On Fri, May 22, 2020 at 1:34 PM Michael Niedermayer > 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: > cl

Re: [FFmpeg-devel] [PATCH 2/2] Use gcc/clang builtins for av_sat_(add|sub)_64_c if available.

2020-05-26 Thread Dale Curtis
On Fri, May 22, 2020 at 1:34 PM Michael Niedermayer 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 gcc trunk: https://godbolt.org/z/iKb9jZ I

Re: [FFmpeg-devel] [PATCH 2/2] Use gcc/clang builtins for av_sat_(add|sub)_64_c if available.

2020-05-22 Thread Michael Niedermayer
On Thu, May 21, 2020 at 12:05:47PM -0700, Dale Curtis wrote: > On Thu, May 21, 2020 at 12:37 AM Michael Niedermayer > wrote: > > > gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 > > used with ccache on a x86-64 > > > > Huh, I guess there's no early abort for conditionals in a preprocessor > statement w

Re: [FFmpeg-devel] [PATCH 2/2] Use gcc/clang builtins for av_sat_(add|sub)_64_c if available.

2020-05-21 Thread Carl Eugen Hoyos
Am Mi., 20. Mai 2020 um 15:49 Uhr schrieb Martin Storsjö : > Would it work better [...] Or we could go for the simple solution which somehow became out-of-style here recently. Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ff

Re: [FFmpeg-devel] [PATCH 2/2] Use gcc/clang builtins for av_sat_(add|sub)_64_c if available.

2020-05-21 Thread Dale Curtis
On Thu, May 21, 2020 at 12:37 AM Michael Niedermayer wrote: > gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 > used with ccache on a x86-64 > Huh, I guess there's no early abort for conditionals in a preprocessor statement with __has_builtin for some reason. I've added a AV_HAS_BUILTIN macro to workaro

Re: [FFmpeg-devel] [PATCH 2/2] Use gcc/clang builtins for av_sat_(add|sub)_64_c if available.

2020-05-21 Thread Michael Niedermayer
On Wed, May 20, 2020 at 01:02:39PM -0700, Dale Curtis wrote: > On Wed, May 20, 2020 at 1:17 AM Michael Niedermayer > wrote: > > > > > In file included from ./libavutil/avutil.h:296:0, > > from ./libavutil/log.h:25, > > from ./libavutil/thread.h:34, > >

Re: [FFmpeg-devel] [PATCH 2/2] Use gcc/clang builtins for av_sat_(add|sub)_64_c if available.

2020-05-20 Thread Dale Curtis
On Wed, May 20, 2020 at 1:17 AM Michael Niedermayer wrote: > > In file included from ./libavutil/avutil.h:296:0, > from ./libavutil/log.h:25, > from ./libavutil/thread.h:34, > from libavdevice/alldevices.c:22: > ./libavutil/common.h: In function

Re: [FFmpeg-devel] [PATCH 2/2] Use gcc/clang builtins for av_sat_(add|sub)_64_c if available.

2020-05-20 Thread Martin Storsjö
On Wed, 20 May 2020, James Almer wrote: On 5/20/2020 5:17 AM, Michael Niedermayer wrote: On Mon, May 18, 2020 at 03:24:59PM -0700, Dale Curtis wrote: On Mon, May 18, 2020 at 3:24 PM Dale Curtis wrote: On Mon, May 18, 2020 at 2:22 PM Michael Niedermayer wrote: 38cfdcfc9d4fa1c1239dc01a76

Re: [FFmpeg-devel] [PATCH 2/2] Use gcc/clang builtins for av_sat_(add|sub)_64_c if available.

2020-05-20 Thread James Almer
On 5/20/2020 5:17 AM, Michael Niedermayer wrote: > On Mon, May 18, 2020 at 03:24:59PM -0700, Dale Curtis wrote: >> On Mon, May 18, 2020 at 3:24 PM Dale Curtis wrote: >> >>> On Mon, May 18, 2020 at 2:22 PM Michael Niedermayer >>> wrote: >>> > 38cfdcfc9d4fa1c1239dc01a766e369b20a0232a sat_

Re: [FFmpeg-devel] [PATCH 2/2] Use gcc/clang builtins for av_sat_(add|sub)_64_c if available.

2020-05-20 Thread Michael Niedermayer
On Mon, May 18, 2020 at 03:24:59PM -0700, Dale Curtis wrote: > On Mon, May 18, 2020 at 3:24 PM Dale Curtis wrote: > > > On Mon, May 18, 2020 at 2:22 PM Michael Niedermayer > > wrote: > > > >> > >> > 38cfdcfc9d4fa1c1239dc01a766e369b20a0232a sat_math_builtin_v5.patch > >> > > > > Latest upload is

Re: [FFmpeg-devel] [PATCH 2/2] Use gcc/clang builtins for av_sat_(add|sub)_64_c if available.

2020-05-18 Thread Dale Curtis
On Mon, May 18, 2020 at 3:24 PM Dale Curtis wrote: > On Mon, May 18, 2020 at 2:22 PM Michael Niedermayer > wrote: > >> >> > 38cfdcfc9d4fa1c1239dc01a766e369b20a0232a sat_math_builtin_v5.patch >> > > Latest upload is sat_math_builtin_v6.patch -- is that not showing up for > you? I just tested and

Re: [FFmpeg-devel] [PATCH 2/2] Use gcc/clang builtins for av_sat_(add|sub)_64_c if available.

2020-05-18 Thread Dale Curtis
On Mon, May 18, 2020 at 2:22 PM Michael Niedermayer wrote: > > > 38cfdcfc9d4fa1c1239dc01a766e369b20a0232a sat_math_builtin_v5.patch > Latest upload is sat_math_builtin_v6.patch -- is that not showing up for you? I just tested and it applies cleanly to trunk. > > From 8ac3c2cea0d00c4aec2d1c627

Re: [FFmpeg-devel] [PATCH 2/2] Use gcc/clang builtins for av_sat_(add|sub)_64_c if available.

2020-05-18 Thread Michael Niedermayer
On Mon, May 04, 2020 at 11:40:47AM -0700, Dale Curtis wrote: > On Mon, May 4, 2020 at 11:19 AM James Almer wrote: > > > On 5/4/2020 3:09 PM, Dale Curtis wrote: > > > Bump. I have 5 integer overflow fuzzing issues awaiting our resolution of > > > this discussion. Thanks. > > > > > > - dale > > > >

Re: [FFmpeg-devel] [PATCH 2/2] Use gcc/clang builtins for av_sat_(add|sub)_64_c if available.

2020-05-18 Thread Dale Curtis
The C versions of these functions have landed. Michael, did you intend to land this one too? - dale On Thu, May 14, 2020 at 12:47 PM Dale Curtis wrote: > Rebased. > > On Mon, May 4, 2020 at 11:47 AM James Almer wrote: > >> On 5/4/2020 3:40 PM, Dale Curtis wrote: >> > On Mon, May 4, 2020 at 11:

Re: [FFmpeg-devel] [PATCH 2/2] Use gcc/clang builtins for av_sat_(add|sub)_64_c if available.

2020-05-04 Thread James Almer
On 5/4/2020 3:40 PM, Dale Curtis wrote: > On Mon, May 4, 2020 at 11:19 AM James Almer wrote: > >> On 5/4/2020 3:09 PM, Dale Curtis wrote: >>> Bump. I have 5 integer overflow fuzzing issues awaiting our resolution of >>> this discussion. Thanks. >>> >>> - dale >> >> What's the first version of cla

Re: [FFmpeg-devel] [PATCH 2/2] Use gcc/clang builtins for av_sat_(add|sub)_64_c if available.

2020-05-04 Thread Dale Curtis
On Mon, May 4, 2020 at 11:19 AM James Almer wrote: > On 5/4/2020 3:09 PM, Dale Curtis wrote: > > Bump. I have 5 integer overflow fuzzing issues awaiting our resolution of > > this discussion. Thanks. > > > > - dale > > What's the first version of clang with support for __builtin_*_overflow? > Bec

Re: [FFmpeg-devel] [PATCH 2/2] Use gcc/clang builtins for av_sat_(add|sub)_64_c if available.

2020-05-04 Thread James Almer
On 5/4/2020 3:09 PM, Dale Curtis wrote: > Bump. I have 5 integer overflow fuzzing issues awaiting our resolution of > this discussion. Thanks. > > - dale What's the first version of clang with support for __builtin_*_overflow? Because with your patch as is (Checking only __clang__), it's very lik

Re: [FFmpeg-devel] [PATCH 2/2] Use gcc/clang builtins for av_sat_(add|sub)_64_c if available.

2020-05-04 Thread Dale Curtis
Bump. I have 5 integer overflow fuzzing issues awaiting our resolution of this discussion. Thanks. - dale On Fri, May 1, 2020 at 2:53 PM Dale Curtis wrote: > On Fri, May 1, 2020 at 2:00 PM Carl Eugen Hoyos > wrote: > >> Am Fr., 1. Mai 2020 um 22:16 Uhr schrieb Dale Curtis < >> dalecur...@chrom

Re: [FFmpeg-devel] [PATCH 2/2] Use gcc/clang builtins for av_sat_(add|sub)_64_c if available.

2020-05-01 Thread Dale Curtis
On Fri, May 1, 2020 at 2:00 PM Carl Eugen Hoyos wrote: > Am Fr., 1. Mai 2020 um 22:16 Uhr schrieb Dale Curtis < > dalecur...@chromium.org>: > > > > On Fri, May 1, 2020 at 1:12 PM Carl Eugen Hoyos > wrote: > > > > > Am Fr., 1. Mai 2020 um 22:06 Uhr schrieb James Almer < > jamr...@gmail.com>: > >

Re: [FFmpeg-devel] [PATCH 2/2] Use gcc/clang builtins for av_sat_(add|sub)_64_c if available.

2020-05-01 Thread Carl Eugen Hoyos
Am Fr., 1. Mai 2020 um 22:16 Uhr schrieb Dale Curtis : > > On Fri, May 1, 2020 at 1:12 PM Carl Eugen Hoyos wrote: > > > Am Fr., 1. Mai 2020 um 22:06 Uhr schrieb James Almer : > > > Just make the check > > > > > > (AV_GCC_VERSION_AT_LEAST(5,1) || defined(__clang__)) && > > > !defined(__INTEL_COMPIL

Re: [FFmpeg-devel] [PATCH 2/2] Use gcc/clang builtins for av_sat_(add|sub)_64_c if available.

2020-05-01 Thread Dale Curtis
On Fri, May 1, 2020 at 1:12 PM Carl Eugen Hoyos wrote: > Am Fr., 1. Mai 2020 um 22:06 Uhr schrieb James Almer : > > Just make the check > > > > (AV_GCC_VERSION_AT_LEAST(5,1) || defined(__clang__)) && > > !defined(__INTEL_COMPILER) > > And switch the conditions. > Thanks. Done. - dale From 84a19

Re: [FFmpeg-devel] [PATCH 2/2] Use gcc/clang builtins for av_sat_(add|sub)_64_c if available.

2020-05-01 Thread Carl Eugen Hoyos
Am Fr., 1. Mai 2020 um 22:05 Uhr schrieb James Almer : > Unless you explain why, with details, I'll have to ignore you. https://ffmpeg.org/pipermail/ffmpeg-devel/2020-May/261801.html This email and a follow-up from you are offending and annoying, and it was indeed a waste of time to discuss this

Re: [FFmpeg-devel] [PATCH 2/2] Use gcc/clang builtins for av_sat_(add|sub)_64_c if available.

2020-05-01 Thread Carl Eugen Hoyos
Am Fr., 1. Mai 2020 um 22:06 Uhr schrieb James Almer : > > On 5/1/2020 4:50 PM, Dale Curtis wrote: > > On Fri, May 1, 2020 at 12:37 PM Carl Eugen Hoyos wrote: > > > >>> > >>> So ICC on Linux defines __GNUC__ >= 5 yet doesn't support these builtins? > >> > >> No, but yes, this is the effect. > >> >

Re: [FFmpeg-devel] [PATCH 2/2] Use gcc/clang builtins for av_sat_(add|sub)_64_c if available.

2020-05-01 Thread James Almer
On 5/1/2020 4:50 PM, Dale Curtis wrote: > On Fri, May 1, 2020 at 12:37 PM Carl Eugen Hoyos wrote: > >>> >>> So ICC on Linux defines __GNUC__ >= 5 yet doesn't support these builtins? >> >> No, but yes, this is the effect. >> > > Does this patch work instead on the ICC compiler? GCC 4.2+ have supp

Re: [FFmpeg-devel] [PATCH 2/2] Use gcc/clang builtins for av_sat_(add|sub)_64_c if available.

2020-05-01 Thread James Almer
On 5/1/2020 5:01 PM, Carl Eugen Hoyos wrote: > Am Fr., 1. Mai 2020 um 21:58 Uhr schrieb James Almer : >> >> On 5/1/2020 4:46 PM, Carl Eugen Hoyos wrote: >>> Am Fr., 1. Mai 2020 um 21:42 Uhr schrieb James Almer : On 5/1/2020 4:37 PM, Carl Eugen Hoyos wrote: > Am Fr., 1. Mai 2020 um 21:

Re: [FFmpeg-devel] [PATCH 2/2] Use gcc/clang builtins for av_sat_(add|sub)_64_c if available.

2020-05-01 Thread Carl Eugen Hoyos
Am Fr., 1. Mai 2020 um 21:58 Uhr schrieb James Almer : > > On 5/1/2020 4:46 PM, Carl Eugen Hoyos wrote: > > Am Fr., 1. Mai 2020 um 21:42 Uhr schrieb James Almer : > >> > >> On 5/1/2020 4:37 PM, Carl Eugen Hoyos wrote: > >>> Am Fr., 1. Mai 2020 um 21:34 Uhr schrieb James Almer : > > On 5/1

Re: [FFmpeg-devel] [PATCH 2/2] Use gcc/clang builtins for av_sat_(add|sub)_64_c if available.

2020-05-01 Thread James Almer
On 5/1/2020 4:46 PM, Carl Eugen Hoyos wrote: > Am Fr., 1. Mai 2020 um 21:42 Uhr schrieb James Almer : >> >> On 5/1/2020 4:37 PM, Carl Eugen Hoyos wrote: >>> Am Fr., 1. Mai 2020 um 21:34 Uhr schrieb James Almer : On 5/1/2020 4:27 PM, Carl Eugen Hoyos wrote: > Am Fr., 1. Mai 2020 um 20:

Re: [FFmpeg-devel] [PATCH 2/2] Use gcc/clang builtins for av_sat_(add|sub)_64_c if available.

2020-05-01 Thread Dale Curtis
On Fri, May 1, 2020 at 12:50 PM Dale Curtis wrote: > On Fri, May 1, 2020 at 12:37 PM Carl Eugen Hoyos > wrote: > >> > >> > So ICC on Linux defines __GNUC__ >= 5 yet doesn't support these >> builtins? >> >> No, but yes, this is the effect. >> > > Does this patch work instead on the ICC compiler?

Re: [FFmpeg-devel] [PATCH 2/2] Use gcc/clang builtins for av_sat_(add|sub)_64_c if available.

2020-05-01 Thread Dale Curtis
On Fri, May 1, 2020 at 12:37 PM Carl Eugen Hoyos wrote: > > > > So ICC on Linux defines __GNUC__ >= 5 yet doesn't support these builtins? > > No, but yes, this is the effect. > Does this patch work instead on the ICC compiler? GCC 4.2+ have support for __has_builtin() which shouldn't be masquera

Re: [FFmpeg-devel] [PATCH 2/2] Use gcc/clang builtins for av_sat_(add|sub)_64_c if available.

2020-05-01 Thread Carl Eugen Hoyos
Am Fr., 1. Mai 2020 um 21:42 Uhr schrieb James Almer : > > On 5/1/2020 4:37 PM, Carl Eugen Hoyos wrote: > > Am Fr., 1. Mai 2020 um 21:34 Uhr schrieb James Almer : > >> > >> On 5/1/2020 4:27 PM, Carl Eugen Hoyos wrote: > >>> Am Fr., 1. Mai 2020 um 20:22 Uhr schrieb James Almer : > > On 5/1

Re: [FFmpeg-devel] [PATCH 2/2] Use gcc/clang builtins for av_sat_(add|sub)_64_c if available.

2020-05-01 Thread James Almer
On 5/1/2020 4:37 PM, Carl Eugen Hoyos wrote: > Am Fr., 1. Mai 2020 um 21:34 Uhr schrieb James Almer : >> >> On 5/1/2020 4:27 PM, Carl Eugen Hoyos wrote: >>> Am Fr., 1. Mai 2020 um 20:22 Uhr schrieb James Almer : On 5/1/2020 3:07 PM, Carl Eugen Hoyos wrote: > Am Fr., 1. Mai 2020 um 19:

Re: [FFmpeg-devel] [PATCH 2/2] Use gcc/clang builtins for av_sat_(add|sub)_64_c if available.

2020-05-01 Thread Carl Eugen Hoyos
Am Fr., 1. Mai 2020 um 21:34 Uhr schrieb James Almer : > > On 5/1/2020 4:27 PM, Carl Eugen Hoyos wrote: > > Am Fr., 1. Mai 2020 um 20:22 Uhr schrieb James Almer : > >> > >> On 5/1/2020 3:07 PM, Carl Eugen Hoyos wrote: > >>> Am Fr., 1. Mai 2020 um 19:24 Uhr schrieb Dale Curtis > >>> : > >

Re: [FFmpeg-devel] [PATCH 2/2] Use gcc/clang builtins for av_sat_(add|sub)_64_c if available.

2020-05-01 Thread James Almer
On 5/1/2020 4:27 PM, Carl Eugen Hoyos wrote: > Am Fr., 1. Mai 2020 um 20:22 Uhr schrieb James Almer : >> >> On 5/1/2020 3:07 PM, Carl Eugen Hoyos wrote: >>> Am Fr., 1. Mai 2020 um 19:24 Uhr schrieb Dale Curtis >>> : Signed-off-by: Dale Curtis --- libavutil/common.h | 10 +

Re: [FFmpeg-devel] [PATCH 2/2] Use gcc/clang builtins for av_sat_(add|sub)_64_c if available.

2020-05-01 Thread Carl Eugen Hoyos
Am Fr., 1. Mai 2020 um 20:22 Uhr schrieb James Almer : > > On 5/1/2020 3:07 PM, Carl Eugen Hoyos wrote: > > Am Fr., 1. Mai 2020 um 19:24 Uhr schrieb Dale Curtis > > : > >> > >> Signed-off-by: Dale Curtis > >> --- > >> libavutil/common.h | 10 ++ > >> 1 file changed, 10 insertions(+) > >

Re: [FFmpeg-devel] [PATCH 2/2] Use gcc/clang builtins for av_sat_(add|sub)_64_c if available.

2020-05-01 Thread Dale Curtis
On Fri, May 1, 2020 at 11:22 AM James Almer wrote: > On 5/1/2020 3:07 PM, Carl Eugen Hoyos wrote: > > Am Fr., 1. Mai 2020 um 19:24 Uhr schrieb Dale Curtis < > dalecur...@chromium.org>: > >> > >> Signed-off-by: Dale Curtis > >> --- > >> libavutil/common.h | 10 ++ > >> 1 file changed, 10

Re: [FFmpeg-devel] [PATCH 2/2] Use gcc/clang builtins for av_sat_(add|sub)_64_c if available.

2020-05-01 Thread James Almer
On 5/1/2020 3:07 PM, Carl Eugen Hoyos wrote: > Am Fr., 1. Mai 2020 um 19:24 Uhr schrieb Dale Curtis > : >> >> Signed-off-by: Dale Curtis >> --- >> libavutil/common.h | 10 ++ >> 1 file changed, 10 insertions(+) > > Imo, this is guaranteed to break x86 compilation with some unusual > too

Re: [FFmpeg-devel] [PATCH 2/2] Use gcc/clang builtins for av_sat_(add|sub)_64_c if available.

2020-05-01 Thread Carl Eugen Hoyos
Am Fr., 1. Mai 2020 um 19:24 Uhr schrieb Dale Curtis : > > Signed-off-by: Dale Curtis > --- > libavutil/common.h | 10 ++ > 1 file changed, 10 insertions(+) Imo, this is guaranteed to break x86 compilation with some unusual toolchain. I looked carefully at all occurrences of AV_GCC_VERSI

Re: [FFmpeg-devel] [PATCH 2/2] Use gcc/clang builtins for av_sat_(add|sub)_64_c if available.

2020-05-01 Thread Dale Curtis
Rebased. On Fri, May 1, 2020 at 10:24 AM Dale Curtis wrote: > Signed-off-by: Dale Curtis > --- > libavutil/common.h | 10 ++ > 1 file changed, 10 insertions(+) > sat_math_builtin_v1.patch Description: Binary data ___ ffmpeg-devel mailing li

[FFmpeg-devel] [PATCH 2/2] Use gcc/clang builtins for av_sat_(add|sub)_64_c if available.

2020-05-01 Thread Dale Curtis
Signed-off-by: Dale Curtis --- libavutil/common.h | 10 ++ 1 file changed, 10 insertions(+) sat_math_builtin_v0.patch Description: Binary data ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-dev