Re: call popcount32/64 directly on non-x86 platforms - Mailing list pgsql-hackers

From David Rowley
Subject Re: call popcount32/64 directly on non-x86 platforms
Date
Msg-id CAApHDvqNoBg0_yEW8fQQCMH0p=-TEZR1f-ZDJphKcifrKPmYsg@mail.gmail.com
Whole thread Raw
In response to Re: call popcount32/64 directly on non-x86 platforms  (David Rowley <dgrowleyml@gmail.com>)
Responses Re: call popcount32/64 directly on non-x86 platforms
Re: call popcount32/64 directly on non-x86 platforms
List pgsql-hackers
On Fri, 13 Aug 2021 at 01:28, David Rowley <dgrowleyml@gmail.com> wrote:
>
> On Fri, 13 Aug 2021 at 01:11, Alvaro Herrera <alvherre@alvh.no-ip.org> 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 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 does not have popcntq that we'll
always use pg_popcount64_slow, regardless if the machine that's
actually running the code has popcntq.

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.

David



pgsql-hackers by date:

Previous
From: Daniel Gustafsson
Date:
Subject: Re: [PATCH] OpenSSL: Mark underlying BIO with the appropriate type flags
Next
From: Peter Eisentraut
Date:
Subject: Re: Shared memory size computation oversight?