IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
IsLessRegImpl.h
Go to the documentation of this file.
1 // IsLessRegImpl.h:
3 // -------------------
4 //
14 
15 #ifndef __IPSDKUTIL_INSTRUCTIONSET_COMPARISON_DETAIL_AVX2_ISLESSREGIMPL_H__
16 #define __IPSDKUTIL_INSTRUCTIONSET_COMPARISON_DETAIL_AVX2_ISLESSREGIMPL_H__
17 
18 
25 
26 namespace ipsdk {
27 namespace simd {
28 namespace detail {
29 
32 
33 template <typename T>
34 IPSDK_FORCEINLINE
35 typename RegMaskType<eInstructionSet::eIS_Avx2, T>::Type
36 IsLessReg<eInstructionSet::eIS_Avx2, T,
37  typename boost::enable_if_c<
38  boost::is_integral<T>::value
39  >::type
40 >::act(
41  const typename AvxType<T>::Type& in1,
42  const typename AvxType<T>::Type& in2)
43 {
44  const typename AvxType<T>::Type& in1GtIn2 =
45  IsGreaterReg<eInstructionSet::eIS_Avx2, T>::act(in1, in2);
46  const typename AvxType<T>::Type& in1EqIn2 =
47  IsEqualReg<eInstructionSet::eIS_Avx2, T>::act(in1, in2);
48 
49  return BitwiseNotReg<eInstructionSet::eIS_Avx2, T>::act(
50  BitwiseOrReg<eInstructionSet::eIS_Avx2, T>::act(in1GtIn2, in1EqIn2));
51 }
52 
53 template <typename T>
54 IPSDK_FORCEINLINE
55 void
56 IsLessReg<eInstructionSet::eIS_Avx2, T,
57  typename boost::enable_if_c<
58  boost::is_integral<T>::value
59  >::type
60 >::act(
61  const typename AvxType<T>::Type& in1,
62  const typename AvxType<T>::Type& in2,
63  typename RegMaskType<eInstructionSet::eIS_Avx2, T>::Type& out)
64 {
65  typename AvxType<T>::Type in1GtIn2;
66  IsGreaterReg<eInstructionSet::eIS_Avx2, T>::act(in1, in2, in1GtIn2);
67  typename AvxType<T>::Type in1EqIn2;
68  IsEqualReg<eInstructionSet::eIS_Avx2, T>::act(in1, in2, in1EqIn2);
69  BitwiseOrReg<eInstructionSet::eIS_Avx2, T>::act(in1GtIn2, in1EqIn2, out);
70  BitwiseNotReg<eInstructionSet::eIS_Avx2, T>::act(out, out);
71 }
72 
73 IPSDK_FORCEINLINE
74 RegMaskType<eInstructionSet::eIS_Avx2, ipReal32>::Type
75 IsLessReg<eInstructionSet::eIS_Avx2, ipReal32>::act(
76  const AvxType<ipReal32>::Type& in1,
77  const AvxType<ipReal32>::Type& in2)
78 {
79  return IsLessReg<eInstructionSet::eIS_Avx, ipReal32>::act(in1, in2);
80 }
81 
82 IPSDK_FORCEINLINE
83 void
84 IsLessReg<eInstructionSet::eIS_Avx2, ipReal32>::act(
85  const AvxType<ipReal32>::Type& in1,
86  const AvxType<ipReal32>::Type& in2,
87  RegMaskType<eInstructionSet::eIS_Avx2, ipReal32>::Type& out)
88 {
89  IsLessReg<eInstructionSet::eIS_Avx, ipReal32>::act(in1, in2, out);
90 }
91 
92 IPSDK_FORCEINLINE
93 RegMaskType<eInstructionSet::eIS_Avx2, ipReal64>::Type
94 IsLessReg<eInstructionSet::eIS_Avx2, ipReal64>::act(
95  const AvxType<ipReal64>::Type& in1,
96  const AvxType<ipReal64>::Type& in2)
97 {
98  return IsLessReg<eInstructionSet::eIS_Avx, ipReal64>::act(in1, in2);
99 }
100 
101 IPSDK_FORCEINLINE
102 void
103 IsLessReg<eInstructionSet::eIS_Avx2, ipReal64>::act(
104  const AvxType<ipReal64>::Type& in1,
105  const AvxType<ipReal64>::Type& in2,
106  RegMaskType<eInstructionSet::eIS_Avx2, ipReal64>::Type& out)
107 {
108  IsLessReg<eInstructionSet::eIS_Avx, ipReal64>::act(in1, in2, out);
109 }
110 
113 
114 } // end of namespace detail
115 } // end of namespace simd
116 } // end of namespace ipsdk
117 
122 
123 #endif // __IPSDKUTIL_INSTRUCTIONSET_COMPARISON_DETAIL_AVX2_ISLESSREGIMPL_H__
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
Advanced Vector Extensions 2.
Definition: InstructionSetTypes.h:48