pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@lists.postgresql.org, Tom Lane <tgl@sss.pgh.pa.us>
Cc: Andrew Gierth <andrew@tao11.riddles.org.uk>
Cc: David Rowley <david.rowley@2ndquadrant.com>
Cc: Thomas Munro <thomas.munro@enterprisedb.com>
Subject: Re: Using POPCNT and other advanced bit manipulation instructions
Date: Wed, 13 Feb 2019 17:12:11 -0300
Message-ID: <20190213201211.GA5800@alvherre.pgsql> (raw)
In-Reply-To: <2F6CDF3B-08B9-4A15-ABDF-55D7F82AB76E@anarazel.de>

On 2019-Feb-13, Andres Freund wrote:

> Hi,
> 
> On February 13, 2019 8:40:14 PM GMT+01:00, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> >Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> >> I've pushed this now.  Let's see what the buildfarm has to say about
> >it.
> >
> >It's likely to be hard to tell, given the amount of pink from the Ryu
> >patch.  If Andrew is not planning to clean that up PDQ, I'd suggest
> >reverting that patch pending having some repairs for it.
> 
> I'd assume that breaking bit counting would cause distinct enough
> damage (compile time or crashes).

I was a bit surprised to find out that the assembly generated by
compiling the code in test for __builtin_foo() does not actually include
the calls being tested ... (they're only used to generate the value for
a static variable, and that gets optimized away); but then the comment
for the test does say that we're only testing that the compiler
understands the construct, so I suppose that's fine.  Also, we already
do that for bswap.

This "compiler explorer" tool is nice:

https://gcc.godbolt.org/#g:!((g:!((g:!((h:codeEditor,i:(j:1,source:'int+main(int+argc+,+char**+a...

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services




view thread (49+ messages)  latest in thread

Message-ID: <20190213201211.GA5800@alvherre.pgsql>
Permalink:  ../20190213201211.GA5800@alvherre.pgsql/
Also on:    postgresql.org/message-id/20190213201211.GA5800@alvherre.pgsql

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: alvherre@2ndquadrant.com, andres@anarazel.de, tgl@sss.pgh.pa.us, andrew@tao11.riddles.org.uk, david.rowley@2ndquadrant.com, thomas.munro@enterprisedb.com
  Subject: Re: Using POPCNT and other advanced bit manipulation instructions
  In-Reply-To: <20190213201211.GA5800@alvherre.pgsql>

* 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