15 #ifndef __IPSDKUTIL_INSTRUCTIONSET_COMPARISON_DETAIL_SSE2_ISEQUALREGIMPL_H__ 16 #define __IPSDKUTIL_INSTRUCTIONSET_COMPARISON_DETAIL_SSE2_ISEQUALREGIMPL_H__ 29 typename RegMaskType<eInstructionSet::eIS_Sse2, T>::Type
33 typename boost::enable_if<
34 typename boost::mpl::and_<
35 typename boost::is_integral<T>::type,
36 typename boost::mpl::equal_to<boost::mpl::int_<sizeof(T)>, boost::mpl::int_<1> >::type
40 const typename Sse2Type<T>::Type& in1,
41 const typename Sse2Type<T>::Type& in2)
43 return _mm_cmpeq_epi8(in1, in2);
52 typename boost::enable_if<
53 typename boost::mpl::and_<
54 typename boost::is_integral<T>::type,
55 typename boost::mpl::equal_to<boost::mpl::int_<sizeof(T)>, boost::mpl::int_<1> >::type
59 const typename Sse2Type<T>::Type& in1,
60 const typename Sse2Type<T>::Type& in2,
61 typename RegMaskType<eInstructionSet::eIS_Sse2, T>::Type& out)
63 out = _mm_cmpeq_epi8(in1, in2);
68 typename RegMaskType<eInstructionSet::eIS_Sse2, T>::Type
72 typename boost::enable_if<
73 typename boost::mpl::and_<
74 typename boost::is_integral<T>::type,
75 typename boost::mpl::equal_to<boost::mpl::int_<sizeof(T)>, boost::mpl::int_<2> >::type
79 const typename Sse2Type<T>::Type& in1,
80 const typename Sse2Type<T>::Type& in2)
82 return _mm_cmpeq_epi16(in1, in2);
89 typename boost::enable_if<
90 typename boost::mpl::and_<
91 typename boost::is_integral<T>::type,
92 typename boost::mpl::equal_to<boost::mpl::int_<sizeof(T)>, boost::mpl::int_<2> >::type
96 const typename Sse2Type<T>::Type& in1,
97 const typename Sse2Type<T>::Type& in2,
98 typename RegMaskType<eInstructionSet::eIS_Sse2, T>::Type& out)
100 out = _mm_cmpeq_epi16(in1, in2);
103 template <
typename T>
105 typename RegMaskType<eInstructionSet::eIS_Sse2, T>::Type
109 typename boost::enable_if<
110 typename boost::mpl::and_<
111 typename boost::is_integral<T>::type,
112 typename boost::mpl::equal_to<boost::mpl::int_<sizeof(T)>, boost::mpl::int_<4> >::type
116 const typename Sse2Type<T>::Type& in1,
117 const typename Sse2Type<T>::Type& in2)
119 return _mm_cmpeq_epi32(in1, in2);
122 template <
typename T>
128 typename boost::enable_if<
129 typename boost::mpl::and_<
130 typename boost::is_integral<T>::type,
131 typename boost::mpl::equal_to<boost::mpl::int_<sizeof(T)>, boost::mpl::int_<4> >::type
135 const typename Sse2Type<T>::Type& in1,
136 const typename Sse2Type<T>::Type& in2,
137 typename RegMaskType<eInstructionSet::eIS_Sse2, T>::Type& out)
139 out = _mm_cmpeq_epi32(in1, in2);
142 template <
typename T>
144 typename RegMaskType<eInstructionSet::eIS_Sse2, T>::Type
146 typename boost::enable_if<
147 typename boost::mpl::and_<
148 typename boost::is_integral<T>::type,
149 typename boost::mpl::equal_to<boost::mpl::int_<sizeof(T)>, boost::mpl::int_<8 > >::type
153 const typename Sse2Type<T>::Type& in1,
154 const typename Sse2Type<T>::Type& in2)
156 typedef typename Sse2Type<T>::Type RegT;
157 RegT eq_epi32 = _mm_cmpeq_epi32(in1, in2);
158 return _mm_and_si128(
159 _mm_shuffle_epi32(eq_epi32, _MM_SHUFFLE(3, 3, 1, 1)),
160 _mm_shuffle_epi32(eq_epi32, _MM_SHUFFLE(2, 2, 0, 0)));
163 template <
typename T>
167 typename boost::enable_if<
168 typename boost::mpl::and_<
169 typename boost::is_integral<T>::type,
170 typename boost::mpl::equal_to<boost::mpl::int_<sizeof(T)>, boost::mpl::int_<8 > >::type
174 const typename Sse2Type<T>::Type& in1,
175 const typename Sse2Type<T>::Type& in2,
176 typename RegMaskType<eInstructionSet::eIS_Sse2, T>::Type& out)
178 typedef typename Sse2Type<T>::Type RegT;
179 RegT eq_epi32 = _mm_cmpeq_epi32(in1, in2);
181 _mm_shuffle_epi32(eq_epi32, _MM_SHUFFLE(3, 3, 1, 1)),
182 _mm_shuffle_epi32(eq_epi32, _MM_SHUFFLE(2, 2, 0, 0)));
186 RegMaskType<eInstructionSet::eIS_Sse2, ipReal32>::Type
187 IsEqualReg<eInstructionSet::eIS_Sse2, ipReal32>::act(
188 const Sse2Type<ipReal32>::Type& in1,
189 const Sse2Type<ipReal32>::Type& in2)
191 return _mm_cmpeq_ps(in1, in2);
196 IsEqualReg<eInstructionSet::eIS_Sse2, ipReal32>::act(
197 const Sse2Type<ipReal32>::Type& in1,
198 const Sse2Type<ipReal32>::Type& in2,
199 RegMaskType<eInstructionSet::eIS_Sse2, ipReal32>::Type& out)
201 out = _mm_cmpeq_ps(in1, in2);
205 RegMaskType<eInstructionSet::eIS_Sse2, ipReal64>::Type
206 IsEqualReg<eInstructionSet::eIS_Sse2, ipReal64>::act(
207 const Sse2Type<ipReal64>::Type& in1,
208 const Sse2Type<ipReal64>::Type& in2)
210 return _mm_cmpeq_pd(in1, in2);
215 IsEqualReg<eInstructionSet::eIS_Sse2, ipReal64>::act(
216 const Sse2Type<ipReal64>::Type& in1,
217 const Sse2Type<ipReal64>::Type& in2,
218 RegMaskType<eInstructionSet::eIS_Sse2, ipReal64>::Type& out)
220 out = _mm_cmpeq_pd(in1, in2);
230 #endif // __IPSDKUTIL_INSTRUCTIONSET_COMPARISON_DETAIL_SSE2_ISEQUALREGIMPL_H__ Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
Streaming SIMD Extensions 2.
Definition: InstructionSetTypes.h:36