Define headers

This commit is contained in:
Jamaika1 2024-11-15 11:46:27 +01:00 committed by GitHub
parent 6999e44841
commit 440dfcd253
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3,6 +3,7 @@
#include <immintrin.h>
#ifndef __OPTIMIZE__
// Old Visual Studio headers lack the bsrli variant
#ifndef _mm_bsrli_si128
#define _mm_bsrli_si128(a, imm8) _mm_srli_si128((a), (imm8))
@ -20,9 +21,11 @@
// Some Visual Studio headers apparently lack these pseudoinstructions
#if COMPILE_INTEL_AVX2
#ifdef __AVX512F__
#ifndef _mm256_bsrli_epi128
#define _mm256_bsrli_epi128(a, imm8) _mm256_srli_si256((a), (imm8))
#endif
#endif
#ifndef _mm256_insert_epi32
#define _mm256_insert_epi32(a, i, index) (_mm256_blend_epi32((a), _mm256_set1_epi32(i), (1 << (index))))
#endif
@ -31,5 +34,6 @@
#define _mm256_extract_epi32(a, index) (_mm_extract_epi32(_mm256_extracti128_si256((a), (index) >> 2), (index) & 3))
#endif
#endif
#endif // __OPTIMIZE__
#endif