pgsql: Remove switch statements in vector8_shift_{left,right}. - Mailing list pgsql-committers

From Nathan Bossart
Subject pgsql: Remove switch statements in vector8_shift_{left,right}.
Date
Msg-id E1wgmNA-001cBU-02@gemulon.postgresql.org
Whole thread
List pgsql-committers
Remove switch statements in vector8_shift_{left,right}.

In commit ec8719ccbf, I added switch statements with all expected
shift counts to vector8_shift_{left,right} because vshlq_n_u32()
and vshrq_n_u32() require integer literals.  But we can use
vshlq_u32() instead for both cases, which does not require an
integer literal, thereby avoiding the need for the switch
statements.  This compiles to the same machine code on newer
versions of popular compilers.

Reviewed-by: John Naylor <johncnaylorls@gmail.com>
Discussion: https://postgr.es/m/akWxkA-mszMm57cV%40nathan

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/763ee7ea00b02592b5fb9572d77b82a1f6f052b9

Modified Files
--------------
src/include/port/simd.h | 29 +++--------------------------
1 file changed, 3 insertions(+), 26 deletions(-)


pgsql-committers by date:

Previous
From: Peter Eisentraut
Date:
Subject: pgsql: Remove apparent support for SECURITY LABEL ON PROPERTY GRAPH
Next
From: Robert Haas
Date:
Subject: pgsql: Prevent satisfies_hash_partition from crashing with VARIADIC NUL