Re: vectorized CRC on ARM64

From: John Naylor <johncnaylorls(at)gmail(dot)com>
To: Haibo Yan <tristan(dot)yim(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: vectorized CRC on ARM64
Date: 2026-03-22 05:26:24
Message-ID: CANWCAZbDw+ffLFn=qbz6-oZCouY3ztd1wJJiFouHxXwbjkb4Fg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Mar 19, 2026 at 12:17 AM Haibo Yan <tristan(dot)yim(at)gmail(dot)com> wrote:
>
> On Tue, Mar 17, 2026 at 11:52 PM John Naylor <johncnaylorls(at)gmail(dot)com> wrote:

>> I don't know if that's relevant for current server hardware, so it
>> could be pointless. I'm personally not a fan of inline assembly, but I
>> also didn't yet want to put in the effort to alter generated code. I
>> don't think it would be very hard to do, however.
>
>
> Thanks, that makes sense as an explanation for why the inline asm is there today. But it also sounds like this is more of a temporary implementation choice than a conclusion that intrinsics are unsuitable.

I can see how my words imply that, but after a moment's thought I
still don't want to put in that effort without a good reason. For
starters, what I said above about "not very hard" may be wishful
thinking.

> If so, I wonder whether it would be better to treat an intrinsics-based version as the preferred end state unless benchmarks show a clear regression.

To meet your criterion, we'd not only have to rewrite it correctly,
we'd have to test on multiple vendors of non-Apple hardware and
multiple compiler vendors/versions (at least where the binary output
is different) to prove we haven't caused a regression. I wouldn't
recommend anyone to accept that challenge as stated, since the
risk/reward ratio is just not favorable. Especially considering we're
2 1/2 weeks away from feature freeze.

--
John Naylor
Amazon Web Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2026-03-22 06:50:06 Re: Fix uninitialized xl_running_xacts padding
Previous Message Tatsuo Ishii 2026-03-22 05:23:26 Re: Row pattern recognition