Re: Use POPCNT on MSVC

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: John Naylor <john(dot)naylor(at)enterprisedb(dot)com>
Cc: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Use POPCNT on MSVC
Date: 2021-08-09 00:31:16
Message-ID: CAApHDvrWb6vYOSPfCY+zzu7-eQJkwXXqLdkKnvYHP1u3rsMRWw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 5 Aug 2021 at 07:02, John Naylor <john(dot)naylor(at)enterprisedb(dot)com> wrote:
> > #if defined(_MSC_VER) && defined(_WIN64)
> > #define HAVE_X86_64_POPCNTQ
> > #endif
>
> That seems fine. I don't know PG can build with Arm on Windows, but for the cpuid to work, it seems safer to also check for __x86_64?

That's a good point. I've adjusted it to do #if defined(_MSC_VER) &&
defined(_M_AMD64).

I've attached a v2 patch which I think is more along the lines of what
you had in mind.

David

Attachment Content-Type Size
use_popcnt_on_msvc_v2.patch application/octet-stream 3.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message John Naylor 2021-08-09 00:58:07 Re: Use POPCNT on MSVC
Previous Message Mark Dilger 2021-08-08 22:33:06 Re: Another regexp performance improvement: skip useless paren-captures