mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Common: move _mm_shuffle_epi8 to Intrinsics.h
This commit is contained in:
@ -34,24 +34,6 @@ struct ArraySizeImpl : public std::extent<T>
|
|||||||
#define b32(x) (b16(x) | (b16(x) >>16) )
|
#define b32(x) (b16(x) | (b16(x) >>16) )
|
||||||
#define ROUND_UP_POW2(x) (b32(x - 1) + 1)
|
#define ROUND_UP_POW2(x) (b32(x - 1) + 1)
|
||||||
|
|
||||||
#ifndef __GNUC_PREREQ
|
|
||||||
#define __GNUC_PREREQ(a, b) 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (defined __GNUC__ && !__GNUC_PREREQ(4,9)) && \
|
|
||||||
!defined __SSSE3__ && defined _M_X86
|
|
||||||
#include <emmintrin.h>
|
|
||||||
static __inline __m128i __attribute__((__always_inline__))
|
|
||||||
_mm_shuffle_epi8(__m128i a, __m128i mask)
|
|
||||||
{
|
|
||||||
__m128i result;
|
|
||||||
__asm__("pshufb %1, %0"
|
|
||||||
: "=x" (result)
|
|
||||||
: "xm" (mask), "0" (a));
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
@ -12,4 +12,24 @@
|
|||||||
#include <x86intrin.h>
|
#include <x86intrin.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __GNUC_PREREQ
|
||||||
|
#define __GNUC_PREREQ(maj, min) 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined __GNUC__ && !__GNUC_PREREQ(4, 9) && !defined __SSSE3__
|
||||||
|
// GCC <= 4.8 only enables intrinsics based on the command-line.
|
||||||
|
// GCC >= 4.9 always declares all intrinsics.
|
||||||
|
// We only want to require SSE2 and thus compile with -msse2,
|
||||||
|
// so define the one post-SSE2 intrinsic that we dispatch at runtime.
|
||||||
|
static __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
|
||||||
|
_mm_shuffle_epi8(__m128i a, __m128i mask)
|
||||||
|
{
|
||||||
|
__m128i result;
|
||||||
|
__asm__("pshufb %1, %0"
|
||||||
|
: "=x" (result)
|
||||||
|
: "xm" (mask), "0" (a));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // _M_X86
|
#endif // _M_X86
|
||||||
|
Reference in New Issue
Block a user