Re: Using POPCNT and other advanced bit manipulation instructions

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Using POPCNT and other advanced bit manipulation instructions
Дата
Msg-id 20190215002208.GA25042@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: Using POPCNT and other advanced bit manipulation instructions  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 2019-Feb-14, Tom Lane wrote:

> I think we need a clean test for __builtin_popcount(), and to be willing
> to use it if available, independently of -mpopcnt.  Then separately we
> should test to see if -mpopcnt works, probably with the same
> infrastructure we use for checking for other compiler flags, viz
> 
>    # Optimization flags for specific files that benefit from vectorization
>    PGAC_PROG_CC_VAR_OPT(CFLAGS_VECTOR, [-funroll-loops])
>    PGAC_PROG_CC_VAR_OPT(CFLAGS_VECTOR, [-ftree-vectorize])
> +  # Optimization flags for bit-twiddling
> +  PGAC_PROG_CC_VAR_OPT(CFLAGS_POPCNT, [-mpopcnt])
>    # We want to suppress clang's unhelpful unused-command-line-argument warnings
> 
> Then the correct test to see if we want to build pg_popcount.c (BTW,
> please pick a less generic name for that) and the choose function
> is whether we have *both* HAVE__BUILTIN_POPCOUNT and nonempty
> CFLAGS_POPCNT.

Yeah, this works.  I'll post the patch tomorrow.

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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andrew Gierth
Дата:
Сообщение: Re: Ryu floating point output patch
Следующее
От: Kyotaro HORIGUCHI
Дата:
Сообщение: Re: pg_basebackup ignores the existing data directory permissions