Implement _mm256_insert_epi32 and extract pseudo-ops

Visual Studio headers apparently lack these guys
This commit is contained in:
Pauli Oikkonen 2019-09-05 17:58:34 +03:00
parent 4e94d60552
commit 55529decd5
2 changed files with 14 additions and 0 deletions

View file

@ -23,6 +23,9 @@
#if COMPILE_INTEL_AVX2
#include <immintrin.h>
// Use a couple generic functions from here as a worst-case fallback
#include "strategies/generic/sao_shared_generics.h"
#include "strategies/missing-intel-intrinsics.h"
#include "cu.h"
#include "encoder.h"
#include "encoderstate.h"

View file

@ -18,4 +18,15 @@
#endif // __andn_u32
#endif // _andn_u32
// Some Visual Studio headers apparently lack these pseudoinstructions
#if COMPILE_INTEL_AVX2
#ifndef _mm256_insert_epi32
#define _mm256_insert_epi32(a, i, index) (_mm256_blend_epi32((a), _mm256_set1_epi32(i), (1 << (index))))
#endif
#ifndef _mm256_extract_epi32
#define _mm256_extract_epi32(a, index) (_mm_extract_epi32(_mm256_extracti128_si256((a), (index) >> 2), (index) & 3))
#endif
#endif
#endif