A per-lane boolean for vectors of type VectorType, as returned by comparisons.
More...
|
|
ace | Predicate (storage_type p) |
| | Construct from the native predicate representation (see storage_type).
|
| template<typename OtherVectorType> |
| ace | Predicate (Predicate< OtherVectorType > other) |
| | Convert from the predicate of another vector type with the same lanes, e.g.
|
|
ace argon_mask_type | ToMask () const |
| | Expand the predicate into a mask vector: every bit set in active lanes, clear in inactive ones.
|
|
ace | operator argon_mask_type () const |
| | Implicitly convert to the mask vector that comparisons used to return.
|
|
ace storage_type | native () const |
| | The native predicate representation: a mask vector on NEON, an mve_pred16_t on MVE.
|
|
ace Predicate | operator& (Predicate b) const |
| | Lanes active in both predicates.
|
|
ace Predicate | operator| (Predicate b) const |
| | Lanes active in either predicate.
|
|
ace Predicate | operator^ (Predicate b) const |
| | Lanes active in exactly one of the predicates.
|
|
ace Predicate | operator~ () const |
| | Invert every lane.
|
| ace Predicate | operator&& (Predicate b) const |
| | Lanes active in both predicates; the same as &.
|
| ace Predicate | operator|| (Predicate b) const |
| | Lanes active in either predicate; the same as |.
|
|
ace Predicate | operator! () const |
| | Invert every lane; the same as ~.
|
| template<typename ArgType> |
| ace ArgType | Select (ArgType true_value, ArgType false_value) const |
| | Choose each lane from true_value where the predicate is active, and from false_value otherwise.
|
|
ace bool | Any () const |
| | Whether any lane is active.
|
|
ace bool | All () const |
| | Whether every lane is active.
|
|
ace bool | None () const |
| | Whether no lane is active.
|
|
ace size_t | Count () const |
| | The number of active lanes.
|
| ace bool | Active (size_t i) const |
| | Whether a single lane is active.
|
|
ace std::array< bool, lanes > | to_array () const |
| | The active state of every lane, in lane order.
|
template<typename VectorType>
class argon::Predicate< VectorType >
A per-lane boolean for vectors of type VectorType, as returned by comparisons.
- Template Parameters
-
| VectorType | The vector type the predicate applies to (e.g., int32x4_t, float32x4_t). |
On NEON a predicate is a mask vector, with every bit of a lane set when the lane is active. On MVE it is an mve_pred16_t, with one bit per byte of the vector, so a 32-bit lane owns four bits. The interface is the same on both, so code written against it is portable; use ToMask() where a mask vector is genuinely needed.
template<typename VectorType>
template<typename OtherVectorType>
| ace argon::Predicate< VectorType >::Predicate |
( |
Predicate< OtherVectorType > | other | ) |
|
|
inline |
Convert from the predicate of another vector type with the same lanes, e.g.
an int32 comparison used to mask a float32 store. The lanes mean the same thing, so the conversion is free.