agora inbox for pgsql-committers@postgresql.org
help / color / mirror / Atom feedFrom: Nathan Bossart <nathan@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Remove switch statements in vector8_shift_{left,right}.
Date: Mon, 06 Jul 2026 16:40:43 +0000
Message-ID: <E1wgmNA-001cBU-02@gemulon.postgresql.org> (raw)
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(-)
Message-ID: <E1wgmNA-001cBU-02@gemulon.postgresql.org>
Permalink: ../E1wgmNA-001cBU-02@gemulon.postgresql.org/
Also on: postgresql.org/message-id/E1wgmNA-001cBU-02@gemulon.postgresql.org
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: nathan@postgresql.org, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Remove switch statements in vector8_shift_{left,right}.
In-Reply-To: <E1wgmNA-001cBU-02@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox