pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add basic support for using the POPCNT and SSE4.2s LZCNT opcodes
Date: Wed, 13 Feb 2019 19:16:37 +0000
Message-ID: <E1gu01N-0005jI-1p@gemulon.postgresql.org> (raw)

Add basic support for using the POPCNT and SSE4.2s LZCNT opcodes

These opcodes have been around in the AMD world since 2007, and 2008 in
the case of intel.  They're supported in GCC and Clang via some __builtin
macros.  The opcodes may be unavailable during runtime, in which case we
fall back on a C-based implementation of the code.  In order to get the
POPCNT instruction we must pass the -mpopcnt option to the compiler.  We
do this only for the pg_bitutils.c file.

David Rowley (with fragments taken from a patch by Thomas Munro)

Discussion: https://postgr.es/m/CAKJS1f9WTAGG1tPeJnD18hiQW5gAk59fQ6WK-vfdAKEHyRg2RA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/711bab1e4d19b5c9967328315a542d93386b1ac5

Modified Files
--------------
config/c-compiler.m4                    | 116 +++++++
configure                               | 155 ++++++++++
configure.in                            |   8 +
src/Makefile.global.in                  |   1 +
src/backend/access/heap/visibilitymap.c |  73 ++---
src/backend/lib/bloomfilter.c           |  15 +-
src/backend/nodes/bitmapset.c           | 131 ++------
src/include/pg_config.h.in              |  18 ++
src/include/pg_config.h.win32           |  18 ++
src/include/port/pg_bitutils.h          |  26 ++
src/port/Makefile                       |   5 +-
src/port/pg_bitutils.c                  | 516 ++++++++++++++++++++++++++++++++
src/tools/msvc/Mkvcbuild.pm             |   1 +
13 files changed, 914 insertions(+), 169 deletions(-)



Message-ID: <E1gu01N-0005jI-1p@gemulon.postgresql.org>
Permalink:  ../E1gu01N-0005jI-1p@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1gu01N-0005jI-1p@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: alvherre@alvh.no-ip.org
  Subject: Re: pgsql: Add basic support for using the POPCNT and SSE4.2s LZCNT opcodes
  In-Reply-To: <E1gu01N-0005jI-1p@gemulon.postgresql.org>
  References: <E1gu01N-0005jI-1p@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox