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

From: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
To: John Naylor <john(dot)naylor(at)enterprisedb(dot)com>
Cc: Joel Jacobson <joel(at)compiler(dot)org>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Use 128-bit math to accelerate numeric division, when 8 < divisor digits <= 16
Date: 2023-01-23 12:02:52
Message-ID: CAEZATCXKiVcVprJVMLBB7V34ZLUsbCixdwW2SXGJ_DHOO6Dm6Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 23 Jan 2023 at 05:06, John Naylor <john(dot)naylor(at)enterprisedb(dot)com> wrote:
>
> 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
>

Thanks, that's a very useful reference.

(And I do indeed have one of those CPUs, which explains what I was seeing.)

Regards,
Dean

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dean Rasheed 2023-01-23 12:04:58 Re: [PATCH] Use 128-bit math to accelerate numeric division, when 8 < divisor digits <= 16
Previous Message Daniel Gustafsson 2023-01-23 11:43:41 Re: TAP output format in pg_regress