Blaze  3.6
Bitxor.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_FUNCTORS_BITXOR_H_
36 #define _BLAZE_MATH_FUNCTORS_BITXOR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
44 #include <blaze/math/simd/Bitxor.h>
50 #include <blaze/system/Inline.h>
52 
53 
54 namespace blaze {
55 
56 //=================================================================================================
57 //
58 // CLASS DEFINITION
59 //
60 //=================================================================================================
61 
62 //*************************************************************************************************
66 struct Bitxor
67 {
68  //**********************************************************************************************
75  template< typename T1, typename T2 >
76  BLAZE_ALWAYS_INLINE decltype(auto) operator()( const T1& a, const T2& b ) const
77  {
78  return a ^ b;
79  }
80  //**********************************************************************************************
81 
82  //**********************************************************************************************
87  template< typename T1, typename T2 >
88  static constexpr bool simdEnabled() { return HasSIMDBitxor_v<T1,T2>; }
89  //**********************************************************************************************
90 
91  //**********************************************************************************************
96  static constexpr bool paddingEnabled() { return true; }
97  //**********************************************************************************************
98 
99  //**********************************************************************************************
106  template< typename T1, typename T2 >
107  BLAZE_ALWAYS_INLINE decltype(auto) load( const T1& a, const T2& b ) const
108  {
111  return a ^ b;
112  }
113  //**********************************************************************************************
114 };
115 //*************************************************************************************************
116 
117 
118 
119 
120 //=================================================================================================
121 //
122 // YIELDSUNIFORM SPECIALIZATIONS
123 //
124 //=================================================================================================
125 
126 //*************************************************************************************************
128 template< typename T1, typename T2 >
129 struct YieldsUniform<Bitxor,T1,T2>
130  : public BoolConstant< IsUniform_v<T1> && IsUniform_v<T2> >
131 {};
133 //*************************************************************************************************
134 
135 
136 
137 
138 //=================================================================================================
139 //
140 // YIELDSSYMMETRIC SPECIALIZATIONS
141 //
142 //=================================================================================================
143 
144 //*************************************************************************************************
146 template< typename MT1, typename MT2 >
147 struct YieldsSymmetric<Bitxor,MT1,MT2>
148  : public BoolConstant< IsSymmetric_v<MT1> && IsSymmetric_v<MT2> >
149 {};
151 //*************************************************************************************************
152 
153 } // namespace blaze
154 
155 #endif
Header file for the HasSIMDBitxor type trait.
Header file for the SIMD bitxor functionality.
#define BLAZE_CONSTRAINT_MUST_BE_SIMD_PACK(T)
Constraint on the data type.In case the given data type T is not a SIMD pack, a compilation error is ...
Definition: SIMDPack.h:60
Header file for the IsUniform type trait.
static constexpr bool paddingEnabled()
Returns whether the operation supports padding, i.e. whether it can deal with zeros.
Definition: Bitxor.h:96
Header file for the IsSymmetric type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
Constraint on the data type.
Generic wrapper for the bitwise XOR ('^') operator.
Definition: Bitxor.h:66
Header file for the YieldsUniform type trait.
decltype(auto) BLAZE_ALWAYS_INLINE load(const T1 &a, const T2 &b) const
Returns the result of the bitwise XOR operation for the given SIMD vectors.
Definition: Bitxor.h:107
Header file for the YieldsSymmetric type trait.
static constexpr bool simdEnabled()
Returns whether SIMD is enabled for the specified data types T1 and T2.
Definition: Bitxor.h:88
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.The BoolConstant alias template represents ...
Definition: IntegralConstant.h:110
Header file for the IntegralConstant class template.
System settings for the inline keywords.