IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
MaskBlendReg.h
Go to the documentation of this file.
1 // MaskBlendReg.h:
3 // -------------------
4 //
14 
15 #ifndef __IPSDKUTIL_INSTRUCTIONSET_LOGICAL_DETAIL_AVX512_MASKBLENDREG_H__
16 #define __IPSDKUTIL_INSTRUCTIONSET_LOGICAL_DETAIL_AVX512_MASKBLENDREG_H__
17 
22 
23 namespace ipsdk {
24 namespace simd {
25 namespace detail {
26 
29 
30 template <>
32 {
33  static IPSDK_FORCEINLINE
35  act(const __mmask64& mask,
36  const Avx512Type<ipInt8>::Type& in1,
37  const Avx512Type<ipInt8>::Type& in2)
38  {
39  return _mm512_mask_blend_epi8(mask, in1, in2);
40  }
41 
42  static IPSDK_FORCEINLINE
43  void
44  act(const __mmask64& mask,
45  const Avx512Type<ipInt8>::Type& in1,
46  const Avx512Type<ipInt8>::Type& in2,
48  {
49  out = _mm512_mask_blend_epi8(mask, in1, in2);
50  }
51 };
52 
53 template <>
55 {
56  static IPSDK_FORCEINLINE
58  act(const __mmask64& mask,
59  const Avx512Type<ipUInt8>::Type& in1,
60  const Avx512Type<ipUInt8>::Type& in2)
61  {
62  return _mm512_mask_blend_epi8(mask, in1, in2);
63  }
64 
65  static IPSDK_FORCEINLINE
66  void
67  act(const __mmask64& mask,
68  const Avx512Type<ipUInt8>::Type& in1,
69  const Avx512Type<ipUInt8>::Type& in2,
71  {
72  out = _mm512_mask_blend_epi8(mask, in1, in2);
73  }
74 };
75 
76 template <>
78 {
79  static IPSDK_FORCEINLINE
81  act(const __mmask32& mask,
82  const Avx512Type<ipInt16>::Type& in1,
83  const Avx512Type<ipInt16>::Type& in2)
84  {
85  return _mm512_mask_blend_epi16(mask, in1, in2);
86  }
87 
88  static IPSDK_FORCEINLINE
89  void
90  act(const __mmask32& mask,
91  const Avx512Type<ipInt16>::Type& in1,
92  const Avx512Type<ipInt16>::Type& in2,
94  {
95  out = _mm512_mask_blend_epi16(mask, in1, in2);
96  }
97 };
98 
99 template <>
101 {
102  static IPSDK_FORCEINLINE
104  act(const __mmask32& mask,
105  const Avx512Type<ipUInt16>::Type& in1,
106  const Avx512Type<ipUInt16>::Type& in2)
107  {
108  return _mm512_mask_blend_epi16(mask, in1, in2);
109  }
110 
111  static IPSDK_FORCEINLINE
112  void
113  act(const __mmask32& mask,
114  const Avx512Type<ipUInt16>::Type& in1,
115  const Avx512Type<ipUInt16>::Type& in2,
117  {
118  out = _mm512_mask_blend_epi16(mask, in1, in2);
119  }
120 };
121 
122 template <>
124 {
125  static IPSDK_FORCEINLINE
127  act(const __mmask16& mask,
128  const Avx512Type<ipInt32>::Type& in1,
129  const Avx512Type<ipInt32>::Type& in2)
130  {
131  return _mm512_mask_blend_epi32(mask, in1, in2);
132  }
133 
134  static IPSDK_FORCEINLINE
135  void
136  act(const __mmask16& mask,
137  const Avx512Type<ipInt32>::Type& in1,
138  const Avx512Type<ipInt32>::Type& in2,
140  {
141  out = _mm512_mask_blend_epi32(mask, in1, in2);
142  }
143 };
144 
145 template <>
147 {
148  static IPSDK_FORCEINLINE
150  act(const __mmask16& mask,
151  const Avx512Type<ipUInt32>::Type& in1,
152  const Avx512Type<ipUInt32>::Type& in2)
153  {
154  return _mm512_mask_blend_epi32(mask, in1, in2);
155  }
156 
157  static IPSDK_FORCEINLINE
158  void
159  act(const __mmask16& mask,
160  const Avx512Type<ipUInt32>::Type& in1,
161  const Avx512Type<ipUInt32>::Type& in2,
163  {
164  out = _mm512_mask_blend_epi32(mask, in1, in2);
165  }
166 };
167 
168 template <>
170 {
171  static IPSDK_FORCEINLINE
173  act(const __mmask8& mask,
174  const Avx512Type<ipInt64>::Type& in1,
175  const Avx512Type<ipInt64>::Type& in2)
176  {
177  return _mm512_mask_blend_epi64(mask, in1, in2);
178  }
179 
180  static IPSDK_FORCEINLINE
181  void
182  act(const __mmask8& mask,
183  const Avx512Type<ipInt64>::Type& in1,
184  const Avx512Type<ipInt64>::Type& in2,
186  {
187  out = _mm512_mask_blend_epi64(mask, in1, in2);
188  }
189 };
190 
191 template <>
193 {
194  static IPSDK_FORCEINLINE
196  act(const __mmask8& mask,
197  const Avx512Type<ipUInt64>::Type& in1,
198  const Avx512Type<ipUInt64>::Type& in2)
199  {
200  return _mm512_mask_blend_epi64(mask, in1, in2);
201  }
202 
203  static IPSDK_FORCEINLINE
204  void
205  act(const __mmask8& mask,
206  const Avx512Type<ipUInt64>::Type& in1,
207  const Avx512Type<ipUInt64>::Type& in2,
209  {
210  out = _mm512_mask_blend_epi64(mask, in1, in2);
211  }
212 };
213 
214 template <>
216 {
217  static IPSDK_FORCEINLINE
219  act(const __mmask16& mask,
220  const Avx512Type<ipReal32>::Type& in1,
221  const Avx512Type<ipReal32>::Type& in2)
222  {
223  return _mm512_mask_blend_ps(mask, in1, in2);
224  }
225 
226  static IPSDK_FORCEINLINE
227  void
228  act(const __mmask16& mask,
229  const Avx512Type<ipReal32>::Type& in1,
230  const Avx512Type<ipReal32>::Type& in2,
232  {
233  out = _mm512_mask_blend_ps(mask, in1, in2);
234  }
235 };
236 
237 template <>
239 {
240  static IPSDK_FORCEINLINE
242  act(const __mmask8& mask,
243  const Avx512Type<ipReal64>::Type& in1,
244  const Avx512Type<ipReal64>::Type& in2)
245  {
246  return _mm512_mask_blend_pd(mask, in1, in2);
247  }
248 
249  static IPSDK_FORCEINLINE
250  void
251  act(const __mmask8& mask,
252  const Avx512Type<ipReal64>::Type& in1,
253  const Avx512Type<ipReal64>::Type& in2,
255  {
256  out = _mm512_mask_blend_pd(mask, in1, in2);
257  }
258 };
259 
262 
263 } // end of namespace detail
264 } // end of namespace simd
265 } // end of namespace ipsdk
266 
267 #endif // __IPSDKUTIL_INSTRUCTIONSET_LOGICAL_DETAIL_AVX512_BITWISEANDREG_H__
int8_t ipInt8
Base types definition.
Definition: BaseTypes.h:48
Defines the IPSDK_FORCEINLINE.
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
uint64_t ipUInt64
Base types definition.
Definition: BaseTypes.h:55
double ipReal64
Base types definition.
Definition: BaseTypes.h:57
int32_t ipInt32
Base types definition.
Definition: BaseTypes.h:52
(including fundation and byte and word instructions)
Definition: InstructionSetTypes.h:51
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
Predefined types for Avx512 instruction set management.
Definition of import/export macro for library.
int64_t ipInt64
Base types definition.
Definition: BaseTypes.h:54
uint16_t ipUInt16
Base types definition.
Definition: BaseTypes.h:51
float ipReal32
Base types definition.
Definition: BaseTypes.h:56
Definition: MaskBlendReg.h:30
uint32_t ipUInt32
Base types definition.
Definition: BaseTypes.h:53
structure used to retrieve AVX512 type associated to a base type
Definition: Avx512Types.h:36