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_AVX_ISOUTOFRANGEREG_H__
16 #define __IPSDKUTIL_INSTRUCTIONSET_COMPARISON_DETAIL_AVX_ISOUTOFRANGEREG_H__
17 
22 
23 namespace ipsdk {
24 namespace simd {
25 namespace detail {
26 
29 
30 template <>
32 {
33  static IPSDK_FORCEINLINE
35  act(const AvxType<ipReal32>::Type& in,
36  const AvxType<ipReal32>::Type& regMin,
37  const AvxType<ipReal32>::Type& regMax)
38  {
39  return _mm256_or_ps(_mm256_cmp_ps(in, regMin, _CMP_LT_OQ),
40  _mm256_cmp_ps(in, regMax, _CMP_GT_OQ));
41  }
42 
43  static IPSDK_FORCEINLINE
44  void
45  act(const AvxType<ipReal32>::Type& in,
46  const AvxType<ipReal32>::Type& regMin,
47  const AvxType<ipReal32>::Type& regMax,
49  {
50  out = _mm256_or_ps(_mm256_cmp_ps(in, regMin, _CMP_LT_OQ),
51  _mm256_cmp_ps(in, regMax, _CMP_GT_OQ));
52  }
53 };
54 
55 template <>
57 {
58  static IPSDK_FORCEINLINE
60  act(const AvxType<ipReal64>::Type& in,
61  const AvxType<ipReal64>::Type& regMin,
62  const AvxType<ipReal64>::Type& regMax)
63  {
64  return _mm256_or_pd(_mm256_cmp_pd(in, regMin, _CMP_LT_OQ),
65  _mm256_cmp_pd(in, regMax, _CMP_GT_OQ));
66  }
67 
68  static IPSDK_FORCEINLINE
69  void
70  act(const AvxType<ipReal64>::Type& in,
71  const AvxType<ipReal64>::Type& regMin,
72  const AvxType<ipReal64>::Type& regMax,
74  {
75  out = _mm256_or_pd(_mm256_cmp_pd(in, regMin, _CMP_LT_OQ),
76  _mm256_cmp_pd(in, regMax, _CMP_GT_OQ));
77  }
78 };
79 
82 
83 } // end of namespace detail
84 } // end of namespace simd
85 } // end of namespace ipsdk
86 
88 
89 #endif // __IPSDKUTIL_INSTRUCTIONSET_COMPARISON_DETAIL_AVX_ISOUTOFRANGEREG_H__
Definition: IsOutOfRangeReg.h:30
Defines the IPSDK_FORCEINLINE.
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
double ipReal64
Base types definition.
Definition: BaseTypes.h:57
eInstructionSet
Enumerate for processor instruction set description.
Definition: InstructionSetTypes.h:31
Advanced Vector Extensions.
Definition: InstructionSetTypes.h:44
Definition of import/export macro for library.
Definition: RegMaskType.h:29
structure used to retrieve AVX type associated to a base type
Definition: AvxTypes.h:33
float ipReal32
Base types definition.
Definition: BaseTypes.h:56