SIMD. MSVC compiler

This commit is contained in:
Alexander 2020-01-26 14:30:57 +03:00 committed by Alexander Karpinsky
parent 1e70975dc1
commit 000dafeb6d
2 changed files with 6 additions and 1 deletions

View File

@ -9,6 +9,11 @@
#include "Python.h" #include "Python.h"
/* Microsoft compiler doesn't limit intrinsics for an architecture.
This macro is set only on x86 and means SSE2 and above including AVX2. */
#if defined(_M_X64) || _M_IX86_FP == 2
#define __SSE4_2__
#endif
#if defined(__SSE4_2__) #if defined(__SSE4_2__)
#include <emmintrin.h> #include <emmintrin.h>
#include <mmintrin.h> #include <mmintrin.h>

View File

@ -52,6 +52,6 @@ mm_cvtepu8_epi32(void *ptr) {
#if defined(__AVX2__) #if defined(__AVX2__)
static __m256i inline static __m256i inline
mm256_cvtepu8_epi32(void *ptr) { mm256_cvtepu8_epi32(void *ptr) {
return _mm256_cvtepu8_epi32(_mm_cvtsi64_si128(*(int64_t *) ptr)); return _mm256_cvtepu8_epi32(_mm_loadl_epi64((__m128i *) ptr));
} }
#endif #endif