Re: [PATCH] Use 128-bit math to accelerate numeric division, when 8 < divisor digits <= 16

Поиск
Список
Период
Сортировка
От John Naylor
Тема Re: [PATCH] Use 128-bit math to accelerate numeric division, when 8 < divisor digits <= 16
Дата
Msg-id CAFBsxsHgygbSn0fc=LQgsQyjaR=EkGFJMJ4-sR-Styjgjbc3RA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [PATCH] Use 128-bit math to accelerate numeric division, when 8 < divisor digits <= 16  ("Joel Jacobson" <joel@compiler.org>)
Ответы Re: [PATCH] Use 128-bit math to accelerate numeric division, when 8 < divisor digits <= 16  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Список pgsql-hackers

On Sun, Jan 22, 2023 at 10:42 PM Joel Jacobson <joel@compiler.org> wrote:

> I did write the code like you suggest first, but changed it,
> since I realised the extra "else if" needed could be eliminated,
> and thought div_var_int64() wouldn't be slower than div_var_int() since
> I thought 64-bit instructions in general are as fast as 32-bit instructions,
> on 64-bit platforms.

According to Agner's instruction tables [1], integer division on Skylake (for example) has a latency of 26 cycles for 32-bit operands, and 42-95 cycles for 64-bit.

[1] https://www.agner.org/optimize/instruction_tables.pdf

--
John Naylor
EDB: http://www.enterprisedb.com

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

Предыдущее
От: "Hayato Kuroda (Fujitsu)"
Дата:
Сообщение: RE: [Proposal] Add foreign-server health checks infrastructure
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Add a new pg_walinspect function to extract FPIs from WAL records