/* This file is part of the Vc library. Copyright (C) 2009-2012 Matthias Kretz Vc is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Vc is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with Vc. If not, see . */ #ifndef VC_AVX_WRITEMASKEDVECTOR_H #define VC_AVX_WRITEMASKEDVECTOR_H #include "macros.h" namespace ROOT { namespace Vc { namespace AVX { template class WriteMaskedVector { friend class Vector; typedef typename VectorTypeHelper::Type VectorType; typedef typename DetermineEntryType::Type EntryType; enum Constants { Size = sizeof(VectorType) / sizeof(EntryType) }; typedef typename Vc::AVX::Mask Mask; public: FREE_STORE_OPERATORS_ALIGNED(32) //prefix Vector Vc_ALWAYS_INLINE_L &operator++() Vc_ALWAYS_INLINE_R; Vector Vc_ALWAYS_INLINE_L &operator--() Vc_ALWAYS_INLINE_R; //postfix Vector Vc_ALWAYS_INLINE_L operator++(int) Vc_ALWAYS_INLINE_R; Vector Vc_ALWAYS_INLINE_L operator--(int) Vc_ALWAYS_INLINE_R; Vector Vc_ALWAYS_INLINE_L &operator+=(const Vector &x) Vc_ALWAYS_INLINE_R; Vector Vc_ALWAYS_INLINE_L &operator-=(const Vector &x) Vc_ALWAYS_INLINE_R; Vector Vc_ALWAYS_INLINE_L &operator*=(const Vector &x) Vc_ALWAYS_INLINE_R; Vector Vc_ALWAYS_INLINE_L &operator/=(const Vector &x) Vc_ALWAYS_INLINE_R; Vector Vc_ALWAYS_INLINE &operator+=(EntryType x) { return operator+=(Vector(x)); } Vector Vc_ALWAYS_INLINE &operator-=(EntryType x) { return operator-=(Vector(x)); } Vector Vc_ALWAYS_INLINE &operator*=(EntryType x) { return operator*=(Vector(x)); } Vector Vc_ALWAYS_INLINE &operator/=(EntryType x) { return operator/=(Vector(x)); } Vector Vc_ALWAYS_INLINE_L &operator=(const Vector &x) Vc_ALWAYS_INLINE_R; Vector Vc_ALWAYS_INLINE &operator=(EntryType x) { return operator=(Vector(x)); } template Vc_INTRINSIC void call(const F &f) const { return vec->call(f, mask); } template Vc_INTRINSIC void call(F &f) const { return vec->call(f, mask); } template Vc_INTRINSIC Vector apply(const F &f) const { return vec->apply(f, mask); } template Vc_INTRINSIC Vector apply(F &f) const { return vec->apply(f, mask); } private: Vc_ALWAYS_INLINE WriteMaskedVector(Vector *v, const Mask &k) : vec(v), mask(k) {} Vector *const vec; Mask mask; }; } // namespace AVX } // namespace Vc } // namespace ROOT #include "writemaskedvector.tcc" #include "undomacros.h" #endif // VC_AVX_WRITEMASKEDVECTOR_H