Re: Use compiler intrinsics for bit ops in hash

John Naylor <john.naylor@2ndquadrant.com>

From: John Naylor <john.naylor@2ndquadrant.com>
To: David Fetter <david@fetter.org>
Cc: Jesse Zhang <sbjesse@gmail.com>, PostgreSQL Development <pgsql-hackers@postgresql.org>
Date: 2020-02-27T06:41:49Z
Lists: pgsql-hackers
On Thu, Feb 27, 2020 at 1:56 PM David Fetter <david@fetter.org> wrote:
> [v6 set]

Hi David,

In 0002, the pg_bitutils functions have a test (input > 0), and the
new callers ceil_log2_* and next_power_of_2_* have asserts. That seems
backward to me. I imagine some callers of bitutils will already know
the value > 0, and it's probably good to keep that branch out of the
lowest level functions. What do you think?

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



Commits

  1. Modify additional power 2 calculations to use new helper functions

  2. Modify various power 2 calculations to use new helper functions

  3. Add functions to calculate the next power of 2

  4. Move src/backend/utils/hash/hashfn.c to src/common