Blaze 3.9
Setall.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_SIMD_SETALL_H_
36#define _BLAZE_MATH_SIMD_SETALL_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
44#include <blaze/system/Inline.h>
47#include <blaze/util/EnableIf.h>
48#include <blaze/util/mpl/If.h>
50#include <blaze/util/Types.h>
54
55
56namespace blaze {
57
58//=================================================================================================
59//
60// 8-BIT INTEGRAL SIMD TYPES
61//
62//=================================================================================================
63
64//*************************************************************************************************
66#if BLAZE_AVX512F_MODE
67template< typename T >
68BLAZE_ALWAYS_INLINE const If_t< IsSigned_v<T>, SIMDint8, SIMDuint8 >
69 setall_epi8( T v0 = 0, T v1 = 0, T v2 = 0, T v3 = 0
70 , T v4 = 0, T v5 = 0, T v6 = 0, T v7 = 0
71 , T v8 = 0, T v9 = 0, T v10 = 0, T v11 = 0
72 , T v12 = 0, T v13 = 0, T v14 = 0, T v15 = 0
73 , T v16 = 0, T v17 = 0, T v18 = 0, T v19 = 0
74 , T v20 = 0, T v21 = 0, T v22 = 0, T v23 = 0
75 , T v24 = 0, T v25 = 0, T v26 = 0, T v27 = 0
76 , T v28 = 0, T v29 = 0, T v30 = 0, T v31 = 0
77 , T v32 = 0, T v33 = 0, T v34 = 0, T v35 = 0
78 , T v36 = 0, T v37 = 0, T v38 = 0, T v39 = 0
79 , T v40 = 0, T v41 = 0, T v42 = 0, T v43 = 0
80 , T v44 = 0, T v45 = 0, T v46 = 0, T v47 = 0
81 , T v48 = 0, T v49 = 0, T v50 = 0, T v51 = 0
82 , T v52 = 0, T v53 = 0, T v54 = 0, T v55 = 0
83 , T v56 = 0, T v57 = 0, T v58 = 0, T v59 = 0
84 , T v60 = 0, T v61 = 0, T v62 = 0, T v63 = 0 ) noexcept
85{
86 return _mm512_set_epi8( v63, v62, v61, v60, v59, v58, v57, v56, v55, v54, v53, v52, v51, v50, v49, v48
87 , v47, v46, v45, v44, v43, v42, v41, v40, v39, v38, v37, v36, v35, v34, v33, v32
88 , v31, v30, v29, v28, v27, v26, v25, v24, v23, v22, v21, v20, v19, v18, v17, v16
89 , v15, v14, v13, v12, v11, v10, v9, v8, v7, v6, v5, v4, v3, v2, v1, v0 );
90}
91#elif BLAZE_AVX_MODE
92template< typename T >
93BLAZE_ALWAYS_INLINE const If_t< IsSigned_v<T>, SIMDint8, SIMDuint8 >
94 setall_epi8( T v0 = 0, T v1 = 0, T v2 = 0, T v3 = 0
95 , T v4 = 0, T v5 = 0, T v6 = 0, T v7 = 0
96 , T v8 = 0, T v9 = 0, T v10 = 0, T v11 = 0
97 , T v12 = 0, T v13 = 0, T v14 = 0, T v15 = 0
98 , T v16 = 0, T v17 = 0, T v18 = 0, T v19 = 0
99 , T v20 = 0, T v21 = 0, T v22 = 0, T v23 = 0
100 , T v24 = 0, T v25 = 0, T v26 = 0, T v27 = 0
101 , T v28 = 0, T v29 = 0, T v30 = 0, T v31 = 0 ) noexcept
102{
103 return _mm256_set_epi8( v31, v30, v29, v28, v27, v26, v25, v24, v23, v22, v21, v20, v19, v18, v17, v16
104 , v15, v14, v13, v12, v11, v10, v9, v8, v7, v6, v5, v4, v3, v2, v1, v0 );
105}
106#elif BLAZE_SSE2_MODE
107template< typename T >
108BLAZE_ALWAYS_INLINE const If_t< IsSigned_v<T>, SIMDint8, SIMDuint8 >
109 setall_epi8( T v0 = 0, T v1 = 0, T v2 = 0, T v3 = 0
110 , T v4 = 0, T v5 = 0, T v6 = 0, T v7 = 0
111 , T v8 = 0, T v9 = 0, T v10 = 0, T v11 = 0
112 , T v12 = 0, T v13 = 0, T v14 = 0, T v15 = 0 ) noexcept
113{
114 return _mm_set_epi8( v15, v14, v13, v12, v11, v10, v9, v8, v7, v6, v5, v4, v3, v2, v1, v0 );
115}
116#else
117template< typename T >
118BLAZE_ALWAYS_INLINE const If_t< IsSigned_v<T>, SIMDint8, SIMDuint8 >
119 setall_epi8( T v0 = 0 ) noexcept
120{
121 return v0;
122}
123#endif
125//*************************************************************************************************
126
127
128//*************************************************************************************************
149template< typename T
150 , typename... Ts >
151BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v<T> && HasSize_v<T,1UL>
152 , If_t< IsSigned_v<T>, SIMDint8, SIMDuint8 > >
153 setall( T v0, Ts... vs ) noexcept
154{
155 return setall_epi8( v0, vs... );
156}
157//*************************************************************************************************
158
159
160//*************************************************************************************************
162#if BLAZE_AVX512F_MODE
163template< typename T >
164BLAZE_ALWAYS_INLINE const If_t< IsSigned_v<T>, SIMDcint8, SIMDcuint8 >
165 setall_epi8( const complex<T>& v0 = 0, const complex<T>& v1 = 0
166 , const complex<T>& v2 = 0, const complex<T>& v3 = 0
167 , const complex<T>& v4 = 0, const complex<T>& v5 = 0
168 , const complex<T>& v6 = 0, const complex<T>& v7 = 0
169 , const complex<T>& v8 = 0, const complex<T>& v9 = 0
170 , const complex<T>& v10 = 0, const complex<T>& v11 = 0
171 , const complex<T>& v12 = 0, const complex<T>& v13 = 0
172 , const complex<T>& v14 = 0, const complex<T>& v15 = 0
173 , const complex<T>& v16 = 0, const complex<T>& v17 = 0
174 , const complex<T>& v18 = 0, const complex<T>& v19 = 0
175 , const complex<T>& v20 = 0, const complex<T>& v21 = 0
176 , const complex<T>& v22 = 0, const complex<T>& v23 = 0
177 , const complex<T>& v24 = 0, const complex<T>& v25 = 0
178 , const complex<T>& v26 = 0, const complex<T>& v27 = 0
179 , const complex<T>& v28 = 0, const complex<T>& v29 = 0
180 , const complex<T>& v30 = 0, const complex<T>& v31 = 0 ) noexcept
181{
182 return _mm512_set_epi8( v31.imag(), v31.real(), v30.imag(), v30.real()
183 , v29.imag(), v29.real(), v28.imag(), v28.real()
184 , v27.imag(), v27.real(), v26.imag(), v26.real()
185 , v25.imag(), v25.real(), v24.imag(), v24.real()
186 , v23.imag(), v23.real(), v22.imag(), v22.real()
187 , v21.imag(), v21.real(), v20.imag(), v20.real()
188 , v19.imag(), v19.real(), v18.imag(), v18.real()
189 , v17.imag(), v17.real(), v16.imag(), v16.real()
190 , v15.imag(), v15.real(), v14.imag(), v14.real()
191 , v13.imag(), v13.real(), v12.imag(), v12.real()
192 , v11.imag(), v11.real(), v10.imag(), v10.real()
193 , v9.imag(), v9.real(), v8.imag(), v8.real()
194 , v7.imag(), v7.real(), v6.imag(), v6.real()
195 , v5.imag(), v5.real(), v4.imag(), v4.real()
196 , v3.imag(), v3.real(), v2.imag(), v2.real()
197 , v1.imag(), v1.real(), v0.imag(), v0.real() );
198}
199#elif BLAZE_AVX_MODE
200template< typename T >
201BLAZE_ALWAYS_INLINE const If_t< IsSigned_v<T>, SIMDcint8, SIMDcuint8 >
202 setall_epi8( const complex<T>& v0 = 0, const complex<T>& v1 = 0
203 , const complex<T>& v2 = 0, const complex<T>& v3 = 0
204 , const complex<T>& v4 = 0, const complex<T>& v5 = 0
205 , const complex<T>& v6 = 0, const complex<T>& v7 = 0
206 , const complex<T>& v8 = 0, const complex<T>& v9 = 0
207 , const complex<T>& v10 = 0, const complex<T>& v11 = 0
208 , const complex<T>& v12 = 0, const complex<T>& v13 = 0
209 , const complex<T>& v14 = 0, const complex<T>& v15 = 0 ) noexcept
210{
211 return _mm256_set_epi8( v15.imag(), v15.real(), v14.imag(), v14.real()
212 , v13.imag(), v13.real(), v12.imag(), v12.real()
213 , v11.imag(), v11.real(), v10.imag(), v10.real()
214 , v9.imag(), v9.real(), v8.imag(), v8.real()
215 , v7.imag(), v7.real(), v6.imag(), v6.real()
216 , v5.imag(), v5.real(), v4.imag(), v4.real()
217 , v3.imag(), v3.real(), v2.imag(), v2.real()
218 , v1.imag(), v1.real(), v0.imag(), v0.real() );
219}
220#elif BLAZE_SSE2_MODE
221template< typename T >
222BLAZE_ALWAYS_INLINE const If_t< IsSigned_v<T>, SIMDcint8, SIMDcuint8 >
223 setall_epi8( const complex<T>& v0 = 0, const complex<T>& v1 = 0
224 , const complex<T>& v2 = 0, const complex<T>& v3 = 0
225 , const complex<T>& v4 = 0, const complex<T>& v5 = 0
226 , const complex<T>& v6 = 0, const complex<T>& v7 = 0 ) noexcept
227{
228 return _mm_set_epi8( v7.imag(), v7.real(), v6.imag(), v6.real()
229 , v5.imag(), v5.real(), v4.imag(), v4.real()
230 , v3.imag(), v3.real(), v2.imag(), v2.real()
231 , v1.imag(), v1.real(), v0.imag(), v0.real() );
232}
233#else
234template< typename T >
235BLAZE_ALWAYS_INLINE const If_t< IsSigned_v<T>, SIMDcint8, SIMDcuint8 >
236 setall_epi8( const complex<T>& v0 = 0 ) noexcept
237{
238 return v0;
239}
240#endif
242//*************************************************************************************************
243
244
245//*************************************************************************************************
266template< typename T
267 , typename... Ts >
268BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v<T> && HasSize_v<T,1UL>
269 , If_t< IsSigned_v<T>, SIMDcint8, SIMDcuint8 > >
270 setall( const complex<T>& v0, const complex<Ts>&... vs ) noexcept
271{
272 return setall_epi8( v0, vs... );
273
274 BLAZE_STATIC_ASSERT( sizeof( complex<T> ) == 2UL*sizeof( T ) );
275}
276//*************************************************************************************************
277
278
279
280
281//=================================================================================================
282//
283// 16-BIT INTEGRAL SIMD TYPES
284//
285//=================================================================================================
286
287//*************************************************************************************************
289#if BLAZE_AVX512F_MODE
290template< typename T >
291BLAZE_ALWAYS_INLINE const If_t< IsSigned_v<T>, SIMDint16, SIMDuint16 >
292 setall_epi16( T v0 = 0, T v1 = 0, T v2 = 0, T v3 = 0
293 , T v4 = 0, T v5 = 0, T v6 = 0, T v7 = 0
294 , T v8 = 0, T v9 = 0, T v10 = 0, T v11 = 0
295 , T v12 = 0, T v13 = 0, T v14 = 0, T v15 = 0
296 , T v16 = 0, T v17 = 0, T v18 = 0, T v19 = 0
297 , T v20 = 0, T v21 = 0, T v22 = 0, T v23 = 0
298 , T v24 = 0, T v25 = 0, T v26 = 0, T v27 = 0
299 , T v28 = 0, T v29 = 0, T v30 = 0, T v31 = 0 ) noexcept
300{
301 return _mm512_set_epi16( v31, v30, v29, v28, v27, v26, v25, v24, v23, v22, v21, v20, v19, v18, v17, v16
302 , v15, v14, v13, v12, v11, v10, v9, v8, v7, v6, v5, v4, v3, v2, v1, v0 );
303}
304#elif BLAZE_AVX_MODE
305template< typename T >
306BLAZE_ALWAYS_INLINE const If_t< IsSigned_v<T>, SIMDint16, SIMDuint16 >
307 setall_epi16( T v0 = 0, T v1 = 0, T v2 = 0, T v3 = 0
308 , T v4 = 0, T v5 = 0, T v6 = 0, T v7 = 0
309 , T v8 = 0, T v9 = 0, T v10 = 0, T v11 = 0
310 , T v12 = 0, T v13 = 0, T v14 = 0, T v15 = 0 ) noexcept
311{
312 return _mm256_set_epi16( v15, v14, v13, v12, v11, v10, v9, v8, v7, v6, v5, v4, v3, v2, v1, v0 );
313}
314#elif BLAZE_SSE2_MODE
315template< typename T >
316BLAZE_ALWAYS_INLINE const If_t< IsSigned_v<T>, SIMDint16, SIMDuint16 >
317 setall_epi16( T v0 = 0, T v1 = 0, T v2 = 0, T v3 = 0
318 , T v4 = 0, T v5 = 0, T v6 = 0, T v7 = 0 ) noexcept
319{
320 return _mm_set_epi16( v7, v6, v5, v4, v3, v2, v1, v0 );
321}
322#else
323template< typename T >
324BLAZE_ALWAYS_INLINE const If_t< IsSigned_v<T>, SIMDint16, SIMDuint16 >
325 setall_epi16( T v0 = 0 ) noexcept
326{
327 return v0;
328}
329#endif
331//*************************************************************************************************
332
333
334//*************************************************************************************************
355template< typename T
356 , typename... Ts >
357BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v<T> && HasSize_v<T,2UL>
358 , If_t< IsSigned_v<T>, SIMDint16, SIMDuint16 > >
359 setall( T v0, Ts... vs ) noexcept
360{
361 return setall_epi16( v0, vs... );
362}
363//*************************************************************************************************
364
365
366//*************************************************************************************************
368#if BLAZE_AVX512F_MODE
369template< typename T >
370BLAZE_ALWAYS_INLINE const If_t< IsSigned_v<T>, SIMDcint16, SIMDcuint16 >
371 setall_epi16( const complex<T>& v0 = 0, const complex<T>& v1 = 0
372 , const complex<T>& v2 = 0, const complex<T>& v3 = 0
373 , const complex<T>& v4 = 0, const complex<T>& v5 = 0
374 , const complex<T>& v6 = 0, const complex<T>& v7 = 0
375 , const complex<T>& v8 = 0, const complex<T>& v9 = 0
376 , const complex<T>& v10 = 0, const complex<T>& v11 = 0
377 , const complex<T>& v12 = 0, const complex<T>& v13 = 0
378 , const complex<T>& v14 = 0, const complex<T>& v15 = 0 ) noexcept
379{
380 return _mm512_set_epi16( v15.imag(), v15.real(), v14.imag(), v14.real()
381 , v13.imag(), v13.real(), v12.imag(), v12.real()
382 , v11.imag(), v11.real(), v10.imag(), v10.real()
383 , v9.imag(), v9.real(), v8.imag(), v8.real()
384 , v7.imag(), v7.real(), v6.imag(), v6.real()
385 , v5.imag(), v5.real(), v4.imag(), v4.real()
386 , v3.imag(), v3.real(), v2.imag(), v2.real()
387 , v1.imag(), v1.real(), v0.imag(), v0.real() );
388}
389#elif BLAZE_AVX_MODE
390template< typename T >
391BLAZE_ALWAYS_INLINE const If_t< IsSigned_v<T>, SIMDcint16, SIMDcuint16 >
392 setall_epi16( const complex<T>& v0 = 0, const complex<T>& v1 = 0
393 , const complex<T>& v2 = 0, const complex<T>& v3 = 0
394 , const complex<T>& v4 = 0, const complex<T>& v5 = 0
395 , const complex<T>& v6 = 0, const complex<T>& v7 = 0 ) noexcept
396{
397 return _mm256_set_epi16( v7.imag(), v7.real(), v6.imag(), v6.real()
398 , v5.imag(), v5.real(), v4.imag(), v4.real()
399 , v3.imag(), v3.real(), v2.imag(), v2.real()
400 , v1.imag(), v1.real(), v0.imag(), v0.real() );
401}
402#elif BLAZE_SSE2_MODE
403template< typename T >
404BLAZE_ALWAYS_INLINE const If_t< IsSigned_v<T>, SIMDcint16, SIMDcuint16 >
405 setall_epi16( const complex<T>& v0 = 0, const complex<T>& v1 = 0
406 , const complex<T>& v2 = 0, const complex<T>& v3 = 0 ) noexcept
407{
408 return _mm_set_epi16( v3.imag(), v3.real(), v2.imag(), v2.real()
409 , v1.imag(), v1.real(), v0.imag(), v0.real() );
410}
411#else
412template< typename T >
413BLAZE_ALWAYS_INLINE const If_t< IsSigned_v<T>, SIMDcint16, SIMDcuint16 >
414 setall_epi16( const complex<T>& v0 = 0 ) noexcept
415{
416 return v0;
417}
418#endif
420//*************************************************************************************************
421
422
423//*************************************************************************************************
444template< typename T
445 , typename... Ts >
446BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v<T> && HasSize_v<T,2UL>
447 , If_t< IsSigned_v<T>, SIMDcint16, SIMDcuint16 > >
448 setall( const complex<T>& v0, const complex<Ts>&... vs ) noexcept
449{
450 return setall_epi16( v0, vs... );
451
452 BLAZE_STATIC_ASSERT( sizeof( complex<T> ) == 2UL*sizeof( T ) );
453}
454//*************************************************************************************************
455
456
457
458
459//=================================================================================================
460//
461// 32-BIT INTEGRAL SIMD TYPES
462//
463//=================================================================================================
464
465//*************************************************************************************************
467#if BLAZE_AVX512F_MODE
468template< typename T >
469BLAZE_ALWAYS_INLINE const If_t< IsSigned_v<T>, SIMDint32, SIMDuint32 >
470 setall_epi32( T v0 = 0, T v1 = 0, T v2 = 0, T v3 = 0
471 , T v4 = 0, T v5 = 0, T v6 = 0, T v7 = 0
472 , T v8 = 0, T v9 = 0, T v10 = 0, T v11 = 0
473 , T v12 = 0, T v13 = 0, T v14 = 0, T v15 = 0 ) noexcept
474{
475 return _mm512_set_epi32( v15, v14, v13, v12, v11, v10, v9, v8, v7, v6, v5, v4, v3, v2, v1, v0 );
476}
477#elif BLAZE_AVX_MODE
478template< typename T >
479BLAZE_ALWAYS_INLINE const If_t< IsSigned_v<T>, SIMDint32, SIMDuint32 >
480 setall_epi32( T v0 = 0, T v1 = 0, T v2 = 0, T v3 = 0
481 , T v4 = 0, T v5 = 0, T v6 = 0, T v7 = 0 ) noexcept
482{
483 return _mm256_set_epi32( v7, v6, v5, v4, v3, v2, v1, v0 );
484}
485#elif BLAZE_SSE2_MODE
486template< typename T >
487BLAZE_ALWAYS_INLINE const If_t< IsSigned_v<T>, SIMDint32, SIMDuint32 >
488 setall_epi32( T v0 = 0, T v1 = 0, T v2 = 0, T v3 = 0 ) noexcept
489{
490 return _mm_set_epi32( v3, v2, v1, v0 );
491}
492#else
493template< typename T >
494BLAZE_ALWAYS_INLINE const If_t< IsSigned_v<T>, SIMDint32, SIMDuint32 >
495 setall_epi32( T v0 = 0 ) noexcept
496{
497 return v0;
498}
499#endif
501//*************************************************************************************************
502
503
504//*************************************************************************************************
525template< typename T
526 , typename... Ts >
527BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v<T> && HasSize_v<T,4UL>
528 , If_t< IsSigned_v<T>, SIMDint32, SIMDuint32 > >
529 setall( T v0, Ts... vs ) noexcept
530{
531 return setall_epi32( v0, vs... );
532}
533//*************************************************************************************************
534
535
536//*************************************************************************************************
538#if BLAZE_AVX512F_MODE
539template< typename T >
540BLAZE_ALWAYS_INLINE const If_t< IsSigned_v<T>, SIMDcint32, SIMDcuint32 >
541 setall_epi32( const complex<T>& v0 = 0, const complex<T>& v1 = 0
542 , const complex<T>& v2 = 0, const complex<T>& v3 = 0
543 , const complex<T>& v4 = 0, const complex<T>& v5 = 0
544 , const complex<T>& v6 = 0, const complex<T>& v7 = 0 ) noexcept
545{
546 return _mm512_set_epi32( v7.imag(), v7.real(), v6.imag(), v6.real()
547 , v5.imag(), v5.real(), v4.imag(), v4.real()
548 , v3.imag(), v3.real(), v2.imag(), v2.real()
549 , v1.imag(), v1.real(), v0.imag(), v0.real() );
550}
551#elif BLAZE_AVX_MODE
552template< typename T >
553BLAZE_ALWAYS_INLINE const If_t< IsSigned_v<T>, SIMDcint32, SIMDcuint32 >
554 setall_epi32( const complex<T>& v0 = 0, const complex<T>& v1 = 0
555 , const complex<T>& v2 = 0, const complex<T>& v3 = 0 ) noexcept
556{
557 return _mm256_set_epi32( v3.imag(), v3.real(), v2.imag(), v2.real()
558 , v1.imag(), v1.real(), v0.imag(), v0.real() );
559}
560#elif BLAZE_SSE2_MODE
561template< typename T >
562BLAZE_ALWAYS_INLINE const If_t< IsSigned_v<T>, SIMDcint32, SIMDcuint32 >
563 setall_epi32( const complex<T>& v0 = 0, const complex<T>& v1 = 0 ) noexcept
564{
565 return _mm_set_epi32( v1.imag(), v1.real(), v0.imag(), v0.real() );
566}
567#else
568template< typename T >
569BLAZE_ALWAYS_INLINE const If_t< IsSigned_v<T>, SIMDcint32, SIMDcuint32 >
570 setall_epi32( const complex<T>& v0 = 0 ) noexcept
571{
572 return v0;
573}
574#endif
576//*************************************************************************************************
577
578
579//*************************************************************************************************
600template< typename T
601 , typename... Ts >
602BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v<T> && HasSize_v<T,4UL>
603 , If_t< IsSigned_v<T>, SIMDcint32, SIMDcuint32 > >
604 setall( const complex<T>& v0, const complex<Ts>&... vs ) noexcept
605{
606 return setall_epi32( v0, vs... );
607
608 BLAZE_STATIC_ASSERT( sizeof( complex<T> ) == 2UL*sizeof( T ) );
609}
610//*************************************************************************************************
611
612
613
614
615//=================================================================================================
616//
617// 64-BIT INTEGRAL SIMD TYPES
618//
619//=================================================================================================
620
621//*************************************************************************************************
623#if BLAZE_AVX512F_MODE
624template< typename T >
625BLAZE_ALWAYS_INLINE const If_t< IsSigned_v<T>, SIMDint64, SIMDuint64 >
626 setall_epi64( T v0 = 0, T v1 = 0, T v2 = 0, T v3 = 0
627 , T v4 = 0, T v5 = 0, T v6 = 0, T v7 = 0 ) noexcept
628{
629 return _mm512_set_epi64( v7, v6, v5, v4, v3, v2, v1, v0 );
630}
631#elif BLAZE_AVX_MODE
632template< typename T >
633BLAZE_ALWAYS_INLINE const If_t< IsSigned_v<T>, SIMDint64, SIMDuint64 >
634 setall_epi64( T v0 = 0, T v1 = 0, T v2 = 0, T v3 = 0 ) noexcept
635{
636 return _mm256_set_epi64x( v3, v2, v1, v0 );
637}
638#elif BLAZE_SSE2_MODE
639template< typename T >
640BLAZE_ALWAYS_INLINE const If_t< IsSigned_v<T>, SIMDint64, SIMDuint64 >
641 setall_epi64( T v0 = 0, T v1 = 0 ) noexcept
642{
643 return _mm_set_epi64x( v1, v0 );
644}
645#else
646template< typename T >
647BLAZE_ALWAYS_INLINE const If_t< IsSigned_v<T>, SIMDint64, SIMDuint64 >
648 setall_epi64( T v0 = 0 ) noexcept
649{
650 return v0;
651}
652#endif
654//*************************************************************************************************
655
656
657//*************************************************************************************************
678template< typename T
679 , typename... Ts >
680BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v<T> && HasSize_v<T,8UL>
681 , If_t< IsSigned_v<T>, SIMDint64, SIMDuint64 > >
682 setall( T v0, Ts... vs ) noexcept
683{
684 return setall_epi64( v0, vs... );
685}
686//*************************************************************************************************
687
688
689//*************************************************************************************************
691#if BLAZE_AVX512F_MODE
692template< typename T >
693BLAZE_ALWAYS_INLINE const If_t< IsSigned_v<T>, SIMDcint64, SIMDcuint64 >
694 setall_epi64( const complex<T>& v0 = 0, const complex<T>& v1 = 0
695 , const complex<T>& v2 = 0, const complex<T>& v3 = 0 ) noexcept
696{
697 return _mm512_set_epi64( v3.imag(), v3.real(), v2.imag(), v2.real()
698 , v1.imag(), v1.real(), v0.imag(), v0.real() );
699}
700#elif BLAZE_AVX_MODE
701template< typename T >
702BLAZE_ALWAYS_INLINE const If_t< IsSigned_v<T>, SIMDcint64, SIMDcuint64 >
703 setall_epi64( const complex<T>& v0 = 0, const complex<T>& v1 = 0 ) noexcept
704{
705 return _mm256_set_epi64x( v1.imag(), v1.real(), v0.imag(), v0.real() );
706}
707#elif BLAZE_SSE2_MODE
708template< typename T >
709BLAZE_ALWAYS_INLINE const If_t< IsSigned_v<T>, SIMDcint64, SIMDcuint64 >
710 setall_epi64( const complex<T>& v0 = 0 ) noexcept
711{
712 return _mm_set_epi64x( v0.imag(), v0.real() );
713}
714#else
715template< typename T >
716BLAZE_ALWAYS_INLINE const If_t< IsSigned_v<T>, SIMDcint64, SIMDcuint64 >
717 setall_epi64( const complex<T>& v0 = 0 ) noexcept
718{
719 return v0;
720}
721#endif
723//*************************************************************************************************
724
725
726//*************************************************************************************************
747template< typename T
748 , typename... Ts >
749BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v<T> && HasSize_v<T,8UL>
750 , If_t< IsSigned_v<T>, SIMDcint64, SIMDcuint64 > >
751 setall( const complex<T>& v0, const complex<Ts>&... vs ) noexcept
752{
753 return setall_epi64( v0, vs... );
754
755 BLAZE_STATIC_ASSERT( sizeof( complex<T> ) == 2UL*sizeof( T ) );
756}
757//*************************************************************************************************
758
759
760
761
762//=================================================================================================
763//
764// 32-BIT FLOATING POINT SIMD TYPES
765//
766//=================================================================================================
767
768//*************************************************************************************************
770#if BLAZE_AVX512F_MODE
772 setall_ps( float v0 = 0.0F, float v1 = 0.0F, float v2 = 0.0F, float v3 = 0.0F
773 , float v4 = 0.0F, float v5 = 0.0F, float v6 = 0.0F, float v7 = 0.0F
774 , float v8 = 0.0F, float v9 = 0.0F, float v10 = 0.0F, float v11 = 0.0F
775 , float v12 = 0.0F, float v13 = 0.0F, float v14 = 0.0F, float v15 = 0.0F ) noexcept
776{
777 return _mm512_set_ps( v15, v14, v13, v12, v11, v10, v9, v8, v7, v6, v5, v4, v3, v2, v1, v0 );
778}
779#elif BLAZE_AVX_MODE
781 setall_ps( float v0 = 0.0F, float v1 = 0.0F, float v2 = 0.0F, float v3 = 0.0F
782 , float v4 = 0.0F, float v5 = 0.0F, float v6 = 0.0F, float v7 = 0.0F ) noexcept
783{
784 return _mm256_set_ps( v7, v6, v5, v4, v3, v2, v1, v0 );
785}
786#elif BLAZE_SSE_MODE
788 setall_ps( float v0 = 0.0F, float v1 = 0.0F, float v2 = 0.0F, float v3 = 0.0F ) noexcept
789{
790 return _mm_set_ps( v3, v2, v1, v0 );
791}
792#else
794 setall_ps( float v1 = 0.0F, float v0 = 0.0F ) noexcept
795{
796 return v0;
797}
798#endif
800//*************************************************************************************************
801
802
803//*************************************************************************************************
824template< typename... Ts >
825SIMDfloat setall( float v0, Ts... vs ) noexcept
826{
827 return setall_ps( v0, vs... );
828}
829//*************************************************************************************************
830
831
832//*************************************************************************************************
834#if BLAZE_AVX512F_MODE
836 setall_ps( const complex<float>& v0 = 0.0F, const complex<float>& v1 = 0.0F
837 , const complex<float>& v2 = 0.0F, const complex<float>& v3 = 0.0F
838 , const complex<float>& v4 = 0.0F, const complex<float>& v5 = 0.0F
839 , const complex<float>& v6 = 0.0F, const complex<float>& v7 = 0.0F ) noexcept
840{
841 return _mm512_set_ps( v7.imag(), v7.real(), v6.imag(), v6.real()
842 , v5.imag(), v5.real(), v4.imag(), v4.real()
843 , v3.imag(), v3.real(), v2.imag(), v2.real()
844 , v1.imag(), v1.real(), v0.imag(), v0.real() );
845}
846#elif BLAZE_AVX_MODE
848 setall_ps( const complex<float>& v0 = 0.0F, const complex<float>& v1 = 0.0F
849 , const complex<float>& v2 = 0.0F, const complex<float>& v3 = 0.0F ) noexcept
850{
851 return _mm256_set_ps( v3.imag(), v3.real(), v2.imag(), v2.real()
852 , v1.imag(), v1.real(), v0.imag(), v0.real() );
853}
854#elif BLAZE_SSE_MODE
856 setall_ps( const complex<float>& v0 = 0.0F, const complex<float>& v1 = 0.0F ) noexcept
857{
858 return _mm_set_ps( v1.imag(), v1.real(), v0.imag(), v0.real() );
859}
860#else
862 setall_ps( const complex<float>& v0 = 0.0F ) noexcept
863{
864 return v0;
865}
866#endif
868//*************************************************************************************************
869
870
871//*************************************************************************************************
892template< typename... Ts >
893SIMDcfloat setall( const complex<float>& v0, Ts... vs ) noexcept
894{
895 return setall_ps( v0, vs... );
896
897 BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
898}
899//*************************************************************************************************
900
901
902
903
904//=================================================================================================
905//
906// 64-BIT FLOATING POINT SIMD TYPES
907//
908//=================================================================================================
909
910//*************************************************************************************************
912#if BLAZE_AVX512F_MODE
914 setall_pd( double v0 = 0.0, double v1 = 0.0, double v2 = 0.0, double v3 = 0.0
915 , double v4 = 0.0, double v5 = 0.0, double v6 = 0.0, double v7 = 0.0 ) noexcept
916{
917 return _mm512_set_pd( v7, v6, v5, v4, v3, v2, v1, v0 );
918}
919#elif BLAZE_AVX_MODE
921 setall_pd( double v0 = 0.0, double v1 = 0.0, double v2 = 0.0, double v3 = 0.0 ) noexcept
922{
923 return _mm256_set_pd( v3, v2, v1, v0 );
924}
925#elif BLAZE_SSE2_MODE
927 setall_pd( double v0 = 0.0, double v1 = 0.0 ) noexcept
928{
929 return _mm_set_pd( v1, v0 );
930}
931#else
933 setall_pd( double v0 = 0.0 ) noexcept
934{
935 return v0;
936}
937#endif
939//*************************************************************************************************
940
941
942//*************************************************************************************************
963template< typename... Ts >
964SIMDdouble setall( double v0, Ts... vs ) noexcept
965{
966 return setall_pd( v0, vs... );
967}
968//*************************************************************************************************
969
970
971//*************************************************************************************************
973#if BLAZE_AVX512F_MODE
975 setall_pd( const complex<double>& v0 = 0.0, const complex<double>& v1 = 0.0
976 , const complex<double>& v2 = 0.0, const complex<double>& v3 = 0.0 ) noexcept
977{
978 return _mm512_set_pd( v3.imag(), v3.real(), v2.imag(), v2.real()
979 , v1.imag(), v1.real(), v0.imag(), v0.real() );
980}
981#elif BLAZE_AVX_MODE
983 setall_pd( const complex<double>& v0 = 0.0, const complex<double>& v1 = 0.0 ) noexcept
984{
985 return _mm256_set_pd( v1.imag(), v1.real(), v0.imag(), v0.real() );
986}
987#elif BLAZE_SSE2_MODE
989 setall_pd( const complex<double>& v0 = 0.0 ) noexcept
990{
991 return _mm_set_pd( v0.imag(), v0.real() );
992}
993#else
995 setall_pd( const complex<double>& v0 = 0.0 ) noexcept
996{
997 return v0;
998}
999#endif
1001//*************************************************************************************************
1002
1003
1004//*************************************************************************************************
1025template< typename... Ts >
1026SIMDcdouble setall( const complex<double>& v0, Ts... vs ) noexcept
1027{
1028 return setall_pd( v0, vs... );
1029
1030 BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
1031}
1032//*************************************************************************************************
1033
1034} // namespace blaze
1035
1036#endif
Header file for the basic SIMD types.
Header file for the EnableIf class template.
Header file for the HasSize type trait.
Header file for the If class template.
Constraint on the data type.
Header file for the IsIntegral type trait.
Header file for the IsSigned type trait.
Compile time assertion.
SIMD type for 64-bit double precision complex values.
SIMD type for 32-bit single precision complex values.
SIMD type for 16-bit signed integral complex values.
SIMD type for 32-bit signed integral complex values.
SIMD type for 64-bit signed integral complex values.
SIMD type for 8-bit signed integral complex values.
SIMD type for 16-bit unsigned integral complex values.
SIMD type for 32-bit unsigned integral complex values.
SIMD type for 64-bit unsigned integral complex values.
SIMD type for 8-bit unsigned integral complex values.
SIMD type for 64-bit double precision floating point data values.
SIMD type for 32-bit single precision floating point data values.
SIMD type for 16-bit signed integral data values.
SIMD type for 32-bit signed integral data values.
SIMD type for 64-bit integral data values.
SIMD type for 8-bit signed integral data values.
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.
Complex data type of the Blaze library.
SIMDcdouble setall(const complex< double > &v0, Ts... vs) noexcept
Sets all values in the vector to the given complex<double> values.
Definition: Setall.h:1026
#define BLAZE_STATIC_ASSERT(expr)
Compile time assertion macro.
Definition: StaticAssert.h:112
#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.
Header file for basic type definitions.