public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tom Lane <[email protected]>
To: Nathan Bossart <[email protected]>
Cc: John Naylor <[email protected]>
Cc: Ants Aasma <[email protected]>
Cc: [email protected]
Subject: Re: add AVX2 support to simd.h
Date: Tue, 02 Jan 2024 12:50:04 -0500
Message-ID: <[email protected]> (raw)
In-Reply-To: <20240102161123.GA955987@nathanxps13>
References: <20231129171526.GA857928@nathanxps13>
	<CANWCAZZHEHufYD7nPNX6sPZ1mHo+30qTiV5UPXL_evh-N=1n5g@mail.gmail.com>
	<20240102161123.GA955987@nathanxps13>

Nathan Bossart <[email protected]> writes:
> I'm tempted to propose that we move forward with this patch as-is after
> adding a buildfarm machine that compiles with -mavx2 or -march=x86-64-v3.
> There is likely still follow-up work to make these improvements more
> accessible, but I'm not sure that is a strict prerequisite here.

The patch needs better comments (as in, more than "none whatsoever").
It doesn't need to be much though, perhaps like

+#if defined(__AVX2__)
+
+/*
+ * When compiled with -mavx2 or allied options, we prefer AVX2 instructions.
+ */
+#include <immintrin.h>
+#define USE_AVX2
+typedef __m256i Vector8;
+typedef __m256i Vector32;

Also, do you really want to structure the header so that USE_SSE2
doesn't get defined?  In that case you are committing to provide
an AVX2 replacement every single place that there's USE_SSE2, which
doesn't seem like a great thing to require.  OTOH, maybe there's
no choice given than we need a different definition for Vector8 and
Vector32?

			regards, tom lane






view thread (10+ messages)  latest in thread

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: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: add AVX2 support to simd.h
  In-Reply-To: <[email protected]>

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

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