Re: [FFmpeg-devel] [PATCH] avutil/mathematics: make av_gcd more robust

2015-10-29 Thread Ganesh Ajjanagadde
On Thu, Oct 29, 2015 at 4:46 PM, Michael Niedermayer wrote: > On Wed, Oct 28, 2015 at 10:48:14PM -0400, Ganesh Ajjanagadde wrote: >> This ensures that no undefined behavior is invoked, while retaining >> identical return values in all cases and at no loss of performance >> (identical asm on clang

Re: [FFmpeg-devel] [PATCH] avutil/mathematics: make av_gcd more robust

2015-10-29 Thread Michael Niedermayer
On Wed, Oct 28, 2015 at 10:48:14PM -0400, Ganesh Ajjanagadde wrote: > This ensures that no undefined behavior is invoked, while retaining > identical return values in all cases and at no loss of performance > (identical asm on clang and gcc). > Essentially, this patch exchanges undefined behavior w

[FFmpeg-devel] [PATCH] avutil/mathematics: make av_gcd more robust

2015-10-28 Thread Ganesh Ajjanagadde
This ensures that no undefined behavior is invoked, while retaining identical return values in all cases and at no loss of performance (identical asm on clang and gcc). Essentially, this patch exchanges undefined behavior with implementation defined behavior, a strict improvement. Rationale: 1. Th