From: Nathan Bossart <nathan@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Optimize vector8_has_le() on AArch64.
Date: Fri, 03 Oct 2025 19:03:40 +0000
Message-ID: <E1v4l47-001J80-2b@gemulon.postgresql.org> (raw)
Optimize vector8_has_le() on AArch64.
Presently, the SIMD implementation of this function uses unsigned
saturating subtraction to find bytes less than or equal to the
given value, which is a workaround for the lack of unsigned
comparison instructions on some architectures. However, Neon
offers vminvq_u8(), which returns the minimum (unsigned) value in
the vector. This commit adds a Neon-specific implementation that
uses vminvq_u8() to optimize vector8_has_le() on AArch64.
In passing, adjust the SSE2 implementation to use vector8_min() and
vector8_eq() to find values less than or equal to the given value.
This was the only use of vector8_ssub(), so it has been removed.
Reviewed-by: John Naylor <johncnaylorls@gmail.com>
Discussion: https://postgr.es/m/aNHDNDSHleq0ogC_%40nathan
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/f8f4afe751fc75e1d3093fa634934018f440c29c
Modified Files
--------------
src/include/port/simd.h | 37 ++++++++++---------------------------
1 file changed, 10 insertions(+), 27 deletions(-)
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: Optimize vector8_has_le() on AArch64.
In-Reply-To: <E1v4l47-001J80-2b@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 DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox