Re: Using POPCNT and other advanced bit manipulation instructions
От
Tom Lane
Тема
Re: Using POPCNT and other advanced bit manipulation instructions
Дата
Msg-id
26998.1550097202@sss.pgh.pa.us
Ответ на
Re: Using POPCNT and other advanced bit manipulation instructions (Alvaro Herrera)
Список
Дерево обсуждения
Using POPCNT and other advanced bit manipulation instructions David Rowley <david.rowley@2ndquadrant.com>
Re: Using POPCNT and other advanced bit manipulation instructions Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Using POPCNT and other advanced bit manipulation instructions Michael Paquier <michael@paquier.xyz>
Re: Using POPCNT and other advanced bit manipulation instructions David Rowley <david.rowley@2ndquadrant.com>
Re: Using POPCNT and other advanced bit manipulation instructions Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Using POPCNT and other advanced bit manipulation instructions Tom Lane <tgl@sss.pgh.pa.us>
Re: Using POPCNT and other advanced bit manipulation instructions Andres Freund <andres@anarazel.de>
Re: Using POPCNT and other advanced bit manipulation instructions Tom Lane <tgl@sss.pgh.pa.us>
Re: Using POPCNT and other advanced bit manipulation instructions Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Using POPCNT and other advanced bit manipulation instructions Andrew Gierth <andrew@tao11.riddles.org.uk>
Re: Using POPCNT and other advanced bit manipulation instructions Andrew Gierth <andrew@tao11.riddles.org.uk>
Re: Using POPCNT and other advanced bit manipulation instructions Andrew Gierth <andrew@tao11.riddles.org.uk>
Re: Using POPCNT and other advanced bit manipulation instructions Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Using POPCNT and other advanced bit manipulation instructions Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Using POPCNT and other advanced bit manipulation instructions Tom Lane <tgl@sss.pgh.pa.us>
Re: Using POPCNT and other advanced bit manipulation instructions Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Using POPCNT and other advanced bit manipulation instructions Tom Lane <tgl@sss.pgh.pa.us>
Re: Using POPCNT and other advanced bit manipulation instructions Tom Lane <tgl@sss.pgh.pa.us>
Re: Using POPCNT and other advanced bit manipulation instructions Thomas Munro <thomas.munro@enterprisedb.com>
Re: Using POPCNT and other advanced bit manipulation instructions Tom Lane <tgl@sss.pgh.pa.us>
Re: Using POPCNT and other advanced bit manipulation instructions Tom Lane <tgl@sss.pgh.pa.us>
Re: Using POPCNT and other advanced bit manipulation instructions Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Using POPCNT and other advanced bit manipulation instructions Andres Freund <andres@anarazel.de>
Re: Using POPCNT and other advanced bit manipulation instructions Tom Lane <tgl@sss.pgh.pa.us>
Re: Using POPCNT and other advanced bit manipulation instructions Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
Re: Using POPCNT and other advanced bit manipulation instructions Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Using POPCNT and other advanced bit manipulation instructions Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Using POPCNT and other advanced bit manipulation instructions Tom Lane <tgl@sss.pgh.pa.us>
Re: Using POPCNT and other advanced bit manipulation instructions Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Using POPCNT and other advanced bit manipulation instructions Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Using POPCNT and other advanced bit manipulation instructions Tom Lane <tgl@sss.pgh.pa.us>
Re: Using POPCNT and other advanced bit manipulation instructions Andres Freund <andres@anarazel.de>
Re: Using POPCNT and other advanced bit manipulation instructions Tom Lane <tgl@sss.pgh.pa.us>
Re: Using POPCNT and other advanced bit manipulation instructions Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Using POPCNT and other advanced bit manipulation instructions Tom Lane <tgl@sss.pgh.pa.us>
Re: Using POPCNT and other advanced bit manipulation instructions Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Using POPCNT and other advanced bit manipulation instructions Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Using POPCNT and other advanced bit manipulation instructions Tom Lane <tgl@sss.pgh.pa.us>
Re: Using POPCNT and other advanced bit manipulation instructions Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Using POPCNT and other advanced bit manipulation instructions Gavin Flower <GavinFlower@archidevsys.co.nz>
Re: Using POPCNT and other advanced bit manipulation instructions Tom Lane <tgl@sss.pgh.pa.us>
Re: Using POPCNT and other advanced bit manipulation instructions Andrew Gierth <andrew@tao11.riddles.org.uk>
Re: Using POPCNT and other advanced bit manipulation instructions Gavin Flower <GavinFlower@archidevsys.co.nz>
Re: Using POPCNT and other advanced bit manipulation instructions David Rowley <david.rowley@2ndquadrant.com>
Re: Using POPCNT and other advanced bit manipulation instructions Dmitry Dolgov <9erthalion6@gmail.com>
Re: Using POPCNT and other advanced bit manipulation instructions David Rowley <david.rowley@2ndquadrant.com>
Re: Using POPCNT and other advanced bit manipulation instructions Dmitry Dolgov <9erthalion6@gmail.com>
Re: Using POPCNT and other advanced bit manipulation instructions Jose Luis Tallon <jltallon@adv-solutions.net>
Re: Using POPCNT and other advanced bit manipulation instructions David Rowley <david.rowley@2ndquadrant.com>
Alvaro Herrera writes:
> and we have defined pg_popcount64() like this:
> static int
> pg_popcount64_sse42(uint64 word)
> {
> return __builtin_popcountl(word);
> }
That is clearly completely broken.
> If that's correct, then I think we need something like this patch. But
> it makes me wonder whether we need a configure test for
> __builtin_popcountll() and friends. I wonder if there's any compiler
> that implements __builtin_popcountl() but not __builtin_popcountll() ...
> and if not, then the test for __builtin_popcountl() should be removed,
> and have everything rely on the one for __builtin_popcount().
AFAICS, this is a gcc-ism, and it looks like they've probably had
all width variants for the same amount of time. I'd take out the
test for __builtin_popcountl(), and assume that testing for
__builtin_popcount() is sufficient until proven differently.
regards, tom lane
В списке pgsql-hackers по дате отправления
От: Alvaro Herrera
Дата:
От: Tom Lane
Дата: