29 #ifndef VC_COMMON_MASK_H_
30 #define VC_COMMON_MASK_H_
34 namespace Vc_VERSIONED_NAMESPACE
42 template <
typename T,
typename Abi = VectorAbi::Best<T>>
class Mask
58 static constexpr
size_t size() {
return VectorTraits<T, Abi>::size(); }
61 static constexpr
size_t Size = VectorTraits<T, Abi>::size();
67 static constexpr
size_t MemoryAlignment = VectorTraits<T, Abi>::maskMemoryAlignment();
94 using VectorType =
typename VectorTraits<T, Abi>::VectorType;
98 using vector_type = VectorType;
119 Vc_INTRINSIC
static Mask One();
122 template <
typename G>
static Vc_INTRINSIC
Mask generate(G &&gen);
136 Vc_INTRINSIC
Mask() =
default;
140 Vc_INTRINSIC
explicit Mask(VectorSpecialInitializerZero);
144 Vc_INTRINSIC
explicit Mask(VectorSpecialInitializerOne);
156 Vc_INTRINSIC
explicit Mask(
bool b);
164 template <
typename U>
165 Vc_INTRINSIC
Mask(U &&otherMask,
166 Common::enable_if_mask_converts_implicitly<T, U> = nullarg);
176 template <
typename U>
177 Vc_INTRINSIC_L
explicit Mask(
179 Common::enable_if_mask_converts_explicitly<T, U> = nullarg) Vc_INTRINSIC_R;
195 Vc_ALWAYS_INLINE explicit
Mask(const
bool *mem);
204 template <typename Flags> Vc_ALWAYS_INLINE explicit
Mask(const
bool *mem, Flags flags);
212 Vc_ALWAYS_INLINE
void load(const
bool *mem);
221 template <typename Flags> Vc_ALWAYS_INLINE
void load(const
bool *mem, Flags flags);
229 Vc_ALWAYS_INLINE
void store(
bool *mem) const;
237 template <typename Flags> Vc_ALWAYS_INLINE
void store(
bool *mem, Flags flags) const;
255 Vc_ALWAYS_INLINE
bool operator==(const
Mask &mask) const;
266 Vc_ALWAYS_INLINE
bool operator!=(const
Mask &mask) const;
280 Vc_ALWAYS_INLINE
Mask operator&&(const
Mask &mask) const;
282 Vc_ALWAYS_INLINE
Mask operator&(const
Mask &mask) const;
284 Vc_ALWAYS_INLINE
Mask operator||(const
Mask &mask) const;
286 Vc_ALWAYS_INLINE
Mask operator|(const
Mask &mask) const;
288 Vc_ALWAYS_INLINE
Mask operator^(const
Mask &mask) const;
290 Vc_ALWAYS_INLINE
Mask operator!() const;
293 Vc_ALWAYS_INLINE
Mask &operator&=(const
Mask &mask);
295 Vc_ALWAYS_INLINE
Mask &operator|=(const
Mask &mask);
297 Vc_ALWAYS_INLINE
Mask &operator^=(const
Mask &mask);
308 Vc_ALWAYS_INLINE
bool isFull() const;
310 Vc_ALWAYS_INLINE
bool isNotEmpty() const;
312 Vc_ALWAYS_INLINE
bool isEmpty() const;
314 Vc_ALWAYS_INLINE
bool isMix() const;
320 Vc_ALWAYS_INLINE
bool data() const;
322 Vc_ALWAYS_INLINE
bool dataI() const;
323 Vc_ALWAYS_INLINE
bool dataD() const;
349 Vc_ALWAYS_INLINE
EntryType operator[](
size_t index) const;
353 Vc_ALWAYS_INLINE
int count() const;
365 Vc_ALWAYS_INLINE
int firstOne() const;
374 Vc_ALWAYS_INLINE
int toInt() const;
377 Vc_INTRINSIC Vc_PURE
Mask shifted(
int amount) const;
380 void setEntry(
size_t,
bool x);
388 #endif // VC_COMMON_MASK_H_
typename VectorTraits< T, Abi >::EntryReference EntryReference
The reference wrapper type used for accessing individual mask components.
bool EntryType
The EntryType of masks is always bool, independent of T.
static constexpr size_t size()
Returns the number of boolean components ( ) in a mask of this type.
Abi abi
The ABI tag type of the current template instantiation.
EntryType value_type
The EntryType of masks is always bool, independent of T.
typename VectorTraits< T, Abi >::VectorEntryType VectorEntryType
The VectorEntryType, in contrast to EntryType, reveals information about the SIMD implementation...
EntryReference value_reference
The reference wrapper type used for accessing individual mask components.
The main SIMD mask class.
constexpr VectorSpecialInitializerZero Zero
The special object Vc::Zero can be used to construct Vector and Mask objects initialized to zero/fals...
Adapter< S, T, N > shifted(const Adapter< S, T, N > &a, int shift)
Returns a new vectorized object where each entry is shifted by shift.
constexpr VectorSpecialInitializerOne One
The special object Vc::One can be used to construct Vector and Mask objects initialized to one/true...
constexpr std::size_t MemoryAlignment
Specifies the most conservative memory alignment necessary for aligned loads and stores of Vector typ...