forked from python-pillow/Pillow
-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
46 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,46 @@ | ||
/* 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 __SSE2__ | ||
/* However, Microsoft compiler set __AVX2__ if /arch:AVX2 option is set */ | ||
#ifdef __AVX2__ | ||
#define __SSE4_2__ | ||
#endif | ||
#define __SSE2__ | ||
/* However, Microsoft compiler set __AVX2__ if /arch:AVX2 option is set */ | ||
#ifdef __AVX2__ | ||
#define __SSE4_2__ | ||
#endif | ||
#endif | ||
|
||
/* For better readability */ | ||
#ifdef __SSE4_2__ | ||
#define __SSE4__ | ||
#define __SSE4__ | ||
#endif | ||
|
||
#ifdef __SSE2__ | ||
#include <mmintrin.h> // MMX | ||
#include <xmmintrin.h> // SSE | ||
#include <emmintrin.h> // SSE2 | ||
#include <mmintrin.h> // MMX | ||
#include <xmmintrin.h> // SSE | ||
#include <emmintrin.h> // SSE2 | ||
#endif | ||
#ifdef __SSE4__ | ||
#include <pmmintrin.h> // SSE3 | ||
#include <tmmintrin.h> // SSSE3 | ||
#include <smmintrin.h> // SSE4.1 | ||
#include <nmmintrin.h> // SSE4.2 | ||
#include <pmmintrin.h> // SSE3 | ||
#include <tmmintrin.h> // SSSE3 | ||
#include <smmintrin.h> // SSE4.1 | ||
#include <nmmintrin.h> // SSE4.2 | ||
#endif | ||
#ifdef __AVX2__ | ||
#include <immintrin.h> // AVX, AVX2 | ||
#include <immintrin.h> // AVX, AVX2 | ||
#endif | ||
#ifdef __aarch64__ | ||
#include <arm_neon.h> // ARM NEON | ||
#include <arm_neon.h> // ARM NEON | ||
#endif | ||
|
||
#ifdef __SSE4__ | ||
static __m128i inline | ||
static inline __m128i | ||
mm_cvtepu8_epi32(void *ptr) { | ||
return _mm_cvtepu8_epi32(_mm_cvtsi32_si128(*(INT32 *) ptr)); | ||
return _mm_cvtepu8_epi32(_mm_cvtsi32_si128(*(INT32 *)ptr)); | ||
} | ||
#endif | ||
|
||
#ifdef __AVX2__ | ||
static __m256i inline | ||
static inline __m256i | ||
mm256_cvtepu8_epi32(void *ptr) { | ||
return _mm256_cvtepu8_epi32(_mm_loadl_epi64((__m128i *) ptr)); | ||
return _mm256_cvtepu8_epi32(_mm_loadl_epi64((__m128i *)ptr)); | ||
} | ||
#endif |