Blaze  3.6
ShiftRV.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_FUNCTORS_SHIFTRV_H_
36 #define _BLAZE_MATH_FUNCTORS_SHIFTRV_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
60 #include <blaze/system/Inline.h>
61 
62 
63 namespace blaze {
64 
65 //=================================================================================================
66 //
67 // CLASS DEFINITION
68 //
69 //=================================================================================================
70 
71 //*************************************************************************************************
75 struct ShiftRV
76 {
77  //**********************************************************************************************
84  template< typename T1, typename T2 >
85  BLAZE_ALWAYS_INLINE decltype(auto) operator()( const T1& a, const T2& b ) const
86  {
87  return a >> b;
88  }
89  //**********************************************************************************************
90 
91  //**********************************************************************************************
96  template< typename T1, typename T2 >
97  static constexpr bool simdEnabled() { return HasSIMDShiftRV_v<T1,T2>; }
98  //**********************************************************************************************
99 
100  //**********************************************************************************************
105  static constexpr bool paddingEnabled() { return true; }
106  //**********************************************************************************************
107 
108  //**********************************************************************************************
115  template< typename T1, typename T2 >
116  BLAZE_ALWAYS_INLINE decltype(auto) load( const T1& a, const T2& b ) const
117  {
120  return a >> b;
121  }
122  //**********************************************************************************************
123 };
124 //*************************************************************************************************
125 
126 
127 
128 
129 //=================================================================================================
130 //
131 // YIELDSUNIFORM SPECIALIZATIONS
132 //
133 //=================================================================================================
134 
135 //*************************************************************************************************
137 template< typename T1, typename T2 >
138 struct YieldsUniform<ShiftRV,T1,T2>
139  : public BoolConstant< IsUniform_v<T1> && IsUniform_v<T2> >
140 {};
142 //*************************************************************************************************
143 
144 
145 
146 
147 //=================================================================================================
148 //
149 // YIELDSSYMMETRIC SPECIALIZATIONS
150 //
151 //=================================================================================================
152 
153 //*************************************************************************************************
155 template< typename MT1, typename MT2 >
156 struct YieldsSymmetric<ShiftRV,MT1,MT2>
157  : public BoolConstant< IsSymmetric_v<MT1> && IsSymmetric_v<MT2> >
158 {};
160 //*************************************************************************************************
161 
162 
163 
164 
165 //=================================================================================================
166 //
167 // YIELDSLOWER SPECIALIZATIONS
168 //
169 //=================================================================================================
170 
171 //*************************************************************************************************
173 template< typename MT1, typename MT2 >
174 struct YieldsLower<ShiftRV,MT1,MT2>
175  : public IsLower<MT1>
176 {};
178 //*************************************************************************************************
179 
180 
181 
182 
183 //=================================================================================================
184 //
185 // YIELDSSTRICTLYLOWER SPECIALIZATIONS
186 //
187 //=================================================================================================
188 
189 //*************************************************************************************************
191 template< typename MT1, typename MT2 >
192 struct YieldsStrictlyLower<ShiftRV,MT1,MT2>
193  : public IsStrictlyLower<MT1>
194 {};
196 //*************************************************************************************************
197 
198 
199 
200 
201 //=================================================================================================
202 //
203 // YIELDSUPPER SPECIALIZATIONS
204 //
205 //=================================================================================================
206 
207 //*************************************************************************************************
209 template< typename MT1, typename MT2 >
210 struct YieldsUpper<ShiftRV,MT1,MT2>
211  : public IsUpper<MT1>
212 {};
214 //*************************************************************************************************
215 
216 
217 
218 
219 //=================================================================================================
220 //
221 // YIELDSSTRICTLYUPPER SPECIALIZATIONS
222 //
223 //=================================================================================================
224 
225 //*************************************************************************************************
227 template< typename MT1, typename MT2 >
228 struct YieldsStrictlyUpper<ShiftRV,MT1,MT2>
229  : public IsStrictlyUpper<MT1>
230 {};
232 //*************************************************************************************************
233 
234 
235 
236 
237 //=================================================================================================
238 //
239 // YIELDSZERO SPECIALIZATIONS
240 //
241 //=================================================================================================
242 
243 //*************************************************************************************************
245 template< typename T1, typename T2 >
246 struct YieldsZero<ShiftRV,T1,T2>
247  : public IsZero<T1>
248 {};
250 //*************************************************************************************************
251 
252 } // namespace blaze
253 
254 #endif
static constexpr bool simdEnabled()
Returns whether SIMD is enabled for the specified data types T1 and T2.
Definition: ShiftRV.h:97
Header file for the YieldsStrictlyLower type trait.
Header file for the YieldsZero type trait.
static constexpr bool paddingEnabled()
Returns whether the operation supports padding, i.e. whether it can deal with zeros.
Definition: ShiftRV.h:105
Generic wrapper for the elementwise right-shift operation.
Definition: ShiftRV.h:75
Header file for the HasSIMDShiftRV type trait.
#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
decltype(auto) BLAZE_ALWAYS_INLINE load(const T1 &a, const T2 &b) const
Returns the result of the elementwise right-shift operation for the given SIMD vector.
Definition: ShiftRV.h:116
Header file for the IsUniform type trait.
Header file for the IsStrictlyUpper type trait.
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
Header file for the YieldsStrictlyUpper type trait.
Header file for the IsLower type trait.
Constraint on the data type.
Header file for the IsStrictlyLower type trait.
Header file for the YieldsUniform type trait.
Header file for the YieldsSymmetric type trait.
Header file for the YieldsUpper type trait.
Header file for the IsZero type trait.
Header file for the YieldsLower type trait.
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 SIMD right-shift functionality.
Header file for the IsUpper type trait.
System settings for the inline keywords.