Re: [PATCH] Hex-coding optimizations using SVE on ARM.

From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: "Chiranmoy(dot)Bhattacharya(at)fujitsu(dot)com" <Chiranmoy(dot)Bhattacharya(at)fujitsu(dot)com>
Cc: "Devanga(dot)Susmitha(at)fujitsu(dot)com" <Devanga(dot)Susmitha(at)fujitsu(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, "Ragesh(dot)Hajela(at)fujitsu(dot)com" <Ragesh(dot)Hajela(at)fujitsu(dot)com>
Subject: Re: [PATCH] Hex-coding optimizations using SVE on ARM.
Date: 2025-01-13 16:18:03
Message-ID: Z4U8u5tNcy3oM79m@nathan
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jan 13, 2025 at 03:48:49PM +0000, Chiranmoy(dot)Bhattacharya(at)fujitsu(dot)com wrote:
> There is a 30% improvement using auto-vectorization.

It might be worth enabling auto-vectorization independently of any patches
that use intrinsics, then.

> Currently, it is assumed that all aarch64 machine support NEON, but for
> newer advanced SIMD like SVE (and AVX512 for x86) this assumption may not
> hold. We need a runtime check to be sure.. Using src/include/port/simd.h
> to abstract away these advanced SIMD implementations may be difficult.

Yeah, moving simd.h to anything beyond Neon/SSE2 might be tricky at the
moment. Besides the need for additional runtime checks, using wider
registers can mean that you need more data before an optimization takes
effect, which is effectively a regression. I ran into this when I tried to
add AVX2 support to simd.h [0]. My question about using simd.h was
ultimately about abstracting the relevant Neon/SSE2 instructions and using
those for hex_encode/decode(). If that's possible, I think it'd be
interesting to see how that compares to the SVE version.

[0] https://postgr.es/m/20231129171526.GA857928%40nathanxps13

--
nathan

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Melanie Plageman 2025-01-13 16:32:04 Re: Adjusting hash join memory limit to handle batch explosion
Previous Message Alvaro Herrera 2025-01-13 16:06:16 Re: Modern SHA2- based password hashes for pgcrypto