Re: support for SSE2 intrinsics

Nathan Bossart <nathandbossart@gmail.com>

From: Nathan Bossart <nathandbossart@gmail.com>
To: John Naylor <john.naylor@enterprisedb.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-08-02T16:53:48Z
Lists: pgsql-hackers
On Tue, Aug 02, 2022 at 05:22:52PM +0700, John Naylor wrote:
> Given all this, the anti-climax is: it seems we can start with something
> like src/include/port/simd.h with:
> 
> #if (defined(__x86_64__) || defined(_M_AMD64))
> #include <emmintrin.h>
> #define USE_SSE2
> #endif
> 
> (plus a comment summarizing the above)
> 
> That we can include into other files, and would be the place to put helper
> functions. Thoughts?

+1

I did a bit of cross-checking, and AFAICT this is a reasonable starting
point.  emmintrin.h appears to be sufficient for one of my patches that
makes use of SSE2 instructions.  That being said, I imagine it'll be
especially important to keep an eye on the buildfarm when this change is
committed.

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



Commits

  1. Support SSE2 intrinsics where available