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