Re: call popcount32/64 directly on non-x86 platforms

2021-08-16 Thread John Naylor
I wrote: > On Thu, Aug 12, 2021 at 1:26 AM David Rowley wrote: > > Closer, but I don't see why there's any need to make the fast and slow > > functions external. It should be perfectly fine to keep them static. > > > > I didn't test the performance, but the attached works for me. > > Thanks for t

Re: call popcount32/64 directly on non-x86 platforms

2021-08-12 Thread John Naylor
On Thu, Aug 12, 2021 at 1:26 AM David Rowley wrote: > Closer, but I don't see why there's any need to make the fast and slow > functions external. It should be perfectly fine to keep them static. > > I didn't test the performance, but the attached works for me. Thanks for that! I still get a big

Re: call popcount32/64 directly on non-x86 platforms

2021-08-12 Thread Alvaro Herrera
On 2021-Aug-13, David Rowley wrote: > Maybe you saw that there's no such equivalent test when we set > HAVE_X86_64_POPCNTQ for MSVC on x86_64. The reason for that is that > we do the run-time test using cpuid. Yeah, that and also I mistook the two independent "ifdef" blocks for one block with an

Re: call popcount32/64 directly on non-x86 platforms

2021-08-12 Thread John Naylor
On Thu, Aug 12, 2021 at 9:33 AM David Rowley wrote: > Something there that might cause confusion is we do a configure check > to see if popcntq works and define HAVE_X86_64_POPCNTQ if it does. > I'm still a bit confused at why we bother doing that. Surely it just > means that if the build machine

Re: call popcount32/64 directly on non-x86 platforms

2021-08-12 Thread David Rowley
On Fri, 13 Aug 2021 at 01:28, David Rowley wrote: > > On Fri, 13 Aug 2021 at 01:11, Alvaro Herrera wrote: > > So when on MSVC, you don't have to check CPUID for support? > > That still needs to be checked in MSVC and as far as I can see it is > being properly checked. Something there that might

Re: call popcount32/64 directly on non-x86 platforms

2021-08-12 Thread David Rowley
On Fri, 13 Aug 2021 at 01:11, Alvaro Herrera wrote: > So when on MSVC, you don't have to check CPUID for support? That still needs to be checked in MSVC and as far as I can see it is being properly checked. David

Re: call popcount32/64 directly on non-x86 platforms

2021-08-12 Thread Alvaro Herrera
So when on MSVC, you don't have to check CPUID for support? -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "La primera ley de las demostraciones en vivo es: no trate de usar el sistema. Escriba un guión que no toque nada para no causar daños." (Jakob Nielsen)

Re: call popcount32/64 directly on non-x86 platforms

2021-08-11 Thread David Rowley
On Thu, 12 Aug 2021 at 14:02, John Naylor wrote: > > > On Wed, Aug 11, 2021 at 8:13 PM David Rowley wrote: > > > > On Thu, 12 Aug 2021 at 05:11, John Naylor > > wrote: > > > 0001 moves some declarations around so that "slow" popcount functions are > > > called directly on non-x86 platforms. >

Re: call popcount32/64 directly on non-x86 platforms

2021-08-11 Thread John Naylor
On Wed, Aug 11, 2021 at 8:13 PM David Rowley wrote: > > On Thu, 12 Aug 2021 at 05:11, John Naylor wrote: > > 0001 moves some declarations around so that "slow" popcount functions are called directly on non-x86 platforms. > > I was wondering if there was a reason that you didn't implement this > b

Re: call popcount32/64 directly on non-x86 platforms

2021-08-11 Thread David Rowley
On Thu, 12 Aug 2021 at 05:11, John Naylor wrote: > 0001 moves some declarations around so that "slow" popcount functions are > called directly on non-x86 platforms. I was wondering if there was a reason that you didn't implement this by just changing pg_popcount32 and pg_popcount64 to be actual

call popcount32/64 directly on non-x86 platforms

2021-08-11 Thread John Naylor
Currently, all platforms must indirect through a function pointer to call popcount on a word-sized input, even though we don't arrange for a fast implementation on non-x86 to make it worthwhile. 0001 moves some declarations around so that "slow" popcount functions are called directly on non-x86 pl