Re: Add RISC-V Zbb popcount optimization

From: "Greg Burd" <greg(at)burd(dot)me>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: "Nathan Bossart" <nathandbossart(at)gmail(dot)com>, "John Naylor" <johncnaylorls(at)gmail(dot)com>, "Andrew Dunstan" <andrew(at)dunslane(dot)net>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Andres Freund" <andres(at)anarazel(dot)de>
Subject: Re: Add RISC-V Zbb popcount optimization
Date: 2026-06-08 17:50:58
Message-ID: 552c4214-59f6-4e3b-83f2-c3f1d60f74d8@app.fastmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On Mon, Jun 8, 2026, at 1:45 PM, Greg Burd wrote:
> Hello,
>
> The attached patch addresses the RISC-V instability when compiled with
> Clang < 22 related to vectorization by disabling that feature in during
> configuration. This fix is verified on greenfly which now passes tests
> given that it is now compiled with Clang 22.
>
> IMO, given that this impacts at least one important thing in a silent
> and broken way it feels like something we should adopt in v19 and not
> wait.
>
> best.
>
> -greg
>
> Attachments:
> * v5-0001-Disable-auto-vectorization-on-RISC-V-with-Clang-older-than-22.patch

I almost forgot that this thread started off about optimizations for RISC-V, so I'll re-attach those there now along with the identical patch from v5.

Ideally all three could make it into v19, the RISC-V platform isn't huge but it is expanding in the server market quickly.

best.

-greg

Attachment Content-Type Size
v6-0001-Add-RISC-V-popcount-using-Zbb-extension.patch text/x-patch 11.4 KB
v6-0002-Add-RISC-V-CRC32C-using-the-Zbc-extension.patch text/x-patch 19.3 KB
v6-0003-Disable-auto-vectorization-on-RISC-V-with-Clang-o.patch text/x-patch 4.6 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Álvaro Herrera 2026-06-08 18:03:35 Re: NULL pointer dereference in syslogger with load_libraries() and -DEXEC_BACKEND at startup
Previous Message Greg Burd 2026-06-08 17:45:05 Re: Add RISC-V Zbb popcount optimization