pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nathan Bossart <nathandbossart@gmail.com>
To: Chiranmoy.Bhattacharya@fujitsu.com <Chiranmoy.Bhattacharya@fujitsu.com>
Cc: Devanga.Susmitha@fujitsu.com <Devanga.Susmitha@fujitsu.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Cc: Ragesh.Hajela@fujitsu.com <Ragesh.Hajela@fujitsu.com>
Subject: Re: [PATCH] Hex-coding optimizations using SVE on ARM.
Date: Mon, 13 Jan 2025 10:18:03 -0600
Message-ID: <Z4U8u5tNcy3oM79m@nathan> (raw)
In-Reply-To: <TY2PR01MB2667B294A9D2556C05BE02A0971F2@TY2PR01MB2667.jpnprd01.prod.outlook.com>
References: <OSZPR01MB8499D4884C4541159FA00ECC8B132@OSZPR01MB8499.jpnprd01.prod.outlook.com>
	<Z4AUr-Y-TPaqtg0y@nathan>
	<OSBPR01MB26648F7B60A543069C75EC43971C2@OSBPR01MB2664.jpnprd01.prod.outlook.com>
	<Z4E-5oQGux-2R4iL@nathan>
	<Z4GHNfhRKuA0r_Wn@nathan>
	<TY2PR01MB2667B294A9D2556C05BE02A0971F2@TY2PR01MB2667.jpnprd01.prod.outlook.com>

On Mon, Jan 13, 2025 at 03:48:49PM +0000, Chiranmoy.Bhattacharya@fujitsu.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





view thread (48+ messages)  latest in thread

Message-ID: <Z4U8u5tNcy3oM79m@nathan>
Permalink:  ../Z4U8u5tNcy3oM79m@nathan/
Also on:    postgresql.org/message-id/Z4U8u5tNcy3oM79m@nathan

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: nathandbossart@gmail.com, Chiranmoy.Bhattacharya@fujitsu.com, Devanga.Susmitha@fujitsu.com, Ragesh.Hajela@fujitsu.com
  Subject: Re: [PATCH] Hex-coding optimizations using SVE on ARM.
  In-Reply-To: <Z4U8u5tNcy3oM79m@nathan>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox