Use bitwise rotate functions in more places
authorJohn Naylor <john.naylor@postgresql.org>
Sun, 20 Feb 2022 06:22:08 +0000 (13:22 +0700)
committerJohn Naylor <john.naylor@postgresql.org>
Sun, 20 Feb 2022 06:22:08 +0000 (13:22 +0700)
commit4b35408f1ed59dd590f683ae0f015bbaf3b84d3d
treef0fbcde2e180f22114c14331512b8bcfacfcf5e6
parentd7a978601d4e469f1a8f19122c049bb25fd7f096
Use bitwise rotate functions in more places

There were a number of places in the code that used bespoke bit-twiddling
expressions to do bitwise rotation. While we've had pg_rotate_right32()
for a while now, we hadn't gotten around to standardizing on that. Do so
now. Since many potential call sites look more natural with the "left"
equivalent, add that function too.

Reviewed by Tom Lane and Yugo Nagata

Discussion:
https://www.postgresql.org/message-id/CAFBsxsH7c1LC0CGZ0ADCBXLHU5-%3DKNXx-r7tHYPAW51b2HK4Qw%40mail.gmail.com
src/backend/executor/execGrouping.c
src/backend/executor/nodeHash.c
src/backend/executor/nodeMemoize.c
src/backend/utils/adt/jsonb_util.c
src/backend/utils/adt/multirangetypes.c
src/backend/utils/adt/rangetypes.c
src/backend/utils/cache/catcache.c
src/common/hashfn.c
src/include/port/pg_bitutils.h