28#ifndef VC_COMMON_MASK_H_
29#define VC_COMMON_MASK_H_
33namespace Vc_VERSIONED_NAMESPACE
41template <
typename T,
typename Abi = VectorAbi::Best<T>>
class Mask
57 static constexpr size_t size() {
return VectorTraits<T, Abi>::size(); }
60 static constexpr size_t Size = VectorTraits<T, Abi>::size();
66 static constexpr size_t MemoryAlignment = VectorTraits<T, Abi>::maskMemoryAlignment();
93 using VectorType =
typename VectorTraits<T, Abi>::VectorType;
97 using vector_type = VectorType;
139 Vc_INTRINSIC
explicit Mask(VectorSpecialInitializerZero);
143 Vc_INTRINSIC
explicit Mask(VectorSpecialInitializerOne);
155 Vc_INTRINSIC
explicit Mask(
bool b);
163 template <
typename U>
164 Vc_INTRINSIC
Mask(U &&otherMask,
165 Common::enable_if_mask_converts_implicitly<Mask, T, U> = nullarg);
176 template <
typename U>
178 "use simd_cast instead of explicit type casting to convert between mask types")
180 explicit
Mask(U &&otherMask, Common::enable_if_mask_converts_explicitly<T, U> =
181 nullarg) Vc_INTRINSIC_R;
198 Vc_ALWAYS_INLINE
explicit Mask(
const bool *mem);
207 template <
typename Flags> Vc_ALWAYS_INLINE
explicit Mask(
const bool *mem, Flags flags);
215 Vc_ALWAYS_INLINE
void load(
const bool *mem);
224 template <
typename Flags> Vc_ALWAYS_INLINE
void load(
const bool *mem, Flags flags);
232 Vc_ALWAYS_INLINE
void store(
bool *mem)
const;
240 template <
typename Flags> Vc_ALWAYS_INLINE
void store(
bool *mem, Flags flags)
const;
317 Vc_ALWAYS_INLINE
bool isMix()
const;
324 Vc_ALWAYS_INLINE
bool data()
const;
325 Vc_ALWAYS_INLINE
bool dataI()
const;
326 Vc_ALWAYS_INLINE
bool dataD()
const;
382 Vc_FREE_STORE_OPERATORS_ALIGNED(
alignof(
Mask));
401constexpr bool all_of(
bool b) {
return b; }
410constexpr bool any_of(
bool b) {
return b; }
The main SIMD mask class.
Mask(VectorSpecialInitializerZero)
void store(bool *mem) const
void store(bool *mem, Flags flags) const
static constexpr size_t size()
static Mask generate(G &&gen)
Mask operator&&(const Mask &mask) const
typename VectorTraits< T, Abi >::VectorEntryType VectorEntryType
Mask & operator&=(const Mask &mask)
void load(const bool *mem, Flags flags)
Mask operator||(const Mask &mask) const
Mask & operator|=(const Mask &mask)
EntryType operator[](size_t index) const
Mask operator|(const Mask &mask) const
void load(const bool *mem)
Mask(U &&otherMask, Common::enable_if_mask_converts_implicitly< Mask, T, U >=nullarg)
typename VectorTraits< T, Abi >::EntryReference EntryReference
bool operator==(const Mask &mask) const
EntryReference value_reference
Mask operator^(const Mask &mask) const
static constexpr size_t Size
Mask operator&(const Mask &mask) const
static constexpr size_t MemoryAlignment
Mask(VectorSpecialInitializerOne)
bool operator!=(const Mask &mask) const
Mask shifted(int amount) const
EntryReference operator[](size_t index)
Mask()=default
Construct a zero-initialized vector object.
Mask(const bool *mem, Flags flags)
Mask & operator^=(const Mask &mask)
constexpr bool any_of(const Mask &m)
Returns whether at least one entry in the mask m is true.
constexpr bool some_of(const Mask &m)
Returns whether at least one entry in m is true and at least one entry in m is false.
constexpr bool none_of(const Mask &m)
Returns whether all entries in the mask m are false.
constexpr bool all_of(const Mask &m)
Returns whether all entries in the mask m are true.