Re: use ARM intrinsics in pg_lfind32() where available - Mailing list pgsql-hackers

From John Naylor
Subject Re: use ARM intrinsics in pg_lfind32() where available
Date
Msg-id CAFBsxsEouaTwbmpqV+EW2=wFbhw2vHRe26NQTRcd0=NaOFDy7A@mail.gmail.com
Whole thread Raw
In response to Re: use ARM intrinsics in pg_lfind32() where available  (John Naylor <john.naylor@enterprisedb.com>)
Responses Re: use ARM intrinsics in pg_lfind32() where available
List pgsql-hackers
On Mon, Aug 29, 2022 at 11:25 AM John Naylor
<john.naylor@enterprisedb.com> wrote:
> +static inline bool
> +vector32_is_highbit_set(const Vector32 v)
> +{
> +#ifdef USE_SSE2
> + return (_mm_movemask_epi8(v) & 0x8888) != 0;
> +#endif
> +}
>
> I'm not sure why we need this function -- AFAICS it just adds more
> work on x86 for zero benefit. For our present application, can we just
> cast to Vector8 (for Arm's sake) and call the 8-bit version?

It turns out MSVC animal drongo doesn't like this cast -- on x86 they
are the same underlying type. Will look into that as more results come
in.

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



pgsql-hackers by date:

Previous
From: John Naylor
Date:
Subject: Re: use ARM intrinsics in pg_lfind32() where available
Next
From: Julien Rouhaud
Date:
Subject: Re: Schema variables - new implementation for Postgres 15