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