diff --git a/src/strategies/avx2/encode_coding_tree-avx2.c b/src/strategies/avx2/encode_coding_tree-avx2.c index 9b793c18..adf2b2ed 100644 --- a/src/strategies/avx2/encode_coding_tree-avx2.c +++ b/src/strategies/avx2/encode_coding_tree-avx2.c @@ -26,18 +26,9 @@ #include "context.h" #include "encode_coding_tree-avx2.h" #include "encode_coding_tree.h" +#include "strategies/missing-intel-intrinsics.h" #include -// GCC headers apparently won't have this at all.. sigh -#ifndef _andn_u32 -// VS2015 headers apparently won't have this at all.. sigh -#ifdef __andn_u32 -#define _andn_u32(x, y) (__andn_u32((x), (y))) -#else -#define _andn_u32(x, y) ((~(x)) & (y)) -#endif // __andn_u32 -#endif // _andn_u32 - /* * NOTE: Unlike SSE/AVX comparisons that would return 11 or 00 for gt/lte, * this'll use 1x and 0x as bit patterns (x: garbage). A couple extra diff --git a/src/strategies/missing-intel-intrinsics.h b/src/strategies/missing-intel-intrinsics.h new file mode 100644 index 00000000..eff81866 --- /dev/null +++ b/src/strategies/missing-intel-intrinsics.h @@ -0,0 +1,21 @@ +#ifndef MISSING_INTEL_INTRINSICS_H_ +#define MISSING_INTEL_INTRINSICS_H_ + +#include + +// Old Visual Studio headers lack the bsrli variant +#ifndef _mm_bsrli_si128 + #define _mm_bsrli_si128(a, imm8) _mm_srli_si128((a), (imm8)) +#endif + +// GCC headers apparently won't have this at all.. sigh +#ifndef _andn_u32 + // VS2015 headers apparently won't have this at all.. sigh + #ifdef __andn_u32 + #define _andn_u32(x, y) (__andn_u32((x), (y))) + #else + #define _andn_u32(x, y) ((~(x)) & (y)) + #endif // __andn_u32 +#endif // _andn_u32 + +#endif diff --git a/src/strategies/sse41/reg_sad_pow2_widths-sse41.h b/src/strategies/sse41/reg_sad_pow2_widths-sse41.h index 166343d8..433265ec 100644 --- a/src/strategies/sse41/reg_sad_pow2_widths-sse41.h +++ b/src/strategies/sse41/reg_sad_pow2_widths-sse41.h @@ -21,8 +21,9 @@ #ifndef REG_SAD_POW2_WIDTHS_SSE41_H_ #define REG_SAD_POW2_WIDTHS_SSE41_H_ -#include #include "kvazaar.h" +#include "strategies/missing-intel-intrinsics.h" +#include static INLINE uint32_t reg_sad_w0(const kvz_pixel * const data1, const kvz_pixel * const data2, const int32_t height, const uint32_t stride1,