summaryrefslogtreecommitdiffstats
path: root/third_party/aom/aom_ports/msvc.h
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/aom/aom_ports/msvc.h')
-rw-r--r--third_party/aom/aom_ports/msvc.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/third_party/aom/aom_ports/msvc.h b/third_party/aom/aom_ports/msvc.h
index 2d3ab9b65..5a41d29d2 100644
--- a/third_party/aom/aom_ports/msvc.h
+++ b/third_party/aom/aom_ports/msvc.h
@@ -43,5 +43,25 @@ static INLINE long lroundf(float x) {
}
#endif // _MSC_VER < 1800
+#if HAVE_AVX
+#include <immintrin.h>
+// Note:
+// _mm256_insert_epi16 intrinsics is available from vs2017.
+// We define this macro for vs2015 and earlier. The
+// intrinsics used here are in vs2015 document:
+// https://msdn.microsoft.com/en-us/library/hh977022.aspx
+// Input parameters:
+// a: __m256i,
+// d: int16_t,
+// indx: imm8 (0 - 15)
+#if _MSC_VER <= 1900
+#define _mm256_insert_epi16(a, d, indx) \
+ _mm256_insertf128_si256( \
+ a, \
+ _mm_insert_epi16(_mm256_extractf128_si256(a, indx >> 3), d, indx % 8), \
+ indx >> 3)
+#endif // _MSC_VER <= 1900
+#endif // HAVE_AVX
+
#endif // _MSC_VER
#endif // AOM_PORTS_MSVC_H_