35 #ifndef _BLAZE_MATH_INTRINSICS_INTRINSICTRAIT_H_
36 #define _BLAZE_MATH_INTRINSICS_INTRINSICTRAIT_H_
68 template<
bool C,
size_t N >
69 struct IntrinsicTraitHelper;
81 struct IntrinsicTraitHelper<false,1UL>
83 typedef simd_int8_t Type;
94 struct IntrinsicTraitHelper<false,1UL>
96 typedef simd_int8_t Type;
117 struct IntrinsicTraitHelper<false,2UL>
119 typedef simd_int16_t Type;
130 struct IntrinsicTraitHelper<false,2UL>
132 typedef simd_int16_t Type;
153 struct IntrinsicTraitHelper<false,4UL>
155 typedef simd_int32_t Type;
164 #elif BLAZE_AVX2_MODE
166 struct IntrinsicTraitHelper<false,4UL>
168 typedef simd_int32_t Type;
179 struct IntrinsicTraitHelper<false,4UL>
181 typedef simd_int32_t Type;
202 struct IntrinsicTraitHelper<false,8UL>
204 typedef simd_int64_t Type;
213 #elif BLAZE_AVX2_MODE
215 struct IntrinsicTraitHelper<false,8UL>
217 typedef simd_int64_t Type;
228 struct IntrinsicTraitHelper<false,8UL>
230 typedef simd_int64_t Type;
251 struct IntrinsicTraitHelper<true,1UL>
253 typedef simd_cint8_t Type;
264 struct IntrinsicTraitHelper<true,1UL>
266 typedef simd_cint8_t Type;
287 struct IntrinsicTraitHelper<true,2UL>
289 typedef simd_cint16_t Type;
300 struct IntrinsicTraitHelper<true,2UL>
302 typedef simd_cint16_t Type;
323 struct IntrinsicTraitHelper<true,4UL>
325 typedef simd_cint32_t Type;
334 #elif BLAZE_AVX2_MODE
336 struct IntrinsicTraitHelper<true,4UL>
338 typedef simd_cint32_t Type;
349 struct IntrinsicTraitHelper<true,4UL>
351 typedef simd_cint32_t Type;
372 struct IntrinsicTraitHelper<true,8UL>
374 typedef simd_cint64_t Type;
383 #elif BLAZE_AVX2_MODE
385 struct IntrinsicTraitHelper<true,8UL>
387 typedef simd_cint64_t Type;
398 struct IntrinsicTraitHelper<true,8UL>
400 typedef simd_cint64_t Type;
427 template<
typename T >
428 struct IntrinsicTraitBase
432 alignment = AlignmentOf<T>::value,
450 struct IntrinsicTraitBase<char>
453 typedef IntrinsicTraitHelper<false,sizeof(char)> Helper;
456 typedef Helper::Type Type;
458 alignment = AlignmentOf<char>::value,
459 addition = Helper::addition,
460 subtraction = Helper::subtraction,
461 multiplication = Helper::multiplication,
462 division = Helper::division,
463 absoluteValue = Helper::absoluteValue,
476 struct IntrinsicTraitBase<signed char>
479 typedef IntrinsicTraitHelper<false,sizeof(signed char)> Helper;
482 typedef Helper::Type Type;
484 alignment = AlignmentOf<signed char>::value,
485 addition = Helper::addition,
486 subtraction = Helper::subtraction,
487 multiplication = Helper::multiplication,
488 division = Helper::division,
489 absoluteValue = Helper::absoluteValue,
502 struct IntrinsicTraitBase<unsigned char>
505 typedef IntrinsicTraitHelper<false,sizeof(unsigned char)> Helper;
508 typedef Helper::Type Type;
510 alignment = AlignmentOf<unsigned char>::value,
511 addition = Helper::addition,
512 subtraction = Helper::subtraction,
513 multiplication = Helper::multiplication,
514 division = Helper::division,
528 struct IntrinsicTraitBase<wchar_t>
531 typedef IntrinsicTraitHelper<false,sizeof(wchar_t)> Helper;
534 typedef Helper::Type Type;
536 alignment = AlignmentOf<wchar_t>::value,
537 addition = Helper::addition,
538 subtraction = Helper::subtraction,
539 multiplication = Helper::multiplication,
540 division = Helper::division,
541 absoluteValue = Helper::absoluteValue,
554 struct IntrinsicTraitBase<short>
557 typedef IntrinsicTraitHelper<false,sizeof(short)> Helper;
560 typedef Helper::Type Type;
562 alignment = AlignmentOf<short>::value,
563 addition = Helper::addition,
564 subtraction = Helper::subtraction,
565 multiplication = Helper::multiplication,
566 division = Helper::division,
567 absoluteValue = Helper::absoluteValue,
580 struct IntrinsicTraitBase<unsigned short>
583 typedef IntrinsicTraitHelper<false,sizeof(unsigned short)> Helper;
586 typedef Helper::Type Type;
588 alignment = AlignmentOf<unsigned short>::value,
589 addition = Helper::addition,
590 subtraction = Helper::subtraction,
591 multiplication = Helper::multiplication,
592 division = Helper::division,
606 struct IntrinsicTraitBase<int>
609 typedef IntrinsicTraitHelper<false,sizeof(int)> Helper;
612 typedef Helper::Type Type;
614 alignment = AlignmentOf<int>::value,
615 addition = Helper::addition,
616 subtraction = Helper::subtraction,
617 multiplication = Helper::multiplication,
618 division = Helper::division,
619 absoluteValue = Helper::absoluteValue,
632 struct IntrinsicTraitBase<unsigned int>
635 typedef IntrinsicTraitHelper<false,sizeof(unsigned int)> Helper;
638 typedef Helper::Type Type;
640 alignment = AlignmentOf<unsigned int>::value,
641 addition = Helper::addition,
642 subtraction = Helper::subtraction,
643 multiplication = Helper::multiplication,
644 division = Helper::division,
658 struct IntrinsicTraitBase<long>
661 typedef IntrinsicTraitHelper<false,sizeof(long)> Helper;
664 typedef Helper::Type Type;
666 alignment = AlignmentOf<long>::value,
667 addition = Helper::addition,
668 subtraction = Helper::subtraction,
669 multiplication = Helper::multiplication,
670 division = Helper::division,
671 absoluteValue = Helper::absoluteValue,
684 struct IntrinsicTraitBase<unsigned long>
687 typedef IntrinsicTraitHelper<false,sizeof(unsigned long)> Helper;
690 typedef Helper::Type Type;
692 alignment = AlignmentOf<unsigned long>::value,
693 addition = Helper::addition,
694 subtraction = Helper::subtraction,
695 multiplication = Helper::multiplication,
696 division = Helper::division,
710 struct IntrinsicTraitBase<float>
712 typedef simd_float_t Type;
713 enum {
size = ( 64UL /
sizeof(float) ),
714 alignment = AlignmentOf<float>::value,
724 struct IntrinsicTraitBase<float>
726 typedef simd_float_t Type;
727 enum {
size = ( 32UL /
sizeof(float) ),
728 alignment = AlignmentOf<float>::value,
738 struct IntrinsicTraitBase<float>
740 typedef simd_float_t Type;
742 alignment = AlignmentOf<float>::value,
762 struct IntrinsicTraitBase<double>
764 typedef simd_double_t Type;
765 enum {
size = ( 64UL /
sizeof(double) ),
766 alignment = AlignmentOf<double>::value,
776 struct IntrinsicTraitBase<double>
778 typedef simd_double_t Type;
779 enum {
size = ( 32UL /
sizeof(double) ),
780 alignment = AlignmentOf<double>::value,
790 struct IntrinsicTraitBase<double>
792 typedef simd_double_t Type;
794 alignment = AlignmentOf<double>::value,
813 struct IntrinsicTraitBase< complex<char> >
816 typedef IntrinsicTraitHelper<true,sizeof(char)> Helper;
819 typedef Helper::Type Type;
821 alignment = AlignmentOf< complex<char> >::value,
822 addition = Helper::addition,
823 subtraction = Helper::subtraction,
824 multiplication = Helper::multiplication,
825 division = Helper::division,
826 absoluteValue = Helper::absoluteValue,
841 struct IntrinsicTraitBase< complex<signed char> >
844 typedef IntrinsicTraitHelper<true,sizeof(signed char)> Helper;
847 typedef Helper::Type Type;
849 alignment = AlignmentOf< complex<signed char> >::value,
850 addition = Helper::addition,
851 subtraction = Helper::subtraction,
852 multiplication = Helper::multiplication,
853 division = Helper::division,
854 absoluteValue = Helper::absoluteValue,
869 struct IntrinsicTraitBase< complex<unsigned char> >
872 typedef IntrinsicTraitHelper<true,sizeof(unsigned char)> Helper;
875 typedef Helper::Type Type;
877 alignment = AlignmentOf< complex<unsigned char> >::value,
878 addition = Helper::addition,
879 subtraction = Helper::subtraction,
880 multiplication = Helper::multiplication,
881 division = Helper::division,
897 struct IntrinsicTraitBase< complex<wchar_t> >
900 typedef IntrinsicTraitHelper<true,sizeof(wchar_t)> Helper;
903 typedef Helper::Type Type;
905 alignment = AlignmentOf< complex<wchar_t> >::value,
906 addition = Helper::addition,
907 subtraction = Helper::subtraction,
908 multiplication = Helper::multiplication,
909 division = Helper::division,
910 absoluteValue = Helper::absoluteValue,
925 struct IntrinsicTraitBase< complex<short> >
928 typedef IntrinsicTraitHelper<true,sizeof(short)> Helper;
931 typedef Helper::Type Type;
933 alignment = AlignmentOf< complex<short> >::value,
934 addition = Helper::addition,
935 subtraction = Helper::subtraction,
936 multiplication = Helper::multiplication,
937 division = Helper::division,
938 absoluteValue = Helper::absoluteValue,
953 struct IntrinsicTraitBase< complex<unsigned short> >
956 typedef IntrinsicTraitHelper<true,sizeof(unsigned short)> Helper;
959 typedef Helper::Type Type;
961 alignment = AlignmentOf< complex<unsigned short> >::value,
962 addition = Helper::addition,
963 subtraction = Helper::subtraction,
964 multiplication = Helper::multiplication,
965 division = Helper::division,
981 struct IntrinsicTraitBase< complex<int> >
984 typedef IntrinsicTraitHelper<true,sizeof(int)> Helper;
987 typedef Helper::Type Type;
989 alignment = AlignmentOf< complex<int> >::value,
990 addition = Helper::addition,
991 subtraction = Helper::subtraction,
992 multiplication = Helper::multiplication,
993 division = Helper::division,
994 absoluteValue = Helper::absoluteValue,
1009 struct IntrinsicTraitBase< complex<unsigned int> >
1012 typedef IntrinsicTraitHelper<true,sizeof(unsigned int)> Helper;
1015 typedef Helper::Type Type;
1017 alignment = AlignmentOf< complex<unsigned int> >::value,
1018 addition = Helper::addition,
1019 subtraction = Helper::subtraction,
1020 multiplication = Helper::multiplication,
1021 division = Helper::division,
1037 struct IntrinsicTraitBase< complex<long> >
1040 typedef IntrinsicTraitHelper<true,sizeof(long)> Helper;
1043 typedef Helper::Type Type;
1045 alignment = AlignmentOf< complex<long> >::value,
1046 addition = Helper::addition,
1047 subtraction = Helper::subtraction,
1048 multiplication = Helper::multiplication,
1049 division = Helper::division,
1050 absoluteValue = Helper::absoluteValue,
1065 struct IntrinsicTraitBase< complex<unsigned long> >
1068 typedef IntrinsicTraitHelper<true,sizeof(unsigned long)> Helper;
1071 typedef Helper::Type Type;
1073 alignment = AlignmentOf< complex<unsigned long> >::value,
1074 addition = Helper::addition,
1075 subtraction = Helper::subtraction,
1076 multiplication = Helper::multiplication,
1077 division = Helper::division,
1094 struct IntrinsicTraitBase< complex<float> >
1096 typedef simd_cfloat_t Type;
1097 enum {
size = ( 64UL /
sizeof(complex<float>) ),
1098 alignment = AlignmentOf< complex<float> >::value,
1108 #elif BLAZE_AVX_MODE
1110 struct IntrinsicTraitBase< complex<float> >
1112 typedef simd_cfloat_t Type;
1113 enum {
size = ( 32UL /
sizeof(complex<float>) ),
1114 alignment = AlignmentOf< complex<float> >::value,
1126 struct IntrinsicTraitBase< complex<float> >
1128 typedef simd_cfloat_t Type;
1130 alignment = AlignmentOf< complex<float> >::value,
1152 struct IntrinsicTraitBase< complex<double> >
1154 typedef simd_cdouble_t Type;
1155 enum {
size = ( 64UL /
sizeof(complex<double>) ),
1156 alignment = AlignmentOf< complex<double> >::value,
1166 #elif BLAZE_AVX_MODE
1168 struct IntrinsicTraitBase< complex<double> >
1170 typedef simd_cdouble_t Type;
1171 enum {
size = ( 32UL /
sizeof(complex<double>) ),
1172 alignment = AlignmentOf< complex<double> >::value,
1184 struct IntrinsicTraitBase< complex<double> >
1186 typedef simd_cdouble_t Type;
1188 alignment = AlignmentOf< complex<double> >::value,
1231 template<
typename T >
Header file for the AlignmentOf type trait.
Header file for basic type definitions.
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:252
Header file for the RemoveCV type trait.
#define BLAZE_SSE3_MODE
Compilation switch for the SSE3 mode.This compilation switch enables/disables the SSE3 mode...
Definition: Vectorization.h:163
#define BLAZE_SSSE3_MODE
Compilation switch for the SSSE3 mode.This compilation switch enables/disables the SSSE3 mode...
Definition: Vectorization.h:180
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
BLAZE_ALWAYS_INLINE void conjugate(T &a)
In-place conjugation of the given value/object.
Definition: Conjugate.h:120
#define BLAZE_SSE_MODE
Compilation switch for the SSE mode.This compilation switch enables/disables the SSE mode...
Definition: Vectorization.h:129
Header file for the basic intrinsic types.
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:1232
#define BLAZE_SSE4_MODE
Compilation switch for the SSE4 mode.This compilation switch enables/disables the SSE4 mode...
Definition: Vectorization.h:197
System settings for the SSE mode.
Header file for the complex data type.
#define BLAZE_SSE2_MODE
Compilation switch for the SSE2 mode.This compilation switch enables/disables the SSE2 mode...
Definition: Vectorization.h:146
#define BLAZE_STATIC_ASSERT(expr)
Compile time assertion macro.In case of an invalid compile time expression, a compilation error is cr...
Definition: StaticAssert.h:143