|
Argon 0.1.0
|
A 128-bit SIMD vector wrapping a scalar type, providing arithmetic, logical, and data-movement operations. More...
Namespaces | |
| namespace | helpers |
| Contains helper templates and concepts for type manipulation and compile-time utilities. | |
Classes | |
| class | CondMonad |
| The result of if_(...) and each else_if_(...): a value chosen per lane by a chain of conditions. More... | |
| struct | Bool |
| Helper template to determine the boolean type of a SIMD operation. More... | |
| class | Vector |
| Represents a SIMD vector with various operations. More... | |
| class | ConstLane |
| Represents a single lane of a SIMD vector with the lane index known at compile time. More... | |
| class | Lane |
| Represents a single lane of a SIMD vector with a runtime-determined index. More... | |
| class | PointerVector |
| One pointer per lane, gathered from and scattered to together, and advanced together: walking several buffers (channels, matrix columns, filter states) at once. More... | |
| class | Predicate |
| A per-lane boolean for vectors of type VectorType, as returned by comparisons. More... | |
Concepts | |
| concept | widenable_from |
| Whether lanes of integer type W can be loaded from (and stored as) the narrower integer type N, as MVE's widening loads and narrowing stores allow: 8-bit into 16- or 32-bit lanes, 16-bit into 32-bit lanes. | |
| concept | lane_scalar |
| A scalar type a vector lane can hold: an arithmetic type, or float16_t where half-float vectors exist. | |
| concept | lane_floating_point |
| A floating-point lane type: float, double, or float16_t where half-float vectors exist. | |
| concept | arithmetic |
Typedefs | |
| template<typename VectorType, typename ScalarType> | |
| using | VectorFor_t |
| The Argon type holding ScalarType values with the same width as VectorType (Argon or ArgonHalf). | |
| template<typename T> | |
| using | Bool_t = Bool<T>::type |
| Helper alias to get the boolean type of a SIMD operation. | |
Enumerations | |
| enum class | DotForm { Plain , Exchange , Subtract , SubtractExchange } |
| The forms of Argon::DotProduct and friends. See Argon::DotProduct. | |
| enum class | Platform { NEON , MVE , SIMDe } |
Functions | |
| template<typename T, typename V> | |
| ace auto | reinterpret (Vector< V > in) |
| Reinterpret a vector of one type to another. | |
| template<typename argon_type, simd::is_vector_type V> | |
| ace argon_type | reinterpret (V in) |
| Reinterpret a vector of one type to another. | |
| template<typename ScalarType, typename ArgonType> | |
| ace ScalarType | bit_cast (ArgonType in) |
| Reinterpret a vector of one type to another. | |
| template<typename argon_type> | |
| ace std::array< argon_type, 2 > | zip (argon_type a, argon_type b) |
| Zip two vectors together into a pair of output vectors. | |
| template<typename argon_type> | |
| ace std::array< argon_type, 2 > | unzip (argon_type a, argon_type b) |
| Unzip vectors into a pair of output vectors. | |
| template<typename argon_type> | |
| ace std::array< argon_type, 2 > | transpose (argon_type a, argon_type b) |
| Treats the lanes of its inputs as elements of a 2x2 matrix and transposes the matrices. | |
| template<typename T> | |
| ace Argon< T > | combine (ArgonHalf< T > low, ArgonHalf< T > high) |
| Combine two double-word vectors into a single quad-word vector. | |
| template<typename T> | |
| ace Argon< T > | load (const T *ptr) |
| Load a quad-word vector from a pointer. | |
| template<typename T> | |
| ace ArgonHalf< T > | load_half (const T *ptr) |
| Load a double-word vector from a pointer. | |
| template<typename VectorType, typename BranchType> | |
| ace BranchType | ternary (Predicate< VectorType > condition, BranchType true_value, BranchType false_value) |
| Create a new vector depending on the result of a conditional. | |
| template<typename MaskType, typename BranchType> | |
| ace BranchType | ternary (MaskType mask, BranchType true_value, BranchType false_value) |
| Create a new vector depending on the result of a conditional. | |
| template<typename MaskType, typename ValueType> | |
| ace auto | ternary (MaskType mask, ValueType true_value, ValueType false_value) |
| Create a new vector depending on the result of a conditional. | |
| template<typename BranchType, typename CondType> | |
| ace BranchType | ternary (CondType condition, BranchType true_value, BranchType false_value) |
| template<typename VectorType, typename ValueType> | |
| ace auto | ternary (Predicate< VectorType > condition, ValueType true_value, ValueType false_value) |
| Create a new vector depending on the result of a conditional. | |
| template<typename VectorType, typename ValueType> | |
| ace CondMonad< VectorType, ValueType > | if_ (Predicate< VectorType > condition, ValueType value) |
| Start a per-lane if / else-if / else chain: value in the lanes where condition holds. | |
| template<typename VectorType, typename ScalarType> | |
| ace auto | if_ (Predicate< VectorType > condition, ScalarType value) |
| Start a per-lane if / else-if / else chain: value in the lanes where condition holds. | |
| template<typename VectorType, std::invocable FunctionType> | |
| ace auto | if_ (Predicate< VectorType > condition, FunctionType func) |
| Start a per-lane if / else-if / else chain: value in the lanes where condition holds. | |
| template<class T, std::size_t N> | |
| constexpr std::array< helpers::ArgonFor_t< T >, N > | to_array (T(&a)[N]) |
| Convert a C-style array of vector types to a std::array of Argon types. | |
| template<class T, std::size_t N> | |
| constexpr std::array< helpers::ArgonFor_t< T >, N > | to_array (T(&&a)[N]) |
| Convert a C-style array of vector types to a std::array of Argon types. | |
| template<typename scalar_type> | |
| std::pair< std::span< scalar_type >, std::span< scalar_type > > | split_head_aligned (std::span< scalar_type > span) |
| Split a span into two spans, with the first span aligned to the vector size. | |
| template<typename scalar_type> | |
| std::pair< std::span< scalar_type >, std::span< scalar_type > > | split_tail_aligned (std::span< scalar_type > span) |
| Split a span into two spans, with the second span aligned to the vector size. | |
| template<size_t stride, typename scalar_type, typename intrinsic_type> | |
| ace void | store_interleaved (scalar_type *ptr, simd::MultiVector_t< intrinsic_type, stride > multi_vec) |
| Store a multi-vector to a location in memory with interleaving. | |
| template<size_t stride, typename scalar_type, typename argon_type> | |
| ace void | store_interleaved (scalar_type *ptr, std::array< argon_type, stride > multi_vec) |
| Store an array of vectors to a location in memory with interleaving. | |
| template<typename scalar_type, typename... argon_types> | |
| ace void | store_interleaved (scalar_type *ptr, argon_types... vecs) |
| Store vectors to a location in memory with interleaving. | |
| template<typename scalar_type, typename argon_type> | |
| ace void | store (scalar_type *ptr, argon_type vector) |
| Store a vector to a location in memory. | |
| template<typename scalar_type, simd::is_vector_type intrinsic_type> | |
| ace void | store (scalar_type *ptr, intrinsic_type vector) |
| Store a vector to a location in memory. | |
| template<int lane, size_t stride, typename scalar_type, typename argon_type> | |
| ace void | store_lane_interleaved (scalar_type *ptr, std::array< argon_type, stride > multi_vec) |
| Store a lane of an array of vectors to a location in memory with interleaving. | |
| template<int lane, size_t stride, typename scalar_type, typename intrinsic_type> | |
| ace void | store_lane_interleaved (scalar_type *ptr, simd::MultiVector_t< intrinsic_type, stride > multi_vec) |
| Store a lane of a multi-vector to a location in memory with interleaving. | |
Variables | |
| constexpr Platform | platform = Platform::SIMDe |
| template<typename T> | |
| constexpr bool | is_half_float_v |
| Whether T is the half-precision lane type, float16_t (__fp16), on a platform with half-float vectors. | |
| template<typename T, typename... Ts> | |
| constexpr bool | is_one_of = std::disjunction_v<std::is_same<T, Ts>...> |
| Helper template to check if a type is one of the specified types. | |
A 128-bit SIMD vector wrapping a scalar type, providing arithmetic, logical, and data-movement operations.
| ScalarType | The element type (e.g., int32_t, float, uint8_t). |
Inherits all lane-wise operations from argon::Vector and adds 128-bit-specific operations such as narrowing, widening multiplies, cross-half operations, reductions, and (optionally) AES acceleration. Use ArgonHalf<ScalarType> for the 64-bit sibling.
| using argon::Bool_t = Bool<T>::type |
Helper alias to get the boolean type of a SIMD operation.
| T | The SIMD vector type (e.g., int8x16_t, float32x4_t). |
| using argon::VectorFor_t |
The Argon type holding ScalarType values with the same width as VectorType (Argon or ArgonHalf).
| ace ScalarType argon::bit_cast | ( | ArgonType | in | ) |
Reinterpret a vector of one type to another.
| argon_type | The type to reinterpret to |
| V | The type to reinterpret from |
| in | The vector to reinterpret |
Combine two double-word vectors into a single quad-word vector.
| T | The type of the vectors to combine |
| low | The low half of the vector |
| high | The high half of the vector |
| ace auto argon::if_ | ( | Predicate< VectorType > | condition, |
| FunctionType | func ) |
Start a per-lane if / else-if / else chain: value in the lanes where condition holds.
argon::if_(x < lo, lo).else_if_(x > hi, hi).else_(x) clamps x to [lo, hi].
| ace auto argon::if_ | ( | Predicate< VectorType > | condition, |
| ScalarType | value ) |
Start a per-lane if / else-if / else chain: value in the lanes where condition holds.
argon::if_(x < lo, lo).else_if_(x > hi, hi).else_(x) clamps x to [lo, hi].
| ace CondMonad< VectorType, ValueType > argon::if_ | ( | Predicate< VectorType > | condition, |
| ValueType | value ) |
Start a per-lane if / else-if / else chain: value in the lanes where condition holds.
argon::if_(x < lo, lo).else_if_(x > hi, hi).else_(x) clamps x to [lo, hi].
| ace Argon< T > argon::load | ( | const T * | ptr | ) |
Load a quad-word vector from a pointer.
| T | The type of the vector to load |
| ptr | The pointer to load from |
| ace ArgonHalf< T > argon::load_half | ( | const T * | ptr | ) |
Load a double-word vector from a pointer.
| T | The type of the vector to load |
| ptr | The pointer to load from |
| ace argon_type argon::reinterpret | ( | V | in | ) |
Reinterpret a vector of one type to another.
| argon_type | The type to reinterpret to |
| V | The type to reinterpret from |
| in | The vector to reinterpret |
| ace auto argon::reinterpret | ( | Vector< V > | in | ) |
Reinterpret a vector of one type to another.
| T | The type to reinterpret to |
| V | The type to reinterpret from |
| in | The vector to reinterpret |
| std::pair< std::span< scalar_type >, std::span< scalar_type > > argon::split_head_aligned | ( | std::span< scalar_type > | span | ) |
Split a span into two spans, with the first span aligned to the vector size.
| span | The span to split |
| std::pair< std::span< scalar_type >, std::span< scalar_type > > argon::split_tail_aligned | ( | std::span< scalar_type > | span | ) |
Split a span into two spans, with the second span aligned to the vector size.
| span | The span to split |
| ace void argon::store | ( | scalar_type * | ptr, |
| argon_type | vector ) |
Store a vector to a location in memory.
| ptr | The location to store to |
| vector | The vector to store |
| ace void argon::store | ( | scalar_type * | ptr, |
| intrinsic_type | vector ) |
Store a vector to a location in memory.
| ptr | The location to store to |
| vector | The vector to store |
| ace void argon::store_interleaved | ( | scalar_type * | ptr, |
| argon_types... | vecs ) |
Store vectors to a location in memory with interleaving.
| ptr | The location to store to |
| vecs | The vectors to store |
| ace void argon::store_interleaved | ( | scalar_type * | ptr, |
| simd::MultiVector_t< intrinsic_type, stride > | multi_vec ) |
Store a multi-vector to a location in memory with interleaving.
| stride | The interleaving stride: 2, 3, 4 |
| ptr | The location to store to |
| multi_vec | The multi-vector to store |
| ace void argon::store_interleaved | ( | scalar_type * | ptr, |
| std::array< argon_type, stride > | multi_vec ) |
Store an array of vectors to a location in memory with interleaving.
| stride | The interleaving stride: 2, 3, 4 |
| ptr | The location to store to |
| multi_vec | The multi-vector to store |
| ace void argon::store_lane_interleaved | ( | scalar_type * | ptr, |
| simd::MultiVector_t< intrinsic_type, stride > | multi_vec ) |
Store a lane of a multi-vector to a location in memory with interleaving.
| lane | The lane to store |
| stride | The interleaving stride: 2, 3, 4 |
| ptr | The location to store to |
| multi_vec | The multi-vector to store |
| ace void argon::store_lane_interleaved | ( | scalar_type * | ptr, |
| std::array< argon_type, stride > | multi_vec ) |
Store a lane of an array of vectors to a location in memory with interleaving.
| lane | The lane to store: |
| stride | The interleaving stride: 2, 3, 4 |
| ptr | The location to store to |
| multi_vec | The array to store |
| ace BranchType argon::ternary | ( | MaskType | mask, |
| BranchType | true_value, | ||
| BranchType | false_value ) |
Create a new vector depending on the result of a conditional.
| VectorType | The vector type the condition was computed from |
| BranchType | The type of the branches |
| condition | The predicate to select by |
| true_value | The vector to select lanes from if the condition is true |
| false_value | The vector to select lanes from if the condition is false |
Selects by a mask vector (all ones / all zeros per lane), e.g. from Predicate::ToMask().
| ace auto argon::ternary | ( | MaskType | mask, |
| ValueType | true_value, | ||
| ValueType | false_value ) |
Create a new vector depending on the result of a conditional.
| VectorType | The vector type the condition was computed from |
| BranchType | The type of the branches |
| condition | The predicate to select by |
| true_value | The vector to select lanes from if the condition is true |
| false_value | The vector to select lanes from if the condition is false |
| ace BranchType argon::ternary | ( | Predicate< VectorType > | condition, |
| BranchType | true_value, | ||
| BranchType | false_value ) |
Create a new vector depending on the result of a conditional.
| VectorType | The vector type the condition was computed from |
| BranchType | The type of the branches |
| condition | The predicate to select by |
| true_value | The vector to select lanes from if the condition is true |
| false_value | The vector to select lanes from if the condition is false |
| ace auto argon::ternary | ( | Predicate< VectorType > | condition, |
| ValueType | true_value, | ||
| ValueType | false_value ) |
Create a new vector depending on the result of a conditional.
| VectorType | The vector type the condition was computed from |
| BranchType | The type of the branches |
| condition | The predicate to select by |
| true_value | The vector to select lanes from if the condition is true |
| false_value | The vector to select lanes from if the condition is false |
|
constexpr |
|
constexpr |
| ace std::array< argon_type, 2 > argon::transpose | ( | argon_type | a, |
| argon_type | b ) |
Treats the lanes of its inputs as elements of a 2x2 matrix and transposes the matrices.
| argon_type | The type of the vectors to transpose |
| a | The first vector |
| b | The second vector |
Given two vectors: {a0, a1, a2, a3}, {b0, b1, b2, b3} The result will be: {b1, a1, b3, a3}, {b0, a0, b2, a2}
| ace std::array< argon_type, 2 > argon::unzip | ( | argon_type | a, |
| argon_type | b ) |
Unzip vectors into a pair of output vectors.
| argon_type | The type of the vectors to unzip |
| a | The first vector |
| b | The second vector |
Given two vectors: {a0, b0, a1, b1}, {a2, b2, a3, b3} The result will be: {a0, a1, a2, a3}, {b0, b1, b2, b3}
| ace std::array< argon_type, 2 > argon::zip | ( | argon_type | a, |
| argon_type | b ) |
Zip two vectors together into a pair of output vectors.
| argon_type | The type of the vectors to zip |
| a | The first vector |
| b | The second vector |
Given two vectors: {a0, a1, a2, a3}, {b0, b1, b2, b3} The result will be: {a0, b0, a1, b1}, {a2, b2, a3, b3}
|
constexpr |
Whether T is the half-precision lane type, float16_t (__fp16), on a platform with half-float vectors.
The standard type traits don't count __fp16 as arithmetic or floating point, so it needs naming.
|
inlineconstexpr |
Helper template to check if a type is one of the specified types.
| T | The type to check. |
| Ts | The types to check against. |
This template uses a variadic template to check if T is one of the types in Ts.