24 #include "../common/bitscanintrinsics.h"
33 template<
unsigned int VectorSize>
class Mask<VectorSize, 32u>
35 friend class Mask<4u, 32u>;
36 friend class Mask<8u, 32u>;
37 friend class Mask<8u, 16u>;
38 friend class Mask<16u, 16u>;
43 #if defined VC_MSVC && defined _WIN32
53 #ifdef VC_UNCONDITIONAL_AVX2_INTRINSICS
63 _mm_unpacklo_epi16(rhs.dataI(), rhs.dataI()),
64 _mm_unpackhi_epi16(rhs.dataI(), rhs.dataI())))) {}
83 #ifndef VC_NO_AUTOMATIC_BOOL_FROM_MASK
100 #ifdef VC_COMPILE_BENCHMARKS
106 template<
unsigned int VectorSize>
class Mask<VectorSize, 16u>
116 #if defined VC_MSVC && defined _WIN32
126 #ifdef VC_UNCONDITIONAL_AVX2_INTRINSICS
136 _mm_packs_epi32(
avx_cast<
m128i>(rhs.data()), _mm256_extractf128_si256(rhs.dataI(), 1)))) {}
138 _mm_packs_epi16(a[0].dataI(), a[1].dataI()))) {}
154 #ifndef VC_NO_AUTOMATIC_BOOL_FROM_MASK
171 #ifdef VC_COMPILE_BENCHMARKS
189 const size_t bit = __builtin_ctzl(
mask);
190 __asm__(
"btr %1,%0" :
"+r"(
mask) :
"r"(bit));
193 #pragma warning(suppress : 4267) // conversion from 'size_t' to 'unsigned long', possible loss of data
195 const size_t bit = _bit_scan_forward(
mask);
202 #define Vc_foreach_bit(_it_, _mask_) \
203 for (Vc::AVX::ForeachHelper Vc__make_unique(foreach_bit_obj)((_mask_).toInt()); Vc__make_unique(foreach_bit_obj).outer(); ) \
204 for (_it_ = Vc__make_unique(foreach_bit_obj).next(); Vc__make_unique(foreach_bit_obj).inner(); Vc__make_unique(foreach_bit_obj).noBreak())
219 template<
unsigned int LSize,
unsigned int RSize,
size_t LW
idth,
size_t RW
idth>
void operator&(
const Mask<LSize, LWidth> &
l,
const Mask<RSize, RWidth> &
r);
220 template<
unsigned int LSize,
unsigned int RSize,
size_t LW
idth,
size_t RW
idth>
void operator|(
const Mask<LSize, LWidth> &
l,
const Mask<RSize, RWidth> &
r);
221 template<
unsigned int LSize,
unsigned int RSize,
size_t LW
idth,
size_t RW
idth>
void operator^(
const Mask<LSize, LWidth> &
l,
const Mask<RSize, RWidth> &
r);
229 template<
unsigned int LSize,
unsigned int RSize,
size_t LW
idth,
size_t RW
idth>
void operator&&(
const Mask<LSize, LWidth> &lhs,
const Mask<RSize, RWidth> &rhs);
230 template<
unsigned int LSize,
unsigned int RSize,
size_t LW
idth,
size_t RW
idth>
void operator||(
const Mask<LSize, LWidth> &lhs,
const Mask<RSize, RWidth> &rhs);
246 #endif // VC_AVX_MASK_H
Vc_ALWAYS_INLINE Mask & operator&=(const Mask &rhs)
Vc_ALWAYS_INLINE Mask(param256i x)
Vc_ALWAYS_INLINE Mask(VectorSpecialInitializerZero::ZEnum)
void operator^(const Mask< LSize, LWidth > &l, const Mask< RSize, RWidth > &r)
static Vc_INTRINSIC_L T avx_cast(param128 v) Vc_INTRINSIC_R
static Vc_INTRINSIC m128i Vc_CONST _mm_setallone_si128()
Vc_ALWAYS_INLINE Mask & operator&=(const Mask &rhs)
Vc_ALWAYS_INLINE Mask & operator|=(const Mask &rhs)
#define FREE_STORE_OPERATORS_ALIGNED(alignment)
Vc_ALWAYS_INLINE size_t next()
Vc_ALWAYS_INLINE m128d dataD() const
Vc_ALWAYS_INLINE Mask(VectorSpecialInitializerOne::OEnum)
Vc_ALWAYS_INLINE Mask(const Mask &rhs)
Vc_ALWAYS_INLINE Mask(param256d x)
Vc_ALWAYS_INLINE Mask(bool b)
Vc_ALWAYS_INLINE Mask(const Mask &rhs)
ClassImp(TIterator) Bool_t TIterator return false
Compare two iterator objects.
Mask< VectorSize, 16u > AsArg
Vc_ALWAYS_INLINE bool isEmpty() const
void operator&(const Mask< LSize, LWidth > &l, const Mask< RSize, RWidth > &r)
Vc_ALWAYS_INLINE void noBreak()
Vc_ALWAYS_INLINE Mask operator!() const
Vc_ALWAYS_INLINE ForeachHelper(size_t _mask)
Vc_INTRINSIC Vc_CONST m256 concat(param128 a, param128 b)
void operator|(const Mask< LSize, LWidth > &l, const Mask< RSize, RWidth > &r)
static Vc_ALWAYS_INLINE Vc_PURE m256 xor_(param256 a, param256 b)
Vc_ALWAYS_INLINE bool operator==(const Mask &rhs) const
Vc_ALWAYS_INLINE m256i dataI() const
Vc_ALWAYS_INLINE Mask(const Mask< VectorSize, 32u > &rhs)
Vc_ALWAYS_INLINE Mask(bool b)
#define Vc_ALWAYS_INLINE_R
Vc_ALWAYS_INLINE Mask(param256 x)
Vc_ALWAYS_INLINE Mask(const Mask< VectorSize, 16u > &rhs)
Vc_ALWAYS_INLINE Mask & operator^=(const Mask &rhs)
Vc_ALWAYS_INLINE bool operator==(const Mask &rhs) const
void operator&&(const Mask< LSize, LWidth > &lhs, const Mask< RSize, RWidth > &rhs)
Vc_ALWAYS_INLINE bool isFull() const
Vc_ALWAYS_INLINE Mask(param128d x)
Mask< VectorSize, 32u > AsArg
Vc_ALWAYS_INLINE m128i dataI() const
Vc_ALWAYS_INLINE Mask(const Mask< VectorSize/2, 16u > *a)
static Vc_ALWAYS_INLINE Vc_PURE m256 or_(param256 a, param256 b)
static Vc_ALWAYS_INLINE Vc_PURE m256 and_(param256 a, param256 b)
#define Vc_ALWAYS_INLINE_L
Vc_ALWAYS_INLINE bool isEmpty() const
Vc_ALWAYS_INLINE bool operator!=(const Mask &rhs) const
Vc_ALWAYS_INLINE bool isMix() const
static Vc_INTRINSIC m256 Vc_CONST _mm256_setallone_ps()
void operator||(const Mask< LSize, LWidth > &lhs, const Mask< RSize, RWidth > &rhs)
Vc_ALWAYS_INLINE bool inner()
static Vc_INTRINSIC m128 Vc_CONST _mm_setallone_ps()
Vc_ALWAYS_INLINE Mask & operator|=(const Mask &rhs)
Vc_ALWAYS_INLINE Mask & operator^=(const Mask &rhs)
Vc_ALWAYS_INLINE Mask(VectorSpecialInitializerZero::ZEnum)
Vc_ALWAYS_INLINE m256d dataD() const
Vc_ALWAYS_INLINE bool isFull() const
Vc_ALWAYS_INLINE Mask(param128 x)
Vc_ALWAYS_INLINE bool outer() const
Vc_ALWAYS_INLINE bool operator!=(const Mask &rhs) const
Vc_ALWAYS_INLINE Mask(VectorSpecialInitializerOne::OEnum)
Vc_ALWAYS_INLINE Mask operator!() const
Vc_ALWAYS_INLINE Mask(param128i x)
Vc_ALWAYS_INLINE bool isMix() const