Re: [PATCH] SVE popcount support

From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: John Naylor <johncnaylorls(at)gmail(dot)com>
Cc: "Chiranmoy(dot)Bhattacharya(at)fujitsu(dot)com" <Chiranmoy(dot)Bhattacharya(at)fujitsu(dot)com>, "Malladi, Rama" <ramamalladi(at)hotmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, "Ragesh(dot)Hajela(at)fujitsu(dot)com" <Ragesh(dot)Hajela(at)fujitsu(dot)com>, Salvatore Dipietro <dipiets(at)amazon(dot)com>, "Devanga(dot)Susmitha(at)fujitsu(dot)com" <Devanga(dot)Susmitha(at)fujitsu(dot)com>
Subject: Re: [PATCH] SVE popcount support
Date: 2025-03-27 03:38:42
Message-ID: Z-TIQlPTW1xkpIsN@nathan
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Mar 26, 2025 at 04:44:24PM -0500, Nathan Bossart wrote:
> IMHO these are acceptable results, at least for the use-cases I see in the
> tree. We might be able to minimize the difference between the Neon and SVE
> implementations on the low end with some additional code, but I'm really
> not sure if it's worth the effort.

I couldn't resist... I tried a variety of things (e.g., inlining the Neon
implementation to process the tail, jumping to the Neon implementation for
smaller inputs), and the only thing that seemed to be a clear win was to
add a 2-register block in the SVE implementations (like what is already
there for the Neon ones). In particular, that helps bring the Graviton3
SVE numbers closer to the Neon numbers for inputs between 8-16 8-byte
words.

I also noticed a silly mistake in 0003 that would cause us to potentially
skip part of the tail. That should be fixed now.

--
nathan

Attachment Content-Type Size
v10-0001-Rename-TRY_POPCNT_FAST-to-TRY_POPCNT_X86_64.patch text/plain 4.8 KB
v10-0002-Add-Neon-popcount-support.patch text/plain 10.2 KB
v10-0003-Add-SVE-popcount-support.patch text/plain 17.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David G. Johnston 2025-03-27 03:44:37 Re: support ALTER TABLE DROP EXPRESSION for virtual generated column
Previous Message wenhui qiu 2025-03-27 03:34:31 Re: GSoC 2025 - Looking for Beginner-Friendly PostgreSQL Project