Re: remove switch statement in vector8_shift_{left,right}

From: John Naylor <johncnaylorls(at)gmail(dot)com>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: remove switch statement in vector8_shift_{left,right}
Date: 2026-07-02 05:28:36
Message-ID: CANWCAZZKd12kxi0J-PDFUc-Ph8NTeDcef8W+R4ZRo55sXkvmaw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jul 2, 2026 at 7:32 AM Nathan Bossart <nathandbossart(at)gmail(dot)com> wrote:
> In commit ec8719ccbf, I added a switch statement with all expected shift
> counts for vector8_shift_{left,right} because AArch64's vshlq_n_u32 and
> vshrq_n_u32 require an integer literal. I discovered that we can use
> vshlq_u32 instead for both cases, which avoids the need for the switch
> statement and compiles to the same machine code on recent gcc/clang.

Hmm! +1

--
John Naylor
Amazon Web Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Previous Message Ewan Young 2026-07-02 05:27:00 Re: Fix jsonpath .decimal() to honor silent mode