Re: autovectorize page checksum code included elsewhere

From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: John Naylor <johncnaylorls(at)gmail(dot)com>
Cc: Ants Aasma <ants(at)cybertec(dot)at>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: autovectorize page checksum code included elsewhere
Date: 2023-11-23 16:51:09
Message-ID: 20231123165109.GA3889227@nathanxps13
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Nov 23, 2023 at 05:50:48PM +0700, John Naylor wrote:
> On Thu, Nov 23, 2023 at 1:49 AM Nathan Bossart <nathandbossart(at)gmail(dot)com> wrote:
>> One half-formed idea I have is to introduce some sort of ./configure flag
>> that enables all the newer instructions that your CPU understands.
>
> That's not doable,

It's not?

> but we should consider taking advantage of
> x86-64-v2, which RedHat 9 builds with. That would allow inlining CRC
> and popcount there.

Maybe we have something like --with-isa-level where you can specify
x86-64-v[1-4] or "auto" to mean "build whatever the current machine can
handle." I can imagine packagers requiring v2 these days (it's probably
worth asking them), and that would not only allow compiling in SSE 4.2 on
many more machines, but it would also open up a path to supporting
AVX2/AVX512 and beyond.

> Not sure how to detect that easily.

I briefly looked around and didn't see a portable way to do so. We might
have to exhaustively check the features, which doesn't seem like it'd be
too bad for x86_64, but I haven't looked too closely at other
architectures.

--
Nathan Bossart
Amazon Web Services: https://aws.amazon.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Matthias van de Meent 2023-11-23 17:16:31 Questions regarding Index AMs and natural ordering
Previous Message Tomas Vondra 2023-11-23 16:45:34 Re: undetected deadlock in ALTER SUBSCRIPTION ... REFRESH PUBLICATION