IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
IsLessEqualRegImpl.h
Go to the documentation of this file.
1 // IsLessEqualRegImpl.h:
3 // -------------------
4 //
14 
15 #ifndef __IPSDKUTIL_INSTRUCTIONSET_COMPARISON_DETAIL_AVX2_ISLESSEQUALREGIMPL_H__
16 #define __IPSDKUTIL_INSTRUCTIONSET_COMPARISON_DETAIL_AVX2_ISLESSEQUALREGIMPL_H__
17 
22 
23 namespace ipsdk {
24 namespace simd {
25 namespace detail {
26 
29 
30 template <typename T>
31 IPSDK_FORCEINLINE
32 typename RegMaskType<eInstructionSet::eIS_Avx2, T>::Type
33 IsLessEqualReg<eInstructionSet::eIS_Avx2, T,
34  typename boost::enable_if_c<
35  boost::is_integral<T>::value
36  >::type
37 >::act(
38  const typename AvxType<T>::Type& in1,
39  const typename AvxType<T>::Type& in2)
40 {
41  return BitwiseNotReg<eInstructionSet::eIS_Avx2, T>::act(
42  IsGreaterReg<eInstructionSet::eIS_Avx2, T>::act(in1, in2));
43 }
44 
45 template <typename T>
46 IPSDK_FORCEINLINE
47 typename RegMaskType<eInstructionSet::eIS_Avx2, T>::Type
48 IsLessEqualReg<eInstructionSet::eIS_Avx2, T,
49  typename boost::enable_if_c<
50  boost::is_integral<T>::value
51  >::type
52 >::act(
53  const typename AvxType<T>::Type& in1,
54  const T& in2)
55 {
56  const typename AvxType<T>::Type regIn2 =
57  AssignReg<eInstructionSet::eIS_Avx2, T>::act(in2);
58  return BitwiseNotReg<eInstructionSet::eIS_Avx2, T>::act(
59  IsGreaterReg<eInstructionSet::eIS_Avx2, T>::act(
60  in1,
61  regIn2));
62 }
63 
64 template <typename T>
65 IPSDK_FORCEINLINE
66 void
67 IsLessEqualReg<eInstructionSet::eIS_Avx2, T,
68  typename boost::enable_if_c<
69  boost::is_integral<T>::value
70  >::type
71 >::act(
72  const typename AvxType<T>::Type& in1,
73  const typename AvxType<T>::Type& in2,
74  typename RegMaskType<eInstructionSet::eIS_Avx2, T>::Type& out)
75 {
76  IsGreaterReg<eInstructionSet::eIS_Avx2, T>::act(in1, in2, out);
77  BitwiseNotReg<eInstructionSet::eIS_Avx2, T>::act(out, out);
78 }
79 
80 template <typename T>
81 IPSDK_FORCEINLINE
82 void
83 IsLessEqualReg<eInstructionSet::eIS_Avx2, T,
84  typename boost::enable_if_c<
85  boost::is_integral<T>::value
86  >::type
87 >::act(
88  const typename AvxType<T>::Type& in1,
89  const T& in2,
90  typename RegMaskType<eInstructionSet::eIS_Avx2, T>::Type& out)
91 {
92  const typename AvxType<T>::Type regIn2 =
93  AssignReg<eInstructionSet::eIS_Avx2, T>::act(in2);
94  IsGreaterReg<eInstructionSet::eIS_Avx2, T>::act(in1, regIn2, out);
95  BitwiseNotReg<eInstructionSet::eIS_Avx2, T>::act(out, out);
96 }
97 
98 IPSDK_FORCEINLINE
99 RegMaskType<eInstructionSet::eIS_Avx2, ipReal32>::Type
100 IsLessEqualReg<eInstructionSet::eIS_Avx2, ipReal32>::act(
101  const AvxType<ipReal32>::Type& in1,
102  const AvxType<ipReal32>::Type& in2)
103 {
104  return IsLessEqualReg<eInstructionSet::eIS_Avx, ipReal32>::act(in1, in2);
105 }
106 
107 IPSDK_FORCEINLINE
108 RegMaskType<eInstructionSet::eIS_Avx2, ipReal32>::Type
109 IsLessEqualReg<eInstructionSet::eIS_Avx2, ipReal32>::act(
110  const AvxType<ipReal32>::Type& in1,
111  const ipReal32& in2)
112 {
113  const AvxType<ipReal32>::Type regIn2 =
114  AssignReg<eInstructionSet::eIS_Avx2, ipReal32>::act(in2);
115  return IsLessEqualReg<eInstructionSet::eIS_Avx, ipReal32>::act(in1, regIn2);
116 }
117 
118 void
119 IsLessEqualReg<eInstructionSet::eIS_Avx2, ipReal32>::act(
120  const AvxType<ipReal32>::Type& in1,
121  const AvxType<ipReal32>::Type& in2,
122  RegMaskType<eInstructionSet::eIS_Avx2, ipReal32>::Type& out)
123 {
124  IsLessEqualReg<eInstructionSet::eIS_Avx, ipReal32>::act(in1, in2, out);
125 }
126 
127 IPSDK_FORCEINLINE
128 void
129 IsLessEqualReg<eInstructionSet::eIS_Avx2, ipReal32>::act(
130  const AvxType<ipReal32>::Type& in1,
131  const ipReal32& in2,
132  RegMaskType<eInstructionSet::eIS_Avx2, ipReal32>::Type& out)
133 {
134  const AvxType<ipReal32>::Type regIn2 =
135  AssignReg<eInstructionSet::eIS_Avx2, ipReal32>::act(in2);
136  IsLessEqualReg<eInstructionSet::eIS_Avx, ipReal32>::act(in1, regIn2, out);
137 }
138 
139 IPSDK_FORCEINLINE
140 RegMaskType<eInstructionSet::eIS_Avx2, ipReal64>::Type
141 IsLessEqualReg<eInstructionSet::eIS_Avx2, ipReal64>::act(
142  const AvxType<ipReal64>::Type& in1,
143  const AvxType<ipReal64>::Type& in2)
144 {
145  return IsLessEqualReg<eInstructionSet::eIS_Avx, ipReal64>::act(in1, in2);
146 }
147 
148 IPSDK_FORCEINLINE
149 RegMaskType<eInstructionSet::eIS_Avx2, ipReal64>::Type
150 IsLessEqualReg<eInstructionSet::eIS_Avx2, ipReal64>::act(
151  const AvxType<ipReal64>::Type& in1,
152  const ipReal64& in2)
153 {
154  const AvxType<ipReal64>::Type regIn2 =
155  AssignReg<eInstructionSet::eIS_Avx2, ipReal64>::act(in2);
156  return IsLessEqualReg<eInstructionSet::eIS_Avx, ipReal64>::act(in1, regIn2);
157 }
158 
159 IPSDK_FORCEINLINE
160 void
161 IsLessEqualReg<eInstructionSet::eIS_Avx2, ipReal64>::act(
162  const AvxType<ipReal64>::Type& in1,
163  const AvxType<ipReal64>::Type& in2,
164  RegMaskType<eInstructionSet::eIS_Avx2, ipReal64>::Type& out)
165 {
166  IsLessEqualReg<eInstructionSet::eIS_Avx, ipReal64>::act(in1, in2, out);
167 }
168 
169 IPSDK_FORCEINLINE
170 void
171 IsLessEqualReg<eInstructionSet::eIS_Avx2, ipReal64>::act(
172  const AvxType<ipReal64>::Type& in1,
173  const ipReal64& in2,
174  RegMaskType<eInstructionSet::eIS_Avx2, ipReal64>::Type& out)
175 {
176  const AvxType<ipReal64>::Type regIn2 =
177  AssignReg<eInstructionSet::eIS_Avx2, ipReal64>::act(in2);
178  IsLessEqualReg<eInstructionSet::eIS_Avx, ipReal64>::act(in1, regIn2, out);
179 }
180 
183 
184 } // end of namespace detail
185 } // end of namespace simd
186 } // end of namespace ipsdk
187 
189 
190 #endif // __IPSDKUTIL_INSTRUCTIONSET_COMPARISON_DETAIL_AVX2_ISLESSEQUALREGIMPL_H__
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
double ipReal64
Base types definition.
Definition: BaseTypes.h:57
Advanced Vector Extensions 2.
Definition: InstructionSetTypes.h:48
float ipReal32
Base types definition.
Definition: BaseTypes.h:56