Re: Add RISC-V Zbb popcount optimization

From: Andres Freund <andres(at)anarazel(dot)de>
To: Greg Burd <greg(at)burd(dot)me>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add RISC-V Zbb popcount optimization
Date: 2026-03-21 18:36:31
Message-ID: fnrwgvtglac54qgzkjquppcuxj4kjhxcroiemgnlsdick6cehy@l7bnbja7mn4b
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2026-03-21 12:54:10 -0400, Greg Burd wrote:
> Attached is a small patch that enables hardware popcount on RISC-V when
> available and also sets the arch flag to 'rv64gc_zbb' flag when appropriate.

Maybe I'm missing something: How is the latter approach safe without a runtime
check? Just because it compiled on the build machine with -march=rv64gc_zbb
added doesn't mean it runs on either the build machine or any other machine?

If this worked, the compiler could just always specify -march=rv64gc_zbb, no?

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Burd 2026-03-21 18:39:31 Re: Trying out <stdatomic.h>
Previous Message Tom Lane 2026-03-21 18:23:55 Re: pg_waldump: support decoding of WAL inside tarfile