Re: add AVX2 support to simd.h
От | Tom Lane |
---|---|
Тема | Re: add AVX2 support to simd.h |
Дата | |
Msg-id | 4105101.1704217804@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: add AVX2 support to simd.h (Nathan Bossart <nathandbossart@gmail.com>) |
Ответы |
Re: add AVX2 support to simd.h
|
Список | pgsql-hackers |
Nathan Bossart <nathandbossart@gmail.com> 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
В списке pgsql-hackers по дате отправления: