29 #ifndef VC_COMMON_SET_H_
30 #define VC_COMMON_SET_H_
33 namespace Vc_VERSIONED_NAMESPACE
37 static Vc_INTRINSIC Vc_CONST __m128i set(
unsigned short x0,
unsigned short x1,
unsigned short x2,
unsigned short x3,
38 unsigned short x4,
unsigned short x5,
unsigned short x6,
unsigned short x7)
40 #if defined(Vc_GNU_ASM)
41 #if 0 // defined(__x86_64__)
44 unsigned long long tmp0 = x3; tmp0 = (tmp0 << 16) | x2;
45 unsigned long long tmp1 = x1; tmp1 = (tmp1 << 16) | x0;
46 asm(
"vmovq %1,%0" :
"=x"(r) :
"r"((tmp0 << 32) | tmp1));
47 unsigned long long tmp2 = x7; tmp2 = (tmp2 << 16) | x6;
48 unsigned long long tmp3 = x5; tmp3 = (tmp3 << 16) | x4;
49 asm(
"vpinsrq $1,%1,%0,%0" :
"+x"(r) :
"r"((tmp2 << 32) | tmp3));
51 #elif defined(Vc_USE_VEX_CODING)
53 unsigned int tmp0 = x1; tmp0 = (tmp0 << 16) | x0;
54 unsigned int tmp1 = x3; tmp1 = (tmp1 << 16) | x2;
55 unsigned int tmp2 = x5; tmp2 = (tmp2 << 16) | x4;
56 unsigned int tmp3 = x7; tmp3 = (tmp3 << 16) | x6;
57 asm(
"vmovd %1,%0" :
"=x"(r0) :
"r"(tmp0));
58 asm(
"vpinsrd $1,%1,%0,%0" :
"+x"(r0) :
"r"(tmp1));
59 asm(
"vmovd %1,%0" :
"=x"(r1) :
"r"(tmp2));
60 asm(
"vpinsrd $1,%1,%0,%0" :
"+x"(r1) :
"r"(tmp3));
61 asm(
"vpunpcklqdq %1,%0,%0" :
"+x"(r0) :
"x"(r1));
65 unsigned int tmp0 = x1; tmp0 = (tmp0 << 16) | x0;
66 unsigned int tmp1 = x3; tmp1 = (tmp1 << 16) | x2;
67 unsigned int tmp2 = x5; tmp2 = (tmp2 << 16) | x4;
68 unsigned int tmp3 = x7; tmp3 = (tmp3 << 16) | x6;
69 asm(
"movd %1,%0" :
"=x"(r0) :
"r"(tmp0));
70 asm(
"pinsrd $1,%1,%0" :
"+x"(r0) :
"r"(tmp1));
71 asm(
"movd %1,%0" :
"=x"(r1) :
"r"(tmp2));
72 asm(
"pinsrd $1,%1,%0" :
"+x"(r1) :
"r"(tmp3));
73 asm(
"punpcklqdq %1,%0" :
"+x"(r0) :
"x"(r1));
77 unsigned int tmp0 = x1; tmp0 = (tmp0 << 16) | x0;
78 unsigned int tmp1 = x3; tmp1 = (tmp1 << 16) | x2;
79 unsigned int tmp2 = x5; tmp2 = (tmp2 << 16) | x4;
80 unsigned int tmp3 = x7; tmp3 = (tmp3 << 16) | x6;
81 return _mm_setr_epi32(tmp0, tmp1, tmp2, tmp3);
84 static Vc_INTRINSIC Vc_CONST __m128i set(
short x0,
short x1,
short x2,
short x3,
short x4,
short x5,
short x6,
short x7)
86 return set(static_cast<unsigned short>(x0), static_cast<unsigned short>(x1), static_cast<unsigned short>(x2),
87 static_cast<unsigned short>(x3), static_cast<unsigned short>(x4), static_cast<unsigned short>(x5),
88 static_cast<unsigned short>(x6), static_cast<unsigned short>(x7));
93 #endif // VC_COMMON_SET_H_