30 #include "../common/aliasingentryhelper.h" 31 #include "../common/memoryfwd.h" 48 template<
typename T>
class Vector
63 #ifdef VC_PASSING_VECTOR_BY_VALUE_IS_BROKEN 86 #ifdef VC_UNCONDITIONAL_AVX2_INTRINSICS 111 #ifdef VC_UNCONDITIONAL_AVX2_INTRINSICS 191 template<
typename IndexT>
Vector(
const EntryType *mem,
const IndexT *indexes);
193 template<
typename IndexT>
Vector(
const EntryType *mem,
const IndexT *indexes, MaskArg mask);
196 template<
typename S1,
typename IT>
Vector(
const S1 *array,
const EntryType S1::* member1,
VC_ALIGNED_PARAMETER(IT) indexes, MaskArg mask);
197 template<
typename S1,
typename S2,
typename IT>
Vector(
const S1 *array,
const S2 S1::* member1,
const EntryType S2::* member2,
VC_ALIGNED_PARAMETER(IT) indexes);
198 template<
typename S1,
typename S2,
typename IT>
Vector(
const S1 *array,
const S2 S1::* member1,
const EntryType S2::* member2,
VC_ALIGNED_PARAMETER(IT) indexes, MaskArg mask);
203 #ifdef VC_USE_SET_GATHERS 206 template<
typename S1,
typename IT>
void gather(
const S1 *array,
const EntryType S1::* member1,
VC_ALIGNED_PARAMETER(IT) indexes);
207 template<
typename S1,
typename IT>
void gather(
const S1 *array,
const EntryType S1::* member1,
VC_ALIGNED_PARAMETER(IT) indexes, MaskArg mask);
208 template<
typename S1,
typename S2,
typename IT>
void gather(
const S1 *array,
const S2 S1::* member1,
const EntryType S2::* member2,
VC_ALIGNED_PARAMETER(IT) indexes);
209 template<
typename S1,
typename S2,
typename IT>
void gather(
const S1 *array,
const S2 S1::* member1,
const EntryType S2::* member2,
VC_ALIGNED_PARAMETER(IT) indexes, MaskArg mask);
218 template<
typename S1,
typename IT>
void scatter(S1 *array, EntryType S1::* member1,
VC_ALIGNED_PARAMETER(IT) indexes, MaskArg mask)
const;
219 template<
typename S1,
typename S2,
typename IT>
void scatter(S1 *array, S2 S1::* member1, EntryType S2::* member2,
VC_ALIGNED_PARAMETER(IT) indexes)
const;
220 template<
typename S1,
typename S2,
typename IT>
void scatter(S1 *array, S2 S1::* member1, EntryType S2::* member2,
VC_ALIGNED_PARAMETER(IT) indexes, MaskArg mask)
const;
233 #if defined(VC_GCC) && VC_GCC >= 0x40300 && VC_GCC < 0x40400 247 Vc_ALWAYS_INLINE Vector fun() const { return Vector<T>(VectorHelper<T>::fun(data())); } \ 248 Vc_ALWAYS_INLINE Vector &fun##_eq() { data() = VectorHelper<T>::fun(data()); return *this; } 253 #define OP(symbol, fun) \ 254 Vc_ALWAYS_INLINE Vector &operator symbol##=(const Vector<T> &x) { data() = VectorHelper<T>::fun(data(), x.data()); return *this; } \ 255 Vc_ALWAYS_INLINE Vector &operator symbol##=(EntryType x) { return operator symbol##=(Vector(x)); } \ 256 Vc_ALWAYS_INLINE Vector operator symbol(const Vector<T> &x) const { return Vector<T>(VectorHelper<T>::fun(data(), x.data())); } \ 257 template<typename TT> Vc_ALWAYS_INLINE VC_EXACT_TYPE(TT, EntryType, Vector) operator symbol(TT x) const { return operator symbol(Vector(x)); } 264 template<
typename TT>
inline Vc_PURE_L VC_EXACT_TYPE(TT, EntryType, Vector) operator/(TT x) const Vc_PURE_R;
265 inline Vector &operator/=(const Vector<
T> &x);
266 inline
Vc_PURE_L Vector operator/ (const Vector<
T> &x) const Vc_PURE_R;
270 Vc_ALWAYS_INLINE_L Vector<T> &operator op##=(AsArg x) Vc_ALWAYS_INLINE_R; \ 271 Vc_ALWAYS_INLINE_L Vc_PURE_L Vector<T> operator op (AsArg x) const Vc_ALWAYS_INLINE_R Vc_PURE_R; 272 #define OP_ENTRY(op) \ 273 Vc_ALWAYS_INLINE Vector<T> &operator op##=(EntryType x) { return operator op##=(Vector(x)); } \ 274 template<typename TT> Vc_ALWAYS_INLINE Vc_PURE VC_EXACT_TYPE(TT, EntryType, Vector) operator op(TT x) const { return operator op(Vector(x)); } 286 #define OPcmp(symbol, fun) \ 287 Vc_ALWAYS_INLINE Mask operator symbol(AsArg x) const { return VectorHelper<T>::fun(data(), x.data()); } \ 288 template<typename TT> Vc_ALWAYS_INLINE VC_EXACT_TYPE(TT, EntryType, Mask) operator symbol(TT x) const { return operator symbol(Vector(x)); } 304 const VectorType k =
avx_cast<VectorType>(mask.data());
341 for (
int i = 1; i <
Size; ++i) {
457 #include "forceToRegisters.tcc" 462 #include "vector.tcc" 466 #endif // AVX_VECTOR_H Vector< sfloat > sfloat_v
static VectorType sort(VTArg)
Common::VectorMemoryUnion< VectorType, EntryType > StorageType
void gather(const EntryType *mem, VC_ALIGNED_PARAMETER(Index) indexes)
Vc_ALWAYS_INLINE_L Vector< T > operator>>(int x) const Vc_ALWAYS_INLINE_R
Vc_INTRINSIC_L Vc_PURE_L const Vector< T > aaaa() const Vc_INTRINSIC_R Vc_PURE_R
Vc_INTRINSIC Vector(TT x, VC_EXACT_TYPE(TT, EntryType, void *)=0)
#define Vc_foreach_bit(_it_, _mask_)
static Vc_INTRINSIC VectorType _cast(param256i v)
Vc_INTRINSIC_L Vc_PURE_L const Vector< T > bbbb() const Vc_INTRINSIC_R Vc_PURE_R
Namespace for new ROOT classes and functions.
Vc_INTRINSIC_L Vc_PURE_L const Vector< T > cdab() const Vc_INTRINSIC_R Vc_PURE_R
Vc_INTRINSIC_L Vector & operator=(const Vector< OtherT > &x) Vc_INTRINSIC_R
cmpneq cmpnle cmple Vc_INTRINSIC_L Vc_PURE_L Mask isNegative() const Vc_PURE_R Vc_INTRINSIC_R
static Vc_INTRINSIC_L T avx_cast(param128 v) Vc_INTRINSIC_R
Vc_INTRINSIC_L Vc_PURE_L const Vector< T > bcad() const Vc_INTRINSIC_R Vc_PURE_R
Vc_ALWAYS_INLINE V2 reinterpretCast() const
Vc_ALWAYS_INLINE Vector sorted() const
Vc_INTRINSIC_L Vc_PURE_L const Vector< T > bcda() const Vc_INTRINSIC_R Vc_PURE_R
Vc_INTRINSIC_L Vector shifted(int amount) const Vc_INTRINSIC_R
Vector< unsigned short > ushort_v
#define FREE_STORE_OPERATORS_ALIGNED(alignment)
Vc::Memory< Vector< T >, Size > Memory
Vc_ALWAYS_INLINE EntryType operator[](size_t index) const
#define VC_ALL_BINARY(macro)
Vc_INTRINSIC_L Vector rotated(int amount) const Vc_INTRINSIC_R
static Vc_ALWAYS_INLINE Vector< T > reciprocal(const Vector< T > &x)
static Vc_INTRINSIC VectorType _cast(param128 v)
Vc_ALWAYS_INLINE Vector(VectorTypeArg x)
Vc_ALWAYS_INLINE V2 staticCast() const
VectorHelper< VectorType > HV
Vc_ALWAYS_INLINE Vc_PURE AliasingEntryType & m(size_t index)
Vc_INTRINSIC void call(F &f, const Mask &mask) const
static Vc_ALWAYS_INLINE Vector< T >::Mask isfinite(const Vector< T > &x)
Vc_ALWAYS_INLINE_L Vector< T > operator<<(int x) const Vc_ALWAYS_INLINE_R
Vc_INTRINSIC_L void setZero() Vc_INTRINSIC_R
void scatter(EntryType *mem, VC_ALIGNED_PARAMETER(Index) indexes) const
Vc_ALWAYS_INLINE void fusedMultiplyAdd(const Vector< T > &factor, const Vector< T > &summand)
VectorTypeHelper< T >::Type VectorType
void _operator_bracket_warning()
static Vc_ALWAYS_INLINE Vc_PURE Vector< T > abs(const Vector< T > &x)
#define for_all_vector_entries(_it_, _code_)
Vc_INTRINSIC void fill(EntryType(&f)())
Vc_PURE_L VC_EXACT_TYPE(TT, EntryType, Vector) operator/(TT x) const Vc_PURE_R
static Vc_INTRINSIC VectorType _cast(param128i v)
Vc_INTRINSIC void call(const F &f) const
static Vc_ALWAYS_INLINE Vector< T > abs(const Vector< T > &x)
Vc_INTRINSIC_L Vc_PURE_L const Vector< T > dbca() const Vc_INTRINSIC_R Vc_PURE_R
Vc_INTRINSIC Common::AliasingEntryHelper< StorageType > operator[](size_t index)
Vc_INTRINSIC Vc_PURE Vector operator+() const
Vc_INTRINSIC_L void setQnan() Vc_INTRINSIC_R
Vc_INTRINSIC Vector< T > apply(const F &f, const Mask &mask) const
Vc_INTRINSIC Vector< T > apply(F &f, const Mask &mask) const
Vc_INTRINSIC Vector< T > apply(F &f) const
Vc_ALWAYS_INLINE_L Vector< T > & operator>>=(int x) Vc_ALWAYS_INLINE_R
static Vc_ALWAYS_INLINE Vc_PURE Vector< T > round(const Vector< T > &x)
static Vc_INTRINSIC_L Vc_CONST_L Vector Zero() Vc_INTRINSIC_R Vc_CONST_R
static Vc_INTRINSIC_L Vc_CONST_L Vector One() Vc_INTRINSIC_R Vc_CONST_R
static Vc_ALWAYS_INLINE Vector< T > sqrt(const Vector< T > &x)
void expand(Vector< typename HT::ConcatType > *x) const
#define Vc_ALWAYS_INLINE_R
Vc::AVX::Mask< Size, sizeof(VectorType)> Mask
Vc_ALWAYS_INLINE Vc_PURE VectorType & v()
Vc_INTRINSIC void call(const F &f, const Mask &mask) const
static Vc_INTRINSIC VectorType _cast(param128d v)
Vc_ALWAYS_INLINE Vector & operator++()
#define VC_ALIGNED_PARAMETER(_Type)
Vc_ALWAYS_INLINE WriteMaskedVector< T > operator()(const Mask &k)
Vc_ALWAYS_INLINE_L Vc_PURE_L Vector< typename NegateTypeHelper< T >::Type > operator-() const Vc_ALWAYS_INLINE_R Vc_PURE_R
Vc_INTRINSIC_L Vc_PURE_L const Vector< T > & abcd() const Vc_INTRINSIC_R Vc_PURE_R
static Vc_INTRINSIC_L Vc_CONST_L Vector IndexesFromZero() Vc_INTRINSIC_R Vc_CONST_R
Vector< double > double_v
static Vc_INTRINSIC VectorType _cast(param256 v)
Vc_ALWAYS_INLINE const VectorType data() const
static Vc_ALWAYS_INLINE Vector< T > round(const Vector< T > &x)
DetermineEntryType< T >::Type EntryType
static Vc_ALWAYS_INLINE_L Vector Random() Vc_ALWAYS_INLINE_R
Vc_ALWAYS_INLINE Vector & operator=(EntryType a)
Vc_INTRINSIC_L Vc_PURE_L const Vector< T > badc() const Vc_INTRINSIC_R Vc_PURE_R
static Vc_ALWAYS_INLINE Vc_PURE Vector< T > rsqrt(const Vector< T > &x)
static Vc_ALWAYS_INLINE Vector< T > rsqrt(const Vector< T > &x)
Vc_INTRINSIC void fill(EntryType(&f)(IndexT))
Type
enumeration specifying the integration types.
Vc_ALWAYS_INLINE Vector operator++(int)
Vector & operator/=(EntryType x)
static Vc_ALWAYS_INLINE Vc_PURE Vector< T > reciprocal(const Vector< T > &x)
static Vc_ALWAYS_INLINE Vector< T >::Mask isnan(const Vector< T > &x)
RooCmdArg Index(RooCategory &icat)
static Vc_ALWAYS_INLINE Vc_PURE sfloat_v max(const sfloat_v &x, const sfloat_v &y)
Vc_INTRINSIC_L Vc_PURE_L const Vector< T > dddd() const Vc_INTRINSIC_R Vc_PURE_R
Vector< typename IndexTypeHelper< T >::Type > IndexType
Vc_ALWAYS_INLINE void assign(const Vector< T > &v, const Mask &mask)
Vc_INTRINSIC Vector< T > apply(const F &f) const
Vc_INTRINSIC_L void store(EntryType *mem) const Vc_INTRINSIC_R
Vc_ALWAYS_INLINE_L Vector< T > & operator<<=(int x) Vc_ALWAYS_INLINE_R
Vector< unsigned int > uint_v
#define Vc_ALWAYS_INLINE_L
Vc_ALWAYS_INLINE Vector & operator=(AsArg v)
Vc_INTRINSIC_L Vector copySign(AsArg reference) const Vc_INTRINSIC_R
void callWithValuesSorted(F &f)
Vc_ALWAYS_INLINE Vector & operator--()
Vc_ALWAYS_INLINE EntryType product() const
Vc_ALWAYS_INLINE Vector()
static Vc_ALWAYS_INLINE Vc_PURE sfloat_v min(const sfloat_v &x, const sfloat_v &y)
cmpneq cmpnle OPcmp(<, cmplt) OPcmp(<
#define VC_ALL_SHIFTS(macro)
Vc_ALWAYS_INLINE EntryType min() const
Vc_ALWAYS_INLINE EntryType sum() const
Vc_INTRINSIC_L Vc_PURE_L const Vector< T > dabc() const Vc_INTRINSIC_R Vc_PURE_R
Vc_INTRINSIC_L Vc_PURE_L const Vector< T > dcba() const Vc_INTRINSIC_R Vc_PURE_R
Vc_INTRINSIC_L void load(const EntryType *mem) Vc_INTRINSIC_R
Vc_INTRINSIC_L Vc_PURE_L const Vector< T > acbd() const Vc_INTRINSIC_R Vc_PURE_R
Vc_INTRINSIC void call(F &f) const
Vc_INTRINSIC_L Vc_PURE_L const Vector< T > cccc() const Vc_INTRINSIC_R Vc_PURE_R
Vc_INTRINSIC_L Vector exponent() const Vc_INTRINSIC_R
Vc_ALWAYS_INLINE EntryType max() const
Vc_ALWAYS_INLINE Vector operator~() const
Vc_ALWAYS_INLINE Vector operator--(int)
static Vc_INTRINSIC VectorType _cast(param256d v)
Vc_ALWAYS_INLINE VectorType & data()