Re: [FFmpeg-devel] [PATCH 1/3] common: add ff_parity()

2016-01-07 Thread Clément Bœsch
On Sun, Jan 03, 2016 at 08:25:38PM +0100, Clément Bœsch wrote: > On Sun, Jan 03, 2016 at 08:21:00PM +0100, Clément Bœsch wrote: > > --- > > configure | 2 ++ > > libavutil/x86/intmath.h | 9 + > > 2 files changed, 11 insertions(+) > > > > diff --git a/configure b/configure >

Re: [FFmpeg-devel] [PATCH 1/3] common: add ff_parity()

2016-01-03 Thread James Almer
On 1/3/2016 6:33 PM, Clément Bœsch wrote: > 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) +{

Re: [FFmpeg-devel] [PATCH 1/3] common: add ff_parity()

2016-01-03 Thread Clément Bœsch
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 __bui

Re: [FFmpeg-devel] [PATCH 1/3] common: add ff_parity()

2016-01-03 Thread Clément Bœsch
On Sun, Jan 03, 2016 at 05:56:41PM -0300, James Almer 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; > >> +#endif > > > > Do compilers really generate

Re: [FFmpeg-devel] [PATCH 1/3] common: add ff_parity()

2016-01-03 Thread James Almer
On 1/3/2016 5:33 PM, wm4 wrote: > On Sun, 3 Jan 2016 20:21:00 +0100 > Clément Bœsch wrote: > >> --- >> configure | 2 ++ >> libavutil/x86/intmath.h | 9 + >> 2 files changed, 11 insertions(+) >> >> diff --git a/configure b/configure >> index 6710f85..610be92 100755 >> ---

Re: [FFmpeg-devel] [PATCH 1/3] common: add ff_parity()

2016-01-03 Thread James Almer
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 p

Re: [FFmpeg-devel] [PATCH 1/3] common: add ff_parity()

2016-01-03 Thread wm4
On Sun, 3 Jan 2016 20:21:00 +0100 Clément Bœsch wrote: > --- > configure | 2 ++ > libavutil/x86/intmath.h | 9 + > 2 files changed, 11 insertions(+) > > diff --git a/configure b/configure > index 6710f85..610be92 100755 > --- a/configure > +++ b/configure > @@ -1738,6 +1

Re: [FFmpeg-devel] [PATCH 1/3] common: add ff_parity()

2016-01-03 Thread Clément Bœsch
On Sun, Jan 03, 2016 at 08:21:00PM +0100, Clément Bœsch wrote: > --- > configure | 2 ++ > libavutil/x86/intmath.h | 9 + > 2 files changed, 11 insertions(+) > > diff --git a/configure b/configure > index 6710f85..610be92 100755 > --- a/configure > +++ b/configure > @@ -1738

Re: [FFmpeg-devel] [PATCH 1/3] common: add ff_parity()

2016-01-03 Thread Clément Bœsch
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 (0x6

[FFmpeg-devel] [PATCH 1/3] common: add ff_parity()

2016-01-03 Thread Clément Bœsch
--- configure | 2 ++ libavutil/x86/intmath.h | 9 + 2 files changed, 11 insertions(+) diff --git a/configure b/configure index 6710f85..610be92 100755 --- a/configure +++ b/configure @@ -1738,6 +1738,7 @@ BUILTIN_LIST=" machine_rw_barrier MemoryBarrier mm_emp