From 125aff11b7587a55d5a94b1337e44cbc68655c0b Mon Sep 17 00:00:00 2001 From: trav90 Date: Thu, 18 Oct 2018 21:56:49 -0500 Subject: Fix aom compile errors with VS2015 Import BUG=aomedia:900 --- third_party/aom/aom_ports/msvc.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'third_party/aom/aom_ports/msvc.h') 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 +// 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_ -- cgit v1.2.3