Blaze 3.9
Bitand.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_SIMD_BITAND_H_
36#define _BLAZE_MATH_SIMD_BITAND_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
44#include <blaze/system/Inline.h>
46
47
48namespace blaze {
49
50//=================================================================================================
51//
52// 8-BIT INTEGRAL SIMD TYPES
53//
54//=================================================================================================
55
56//*************************************************************************************************
66template< typename T > // Type of both operands
68 operator&( const SIMDi8<T>& a, const SIMDi8<T>& b ) noexcept
69#if BLAZE_AVX512F_MODE || BLAZE_MIC_MODE
70{
71 return _mm512_and_si512( (*a).value, (*b).value );
72}
73#elif BLAZE_AVX2_MODE
74{
75 return _mm256_and_si256( (*a).value, (*b).value );
76}
77#elif BLAZE_SSE2_MODE
78{
79 return _mm_and_si128( (*a).value, (*b).value );
80}
81#else
82= delete;
83#endif
84//*************************************************************************************************
85
86
87//*************************************************************************************************
97template< typename T1 // Type of the left-hand side operand
98 , typename T2 > // Type of the right-hand side operand
100 operator&( const SIMDi8<T1>& a, const SIMDi8<T2>& b ) noexcept
101#if BLAZE_AVX512F_MODE || BLAZE_MIC_MODE
102{
103 return _mm512_and_si512( (*a).value, (*b).value );
104}
105#elif BLAZE_AVX2_MODE
106{
107 return _mm256_and_si256( (*a).value, (*b).value );
108}
109#elif BLAZE_SSE2_MODE
110{
111 return _mm_and_si128( (*a).value, (*b).value );
112}
113#else
114= delete;
115#endif
116//*************************************************************************************************
117
118
119//*************************************************************************************************
129template< typename T > // Type of both operands
131 operator&( const SIMDci8<T>& a, const SIMDci8<T>& b ) noexcept
132#if BLAZE_AVX512F_MODE || BLAZE_MIC_MODE
133{
134 return _mm512_and_si512( (*a).value, (*b).value );
135}
136#elif BLAZE_AVX2_MODE
137{
138 return _mm256_and_si256( (*a).value, (*b).value );
139}
140#elif BLAZE_SSE2_MODE
141{
142 return _mm_and_si128( (*a).value, (*b).value );
143}
144#else
145= delete;
146#endif
147//*************************************************************************************************
148
149
150
151
152//=================================================================================================
153//
154// 16-BIT INTEGRAL SIMD TYPES
155//
156//=================================================================================================
157
158//*************************************************************************************************
168template< typename T > // Type of both operands
170 operator&( const SIMDi16<T>& a, const SIMDi16<T>& b ) noexcept
171#if BLAZE_AVX512F_MODE || BLAZE_MIC_MODE
172{
173 return _mm512_and_si512( (*a).value, (*b).value );
174}
175#elif BLAZE_AVX2_MODE
176{
177 return _mm256_and_si256( (*a).value, (*b).value );
178}
179#elif BLAZE_SSE2_MODE
180{
181 return _mm_and_si128( (*a).value, (*b).value );
182}
183#else
184= delete;
185#endif
186//*************************************************************************************************
187
188
189//*************************************************************************************************
199template< typename T1 // Type of the left-hand side operand
200 , typename T2 > // Type of the right-hand side operand
202 operator&( const SIMDi16<T1>& a, const SIMDi16<T2>& b ) noexcept
203#if BLAZE_AVX512F_MODE || BLAZE_MIC_MODE
204{
205 return _mm512_and_si512( (*a).value, (*b).value );
206}
207#elif BLAZE_AVX2_MODE
208{
209 return _mm256_and_si256( (*a).value, (*b).value );
210}
211#elif BLAZE_SSE2_MODE
212{
213 return _mm_and_si128( (*a).value, (*b).value );
214}
215#else
216= delete;
217#endif
218//*************************************************************************************************
219
220
221//*************************************************************************************************
231template< typename T > // Type of both operands
233 operator&( const SIMDci16<T>& a, const SIMDci16<T>& b ) noexcept
234#if BLAZE_AVX512F_MODE || BLAZE_MIC_MODE
235{
236 return _mm512_and_si512( (*a).value, (*b).value );
237}
238#elif BLAZE_AVX2_MODE
239{
240 return _mm256_and_si256( (*a).value, (*b).value );
241}
242#elif BLAZE_SSE2_MODE
243{
244 return _mm_and_si128( (*a).value, (*b).value );
245}
246#else
247= delete;
248#endif
249//*************************************************************************************************
250
251
252
253
254//=================================================================================================
255//
256// 32-BIT INTEGRAL SIMD TYPES
257//
258//=================================================================================================
259
260//*************************************************************************************************
270template< typename T > // Type of both operands
272 operator&( const SIMDi32<T>& a, const SIMDi32<T>& b ) noexcept
273#if BLAZE_AVX512F_MODE || BLAZE_MIC_MODE
274{
275 return _mm512_and_si512( (*a).value, (*b).value );
276}
277#elif BLAZE_AVX2_MODE
278{
279 return _mm256_and_si256( (*a).value, (*b).value );
280}
281#elif BLAZE_SSE2_MODE
282{
283 return _mm_and_si128( (*a).value, (*b).value );
284}
285#else
286= delete;
287#endif
288//*************************************************************************************************
289
290
291//*************************************************************************************************
301template< typename T1 // Type of the left-hand side operand
302 , typename T2 > // Type of the right-hand side operand
304 operator&( const SIMDi32<T1>& a, const SIMDi32<T2>& b ) noexcept
305#if BLAZE_AVX512F_MODE || BLAZE_MIC_MODE
306{
307 return _mm512_and_si512( (*a).value, (*b).value );
308}
309#elif BLAZE_AVX2_MODE
310{
311 return _mm256_and_si256( (*a).value, (*b).value );
312}
313#elif BLAZE_SSE2_MODE
314{
315 return _mm_and_si128( (*a).value, (*b).value );
316}
317#else
318= delete;
319#endif
320//*************************************************************************************************
321
322
323//*************************************************************************************************
333template< typename T > // Type of both operands
335 operator&( const SIMDci32<T>& a, const SIMDci32<T>& b ) noexcept
336#if BLAZE_AVX512F_MODE || BLAZE_MIC_MODE
337{
338 return _mm512_and_si512( (*a).value, (*b).value );
339}
340#elif BLAZE_AVX2_MODE
341{
342 return _mm256_and_si256( (*a).value, (*b).value );
343}
344#elif BLAZE_SSE2_MODE
345{
346 return _mm_and_si128( (*a).value, (*b).value );
347}
348#else
349= delete;
350#endif
351//*************************************************************************************************
352
353
354
355
356//=================================================================================================
357//
358// 64-BIT INTEGRAL SIMD TYPES
359//
360//=================================================================================================
361
362//*************************************************************************************************
372template< typename T > // Type of the left-hand side operand
374 operator&( const SIMDi64<T>& a, const SIMDi64<T>& b ) noexcept
375#if BLAZE_AVX512F_MODE || BLAZE_MIC_MODE
376{
377 return _mm512_and_si512( (*a).value, (*b).value );
378}
379#elif BLAZE_AVX2_MODE
380{
381 return _mm256_and_si256( (*a).value, (*b).value );
382}
383#elif BLAZE_SSE2_MODE
384{
385 return _mm_and_si128( (*a).value, (*b).value );
386}
387#else
388= delete;
389#endif
390//*************************************************************************************************
391
392
393//*************************************************************************************************
403template< typename T1 // Type of the left-hand side operand
404 , typename T2 > // Type of the right-hand side operand
406 operator&( const SIMDi64<T1>& a, const SIMDi64<T2>& b ) noexcept
407#if BLAZE_AVX512F_MODE || BLAZE_MIC_MODE
408{
409 return _mm512_and_si512( (*a).value, (*b).value );
410}
411#elif BLAZE_AVX2_MODE
412{
413 return _mm256_and_si256( (*a).value, (*b).value );
414}
415#elif BLAZE_SSE2_MODE
416{
417 return _mm_and_si128( (*a).value, (*b).value );
418}
419#else
420= delete;
421#endif
422//*************************************************************************************************
423
424
425//*************************************************************************************************
435template< typename T > // Type of both operands
437 operator&( const SIMDci64<T>& a, const SIMDci64<T>& b ) noexcept
438#if BLAZE_AVX512F_MODE || BLAZE_MIC_MODE
439{
440 return _mm512_and_si512( (*a).value, (*b).value );
441}
442#elif BLAZE_AVX2_MODE
443{
444 return _mm256_and_si256( (*a).value, (*b).value );
445}
446#elif BLAZE_SSE2_MODE
447{
448 return _mm_and_si128( (*a).value, (*b).value );
449}
450#else
451= delete;
452#endif
453//*************************************************************************************************
454
455} // namespace blaze
456
457#endif
Header file for the basic SIMD types.
SIMD type for 16-bit unsigned integral data values.
SIMD type for 32-bit unsigned integral data values.
SIMD type for 64-bit unsigned integral data values.
SIMD type for 8-bit unsigned integral data values.
BLAZE_ALWAYS_INLINE const T operator&(const SIMDci64< T > &a, const SIMDci64< T > &b) noexcept=delete
Bitwise AND ('&') of two vectors of 64-bit integral complex SIMD values.
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
System settings for the inline keywords.
System settings for the SSE mode.