Re: vectorized CRC on ARM64

From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: John Naylor <johncnaylorls(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: vectorized CRC on ARM64
Date: 2026-04-01 15:24:40
Message-ID: ac04uCXJOPEAwE1Z@nathan
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Apr 01, 2026 at 06:48:10PM +0700, John Naylor wrote:
> I don't think appending +crypto would work everywhere IIUC -- if the
> packager set +crc in the CFLAGS, then CFLAGS_CRC="" so there is no
> existing -march to put it on, and the PMULL check would fail. Maybe
> that's okay if we call that out in the release notes, since that's
> probably rare. Then we could check both with and without +crypto
> tacked on.
>
> I tried appending the new -march value, and that works since last one
> wins. But that might have the same problem as above if the packager
> put something special in CFLAGS for -march, that would get wiped out
> by our new one.

The other idea I had was to always add +crypto in the existing tests
(unless we're not setting CFLAGS_CRC), and then to just do the PMULL check
with whatever CFLAGS_CRC is set to, not bothering to try different values.
That doesn't fix the problem you mentioned in the quoted text, but maybe
it's a little sturdier.

... or maybe we should just use __attribute__((target("..."))) for the
PMULL stuff. That wouldn't work well for clang versions before 16, but it
at least wouldn't regress anything. They just wouldn't get PMULL support.

--
nathan

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2026-04-01 15:33:04 Re: Do we still need MULE_INTERNAL?
Previous Message Antonin Houska 2026-04-01 15:16:58 Re: table AM option passing