Re: pgsql: Fix compiler builtin usage in new pg_bitutils.c

2019-02-15 Thread Tom Lane
Alvaro Herrera writes: > (BTW, my reading of the articles I cited, as well as my own runs of the > test programs therein, suggest that in order to get a really good > performance improvement you need to hand-code calls to the POPCNT > instruction in assembly rather than rely on the compiler intrin

Re: pgsql: Fix compiler builtin usage in new pg_bitutils.c

2019-02-15 Thread Tom Lane
Alvaro Herrera writes: > On 2019-Feb-15, Tom Lane wrote: >> Sure, I'll pick it up. I agree it's probably a marginal performance >> change, but it seems a shame to give up when we were 80% of the way >> there. > (BTW, my reading of the articles I cited, as well as my own runs of the > test progra

Re: pgsql: Fix compiler builtin usage in new pg_bitutils.c

2019-02-15 Thread Alvaro Herrera
On 2019-Feb-15, Tom Lane wrote: > Alvaro Herrera writes: > > I'm done with this stuff. Anybody feel free to run with it, but for a > > barely noticeable performance improvement it's not going to be me. > > Sure, I'll pick it up. I agree it's probably a marginal performance > change, but it see

Re: pgsql: Fix compiler builtin usage in new pg_bitutils.c

2019-02-15 Thread Tom Lane
Alvaro Herrera writes: > I'm done with this stuff. Anybody feel free to run with it, but for a > barely noticeable performance improvement it's not going to be me. Sure, I'll pick it up. I agree it's probably a marginal performance change, but it seems a shame to give up when we were 80% of the

Re: pgsql: Fix compiler builtin usage in new pg_bitutils.c

2019-02-15 Thread Alvaro Herrera
On 2019-Feb-15, Tom Lane wrote: > Meh. I don't see why this entire function should exist if there > is nothing for it to do. I'm inclined to think that somewhere > there needs to be a symbol NEED_POPCOUNT_CHOOSING that is only > enabled if we have all three of HAVE__BUILTIN_POPCOUNT, nonempty >

Re: pgsql: Fix compiler builtin usage in new pg_bitutils.c

2019-02-15 Thread Tom Lane
Alvaro Herrera writes: > Hmm, this should fix the build, but I'm rushing out to lunch -- maybe > I'm missing something. > diff --git a/src/port/pg_bitutils.c b/src/port/pg_bitutils.c > index 97bfcebe4e1..e0198f3ab35 100644 > --- a/src/port/pg_bitutils.c > +++ b/src/port/pg_bitutils.c > @@ -90,9 +

Re: pgsql: Fix compiler builtin usage in new pg_bitutils.c

2019-02-15 Thread Alvaro Herrera
Hmm, this should fix the build, but I'm rushing out to lunch -- maybe I'm missing something. diff --git a/src/port/pg_bitutils.c b/src/port/pg_bitutils.c index 97bfcebe4e1..e0198f3ab35 100644 --- a/src/port/pg_bitutils.c +++ b/src/port/pg_bitutils.c @@ -90,9 +90,11 @@ pg_popcount_available(void)

pgsql: Fix compiler builtin usage in new pg_bitutils.c

2019-02-15 Thread Alvaro Herrera
Fix compiler builtin usage in new pg_bitutils.c Split out these new functions in three parts: one in a new file that uses the compiler builtin and gets compiled with the -mpopcnt compiler option if it exists; another one that uses the compiler builtin but not the compiler option; and finally the f