IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
IsOutOfRangeReg.h
Go to the documentation of this file.
1 // IsOutOfRangeReg.h:
3 // -------------------
4 //
14 
15 #ifndef __IPSDKUTIL_INSTRUCTIONSET_COMPARISON_DETAIL_SSE2_ISOUTOFRANGEREG_H__
16 #define __IPSDKUTIL_INSTRUCTIONSET_COMPARISON_DETAIL_SSE2_ISOUTOFRANGEREG_H__
17 
24 
25 namespace ipsdk {
26 namespace simd {
27 namespace detail {
28 
31 
32 template <>
34 {
35  static IPSDK_FORCEINLINE
37  act(const Sse2Type<ipInt8>::Type& in,
38  const Sse2Type<ipInt8>::Type& regMin,
39  const Sse2Type<ipInt8>::Type& regMax)
40  {
41  return _mm_or_si128(_mm_cmplt_epi8(in, regMin),
42  _mm_cmpgt_epi8(in, regMax));
43  }
44 
45  static IPSDK_FORCEINLINE
46  void
47  act(const Sse2Type<ipInt8>::Type& in,
48  const Sse2Type<ipInt8>::Type& regMin,
49  const Sse2Type<ipInt8>::Type& regMax,
51  {
52  out = _mm_or_si128(_mm_cmplt_epi8(in, regMin),
53  _mm_cmpgt_epi8(in, regMax));
54  }
55 };
56 
57 template <>
59 {
60  static IPSDK_FORCEINLINE
62  act(const Sse2Type<ipUInt8>::Type& in,
63  const Sse2Type<ipUInt8>::Type& regMin,
64  const Sse2Type<ipUInt8>::Type& regMax)
65  {
66  const Sse2Type<ipUInt8>::Type& c =
68  const Sse2Type<ipUInt8>::Type& inCvt =
70  const Sse2Type<ipUInt8>::Type& minCvt =
72  const Sse2Type<ipUInt8>::Type& maxCvt =
74 
75  return _mm_or_si128(_mm_cmplt_epi8(inCvt, minCvt),
76  _mm_cmpgt_epi8(inCvt, maxCvt));
77  }
78 
79  static IPSDK_FORCEINLINE
80  void
81  act(const Sse2Type<ipUInt8>::Type& in,
82  const Sse2Type<ipUInt8>::Type& regMin,
83  const Sse2Type<ipUInt8>::Type& regMax,
85  {
94 
95  out = _mm_or_si128(_mm_cmplt_epi8(inCvt, minCvt),
96  _mm_cmpgt_epi8(inCvt, maxCvt));
97  }
98 };
99 
100 template <>
102 {
103  static IPSDK_FORCEINLINE
105  act(const Sse2Type<ipInt16>::Type& in,
106  const Sse2Type<ipInt16>::Type& regMin,
107  const Sse2Type<ipInt16>::Type& regMax)
108  {
109  return _mm_or_si128(_mm_cmplt_epi16(in, regMin),
110  _mm_cmpgt_epi16(in, regMax));
111  }
112 
113  static IPSDK_FORCEINLINE
114  void
115  act(const Sse2Type<ipInt16>::Type& in,
116  const Sse2Type<ipInt16>::Type& regMin,
117  const Sse2Type<ipInt16>::Type& regMax,
119  {
120  out = _mm_or_si128(_mm_cmplt_epi16(in, regMin),
121  _mm_cmpgt_epi16(in, regMax));
122  }
123 };
124 
125 template <>
127 {
128  static IPSDK_FORCEINLINE
130  act(const Sse2Type<ipUInt16>::Type& in,
131  const Sse2Type<ipUInt16>::Type& regMin,
132  const Sse2Type<ipUInt16>::Type& regMax)
133  {
134  const Sse2Type<ipUInt16>::Type& c =
136  const Sse2Type<ipUInt16>::Type& inCvt =
138  const Sse2Type<ipUInt16>::Type& minCvt =
140  const Sse2Type<ipUInt16>::Type& maxCvt =
142 
143  return _mm_or_si128(_mm_cmplt_epi16(inCvt, minCvt),
144  _mm_cmpgt_epi16(inCvt, maxCvt));
145  }
146 
147  static IPSDK_FORCEINLINE
148  void
149  act(const Sse2Type<ipUInt16>::Type& in,
150  const Sse2Type<ipUInt16>::Type& regMin,
151  const Sse2Type<ipUInt16>::Type& regMax,
153  {
162 
163  out = _mm_or_si128(_mm_cmplt_epi16(inCvt, minCvt),
164  _mm_cmpgt_epi16(inCvt, maxCvt));
165  }
166 };
167 
168 template <>
170 {
171  static IPSDK_FORCEINLINE
173  act(const Sse2Type<ipInt32>::Type& in,
174  const Sse2Type<ipInt32>::Type& regMin,
175  const Sse2Type<ipInt32>::Type& regMax)
176  {
177  return _mm_or_si128(_mm_cmplt_epi32(in, regMin),
178  _mm_cmpgt_epi32(in, regMax));
179  }
180 
181  static IPSDK_FORCEINLINE
182  void
183  act(const Sse2Type<ipInt32>::Type& in,
184  const Sse2Type<ipInt32>::Type& regMin,
185  const Sse2Type<ipInt32>::Type& regMax,
187  {
188  out = _mm_or_si128(_mm_cmplt_epi32(in, regMin),
189  _mm_cmpgt_epi32(in, regMax));
190  }
191 };
192 
193 template <>
195 {
196  static IPSDK_FORCEINLINE
198  act(const Sse2Type<ipUInt32>::Type& in,
199  const Sse2Type<ipUInt32>::Type& regMin,
200  const Sse2Type<ipUInt32>::Type& regMax)
201  {
202  const Sse2Type<ipUInt32>::Type& c =
204  const Sse2Type<ipUInt32>::Type& inCvt =
206  const Sse2Type<ipUInt32>::Type& minCvt =
208  const Sse2Type<ipUInt32>::Type& maxCvt =
210 
211  return _mm_or_si128(_mm_cmplt_epi32(inCvt, minCvt),
212  _mm_cmpgt_epi32(inCvt, maxCvt));
213  }
214 
215  static IPSDK_FORCEINLINE
216  void
217  act(const Sse2Type<ipUInt32>::Type& in,
218  const Sse2Type<ipUInt32>::Type& regMin,
219  const Sse2Type<ipUInt32>::Type& regMax,
221  {
230 
231  out = _mm_or_si128(_mm_cmplt_epi32(inCvt, minCvt),
232  _mm_cmpgt_epi32(inCvt, maxCvt));
233  }
234 };
235 
236 
237 template <>
239 {
240  static IPSDK_FORCEINLINE
242  act(const Sse2Type<ipReal32>::Type& in,
243  const Sse2Type<ipReal32>::Type& regMin,
244  const Sse2Type<ipReal32>::Type& regMax)
245  {
246  return _mm_or_ps(_mm_cmplt_ps(in, regMin),
247  _mm_cmpgt_ps(in, regMax));
248  }
249 
250  static IPSDK_FORCEINLINE
251  void
252  act(const Sse2Type<ipReal32>::Type& in,
253  const Sse2Type<ipReal32>::Type& regMin,
254  const Sse2Type<ipReal32>::Type& regMax,
256  {
257  out = _mm_or_ps(_mm_cmplt_ps(in, regMin),
258  _mm_cmpgt_ps(in, regMax));
259  }
260 };
261 
262 template <>
264 {
265  static IPSDK_FORCEINLINE
267  act(const Sse2Type<ipReal64>::Type& in,
268  const Sse2Type<ipReal64>::Type& regMin,
269  const Sse2Type<ipReal64>::Type& regMax)
270  {
271  return _mm_or_pd(_mm_cmplt_pd(in, regMin),
272  _mm_cmpgt_pd(in, regMax));
273  }
274 
275  static IPSDK_FORCEINLINE
276  void
277  act(const Sse2Type<ipReal64>::Type& in,
278  const Sse2Type<ipReal64>::Type& regMin,
279  const Sse2Type<ipReal64>::Type& regMax,
281  {
282  out = _mm_or_pd(_mm_cmplt_pd(in, regMin),
283  _mm_cmpgt_pd(in, regMax));
284  }
285 };
286 
289 
290 } // end of namespace detail
291 } // end of namespace simd
292 } // end of namespace ipsdk
293 
294 #endif // __IPSDKUTIL_INSTRUCTIONSET_COMPARISON_DETAIL_SSE2_ISOUTOFRANGEREG_H__
Definition: IsOutOfRangeReg.h:30
int8_t ipInt8
Base types definition.
Definition: BaseTypes.h:48
Defines the IPSDK_FORCEINLINE.
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
double ipReal64
Base types definition.
Definition: BaseTypes.h:57
int32_t ipInt32
Base types definition.
Definition: BaseTypes.h:52
int16_t ipInt16
Base types definition.
Definition: BaseTypes.h:50
uint8_t ipUInt8
Base types definition.
Definition: BaseTypes.h:49
eInstructionSet
Enumerate for processor instruction set description.
Definition: InstructionSetTypes.h:31
function assigning a given value of type T to a given Pack<instructionSet, T>
Predefined types for Sse2 instruction set management.
Definition: BitwiseXOrReg.h:30
Definition of import/export macro for library.
Definition: RegMaskType.h:29
Streaming SIMD Extensions 2.
Definition: InstructionSetTypes.h:36
structure used to retrieve SSE2 type associated to a base type
Definition: Sse2Types.h:32
uint16_t ipUInt16
Base types definition.
Definition: BaseTypes.h:51
Definition: AssignRegDecl.h:31
float ipReal32
Base types definition.
Definition: BaseTypes.h:56
uint32_t ipUInt32
Base types definition.
Definition: BaseTypes.h:53