On Sun, Jan 03, 2016 at 05:54:34PM -0300, James Almer wrote: > On 1/3/2016 4:22 PM, Clément Bœsch wrote: > > On Sun, Jan 03, 2016 at 08:21:00PM +0100, Clément Bœsch wrote: > > [...] > >> +static av_always_inline av_const int ff_parity(uint32_t v) > >> +{ > >> +#if HAVE_PARITY > >> + return __builtin_parity(v); > >> +#else > >> + return av_popcount(v) & 1; > > > > doing a popcount being overkill, this could be replaced with > > (0x6996966996696996ULL >> (x & 63) ^ (x>>7) ^ (x>>6)) & 1 > > Are you sure that's correct for an uint32_t? >
Erm. Yeah no, my bad. > > > > Whatever people prefers > > No need for the configure check. Make the above the c generic version (Add it > to > common.h or intmath.h), then on x86/intmath.h make it use __builtin_parity if > __GNU__ is true. Why should we use __builtin_parity only on x86? [...] -- Clément B.
signature.asc
Description: PGP signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel