File indexing completed on 2025-02-25 10:27:24
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028 #ifndef VC_COMMON_SET_H_
0029 #define VC_COMMON_SET_H_
0030
0031 #include "macros.h"
0032 namespace Vc_VERSIONED_NAMESPACE
0033 {
0034 namespace
0035 {
0036 static Vc_INTRINSIC Vc_CONST __m128i set(unsigned short x0, unsigned short x1, unsigned short x2, unsigned short x3,
0037 unsigned short x4, unsigned short x5, unsigned short x6, unsigned short x7)
0038 {
0039 #if defined(Vc_GNU_ASM)
0040 #if 0
0041
0042 __m128i r;
0043 unsigned long long tmp0 = x3; tmp0 = (tmp0 << 16) | x2;
0044 unsigned long long tmp1 = x1; tmp1 = (tmp1 << 16) | x0;
0045 asm("vmovq %1,%0" : "=x"(r) : "r"((tmp0 << 32) | tmp1));
0046 unsigned long long tmp2 = x7; tmp2 = (tmp2 << 16) | x6;
0047 unsigned long long tmp3 = x5; tmp3 = (tmp3 << 16) | x4;
0048 asm("vpinsrq $1,%1,%0,%0" : "+x"(r) : "r"((tmp2 << 32) | tmp3));
0049 return r;
0050 #elif defined(Vc_USE_VEX_CODING)
0051 __m128i r0, r1;
0052 unsigned int tmp0 = x1; tmp0 = (tmp0 << 16) | x0;
0053 unsigned int tmp1 = x3; tmp1 = (tmp1 << 16) | x2;
0054 unsigned int tmp2 = x5; tmp2 = (tmp2 << 16) | x4;
0055 unsigned int tmp3 = x7; tmp3 = (tmp3 << 16) | x6;
0056 asm("vmovd %1,%0" : "=x"(r0) : "r"(tmp0));
0057 asm("vpinsrd $1,%1,%0,%0" : "+x"(r0) : "r"(tmp1));
0058 asm("vmovd %1,%0" : "=x"(r1) : "r"(tmp2));
0059 asm("vpinsrd $1,%1,%0,%0" : "+x"(r1) : "r"(tmp3));
0060 asm("vpunpcklqdq %1,%0,%0" : "+x"(r0) : "x"(r1));
0061 return r0;
0062 #else
0063 __m128i r0, r1;
0064 unsigned int tmp0 = x1; tmp0 = (tmp0 << 16) | x0;
0065 unsigned int tmp1 = x3; tmp1 = (tmp1 << 16) | x2;
0066 unsigned int tmp2 = x5; tmp2 = (tmp2 << 16) | x4;
0067 unsigned int tmp3 = x7; tmp3 = (tmp3 << 16) | x6;
0068 asm("movd %1,%0" : "=x"(r0) : "r"(tmp0));
0069 asm("pinsrd $1,%1,%0" : "+x"(r0) : "r"(tmp1));
0070 asm("movd %1,%0" : "=x"(r1) : "r"(tmp2));
0071 asm("pinsrd $1,%1,%0" : "+x"(r1) : "r"(tmp3));
0072 asm("punpcklqdq %1,%0" : "+x"(r0) : "x"(r1));
0073 return r0;
0074 #endif
0075 #else
0076 unsigned int tmp0 = x1; tmp0 = (tmp0 << 16) | x0;
0077 unsigned int tmp1 = x3; tmp1 = (tmp1 << 16) | x2;
0078 unsigned int tmp2 = x5; tmp2 = (tmp2 << 16) | x4;
0079 unsigned int tmp3 = x7; tmp3 = (tmp3 << 16) | x6;
0080 return _mm_setr_epi32(tmp0, tmp1, tmp2, tmp3);
0081 #endif
0082 }
0083 static Vc_INTRINSIC Vc_CONST __m128i set(short x0, short x1, short x2, short x3, short x4, short x5, short x6, short x7)
0084 {
0085 return set(static_cast<unsigned short>(x0), static_cast<unsigned short>(x1), static_cast<unsigned short>(x2),
0086 static_cast<unsigned short>(x3), static_cast<unsigned short>(x4), static_cast<unsigned short>(x5),
0087 static_cast<unsigned short>(x6), static_cast<unsigned short>(x7));
0088 }
0089 }
0090 }
0091
0092 #endif