bitscan forward/reverse on Windows

John Naylor <john.naylor@enterprisedb.com>

From: John Naylor <john.naylor@enterprisedb.com>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2023-01-25T01:42:44Z
Lists: pgsql-hackers

Attachments

Attached is a quick-and-dirty attempt to add MSVC support for the
rightmost/leftmost-one-pos functions.

0001 adds asserts to the existing coding.
0002 adds MSVC support. Tests pass on CI, but it's of course possible that
there is some bug that prevents hitting the fastpath. I've mostly used
the platform specific types, so some further cleanup might be needed.
0003 tries one way to reduce the duplication that arose in 0002. Maybe
there is a better way.

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

Commits

  1. Add MSVC support for pg_leftmost_one_pos32() and friends

  2. Add assert checking to pg_leftmost_one_pos32() and friends