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

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: John Naylor <john(dot)naylor(at)enterprisedb(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Amit Khandekar <amitdkhan(dot)pg(at)gmail(dot)com>
Subject: Re: call popcount32/64 directly on non-x86 platforms
Date: 2021-08-12 13:33:06
Message-ID: CAApHDvqNoBg0_yEW8fQQCMH0p=-TEZR1f-ZDJphKcifrKPmYsg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 13 Aug 2021 at 01:28, David Rowley <dgrowleyml(at)gmail(dot)com> wrote:
>
> On Fri, 13 Aug 2021 at 01:11, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2021-08-12 13:34:27 Re: Shared memory size computation oversight?
Previous Message Daniel Gustafsson 2021-08-12 13:32:27 Re: [PATCH] OpenSSL: Mark underlying BIO with the appropriate type flags