Use POPCNT on MSVC

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Use POPCNT on MSVC
Date: 2021-08-03 09:03:06
Message-ID: CAApHDvqL3cbbK=GzNcwzsNR9Gi+aUvTudKkC4XgnQfXirJ_oRQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Going by [1], it looks like we can use the __popcnt and __popcnt64
intrinsic functions on MSVC if the CPU supports POPCNT. We already
have code to check for that, we just need to enable it on MSVC.

The attached patch seems to be all that's needed.

David

[1] https://docs.microsoft.com/en-us/cpp/intrinsics/popcnt16-popcnt-popcnt64?view=msvc-140

Attachment Content-Type Size
use_popcnt_on_msvc.patch application/octet-stream 1.1 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2021-08-03 09:11:12 Re: Failed transaction statistics to measure the logical replication progress
Previous Message Peter Smith 2021-08-03 08:57:14 Re: [HACKERS] logical decoding of two-phase transactions