Blaze 3.9
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
43#include <utility>
51#include <blaze/system/Inline.h>
53
54
55namespace blaze {
56
57//=================================================================================================
58//
59// CLASS DEFINITION
60//
61//=================================================================================================
62
63//*************************************************************************************************
67struct Bitxor
68{
69 //**********************************************************************************************
76 template< typename T1, typename T2 >
77 BLAZE_ALWAYS_INLINE decltype(auto) operator()( T1&& a, T2&& b ) const
78 {
79 return std::forward<T1>( a ) ^ std::forward<T2>( b );
80 }
81 //**********************************************************************************************
82
83 //**********************************************************************************************
88 template< typename T1, typename T2 >
89 static constexpr bool simdEnabled() { return HasSIMDBitxor_v<T1,T2>; }
90 //**********************************************************************************************
91
92 //**********************************************************************************************
97 static constexpr bool paddingEnabled() { return true; }
98 //**********************************************************************************************
99
100 //**********************************************************************************************
107 template< typename T1, typename T2 >
108 BLAZE_ALWAYS_INLINE decltype(auto) load( const T1& a, const T2& b ) const
109 {
112 return a ^ b;
113 }
114 //**********************************************************************************************
115};
116//*************************************************************************************************
117
118
119
120
121//=================================================================================================
122//
123// YIELDSUNIFORM SPECIALIZATIONS
124//
125//=================================================================================================
126
127//*************************************************************************************************
129template< typename T1, typename T2 >
130struct YieldsUniform<Bitxor,T1,T2>
131 : public BoolConstant< IsUniform_v<T1> && IsUniform_v<T2> >
132{};
134//*************************************************************************************************
135
136
137
138
139//=================================================================================================
140//
141// YIELDSSYMMETRIC SPECIALIZATIONS
142//
143//=================================================================================================
144
145//*************************************************************************************************
147template< typename MT1, typename MT2 >
148struct YieldsSymmetric<Bitxor,MT1,MT2>
149 : public BoolConstant< IsSymmetric_v<MT1> && IsSymmetric_v<MT2> >
150{};
152//*************************************************************************************************
153
154} // namespace blaze
155
156#endif
Header file for the HasSIMDBitxor type trait.
Header file for the IntegralConstant class template.
Header file for the IsSymmetric type trait.
Header file for the IsUniform type trait.
Header file for the YieldsSymmetric type trait.
Header file for the YieldsUniform type trait.
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_BE_SIMD_PACK(T)
Constraint on the data type.
Definition: SIMDPack.h:60
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.
Definition: IntegralConstant.h:110
Header file for the SIMD bitxor functionality.
Generic wrapper for the bitwise XOR ('^') operator.
Definition: Bitxor.h:68
static constexpr bool simdEnabled()
Returns whether SIMD is enabled for the specified data types T1 and T2.
Definition: Bitxor.h:89
BLAZE_ALWAYS_INLINE decltype(auto) load(const T1 &a, const T2 &b) const
Returns the result of the bitwise XOR operation for the given SIMD vectors.
Definition: Bitxor.h:108
static constexpr bool paddingEnabled()
Returns whether the operation supports padding, i.e. whether it can deal with zeros.
Definition: Bitxor.h:97
System settings for the inline keywords.