15 #ifndef __IPSDKUTIL_INSTRUCTIONSET_DETAIL_SSE2_ASSIGNREGIMPL_H__ 16 #define __IPSDKUTIL_INSTRUCTIONSET_DETAIL_SSE2_ASSIGNREGIMPL_H__ 29 typename Sse2Type<T>::Type
31 typename boost::enable_if<
32 typename boost::mpl::and_<typename boost::is_integral<T>::type,
33 typename boost::mpl::equal_to<boost::mpl::int_<sizeof(T)>, boost::mpl::int_<1> >::type
39 return _mm_set1_epi8(value);
46 typename boost::enable_if<
47 typename boost::mpl::and_<typename boost::is_integral<T>::type,
48 typename boost::mpl::equal_to<boost::mpl::int_<sizeof(T)>, boost::mpl::int_<1> >::type
52 ::act(
typename Sse2Type<T>::Type& reg,
const T& value)
54 reg = _mm_set1_epi8(value);
59 typename Sse2Type<T>::Type
61 typename boost::enable_if<
62 typename boost::mpl::and_<typename boost::is_integral<T>::type,
63 typename boost::mpl::equal_to<boost::mpl::int_<sizeof(T)>, boost::mpl::int_<2> >::type
66 >::act(
const T& value)
68 return _mm_set1_epi16(value);
75 typename boost::enable_if<
76 typename boost::mpl::and_<typename boost::is_integral<T>::type,
77 typename boost::mpl::equal_to<boost::mpl::int_<sizeof(T)>, boost::mpl::int_<2> >::type
80 >::act(
typename Sse2Type<T>::Type& reg,
const T& value)
82 reg = _mm_set1_epi16(value);
87 typename Sse2Type<T>::Type
89 typename boost::enable_if<
90 typename boost::mpl::and_<typename boost::is_integral<T>::type,
91 typename boost::mpl::equal_to<boost::mpl::int_<sizeof(T)>, boost::mpl::int_<4> >::type
94 >::act(
const T& value)
96 return _mm_set1_epi32(value);
103 typename boost::enable_if<
104 typename boost::mpl::and_<typename boost::is_integral<T>::type,
105 typename boost::mpl::equal_to<boost::mpl::int_<sizeof(T)>, boost::mpl::int_<4> >::type
108 >::act(
typename Sse2Type<T>::Type& reg,
const T& value)
110 reg = _mm_set1_epi32(value);
113 template <
typename T>
115 typename Sse2Type<T>::Type
117 typename boost::enable_if<
118 typename boost::mpl::and_<typename boost::is_integral<T>::type,
119 typename boost::mpl::equal_to<boost::mpl::int_<sizeof(T)>, boost::mpl::int_<8> >::type
122 >::act(
const T& value)
127 values[0] = values[1] = value;
128 return _mm_loadu_si128(
129 reinterpret_cast<const typename Sse2Type<T>::Type*
>(values));
132 template <
typename T>
136 typename boost::enable_if<
137 typename boost::mpl::and_<typename boost::is_integral<T>::type,
138 typename boost::mpl::equal_to<boost::mpl::int_<sizeof(T)>, boost::mpl::int_<8> >::type
141 >::act(
typename Sse2Type<T>::Type& reg,
const T& value)
146 values[0] = values[1] = value;
147 reg = _mm_loadu_si128(
148 reinterpret_cast<const typename Sse2Type<T>::Type*
>(values));
153 Sse2Type<ipReal32>::Type
154 AssignReg<eInstructionSet::eIS_Sse2, ipReal32>::act(
const ipReal32& value)
156 return _mm_set1_ps(value);
161 AssignReg<eInstructionSet::eIS_Sse2, ipReal32>::act(Sse2Type<ipReal32>::Type& reg,
164 reg = _mm_set1_ps(value);
169 Sse2Type<ipReal64>::Type
170 AssignReg<eInstructionSet::eIS_Sse2, ipReal64>::act(
const ipReal64& value)
172 return _mm_set1_pd(value);
177 AssignReg<eInstructionSet::eIS_Sse2, ipReal64>::act(Sse2Type<ipReal64>::Type& reg,
180 reg = _mm_set1_pd(value);
190 #endif // __IPSDKUTIL_INSTRUCTIONSET_DETAIL_SSE2_ASSIGNREGIMPL_H__ Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
double ipReal64
Base types definition.
Definition: BaseTypes.h:57
Streaming SIMD Extensions 2.
Definition: InstructionSetTypes.h:36
float ipReal32
Base types definition.
Definition: BaseTypes.h:56