![]() |
VCV Rack API v2
|
Wrapper for __m128 representing an aligned vector of 4 single-precision float values. More...
#include <Vector.hpp>
Public Types | |
| using | type = float |
Public Member Functions | |
| Vector ()=default | |
| Constructs an uninitialized vector. | |
| Vector (__m128 v) | |
| Constructs a vector from a native __m128 type. | |
| Vector (float x) | |
| Constructs a vector with all elements set to x. | |
| Vector (float x1, float x2, float x3, float x4) | |
| Constructs a vector from four scalars. | |
| void | store (float *x) |
| Writes an array of 4 values. | |
| float & | operator[] (int i) |
| Accessing vector elements individually is slow and defeats the purpose of vectorizing. | |
| const float & | operator[] (int i) const |
| Vector (Vector< int32_t, 4 > a) | |
Static Public Member Functions | |
| static Vector | zero () |
| Returns a vector with all 0 bits. | |
| static Vector | mask () |
| Returns a vector with all 1 bits. | |
| static Vector | load (const float *x) |
| Reads an array of 4 values. | |
| static Vector | cast (Vector< int32_t, 4 > a) |
Public Attributes | |
| union rack::simd::Vector< float, 4 >:: { ... } | |
Static Public Attributes | |
| static constexpr int | size = 4 |
Wrapper for __m128 representing an aligned vector of 4 single-precision float values.
| using rack::simd::Vector< float, 4 >::type = float |
|
default |
Constructs an uninitialized vector.
|
inline |
Constructs a vector from a native __m128 type.
|
inline |
Constructs a vector with all elements set to x.
|
inline |
Constructs a vector from four scalars.
|
inline |
|
inlinestatic |
Returns a vector with all 0 bits.
|
inlinestatic |
Returns a vector with all 1 bits.
|
inlinestatic |
Reads an array of 4 values.
On little-endian machines (e.g. x86_64), the order is reversed, so x[0] corresponds to vector.s[3].
|
inline |
Writes an array of 4 values.
On little-endian machines (e.g. x86_64), the order is reversed, so x[0] corresponds to vector.s[3].
|
inline |
Accessing vector elements individually is slow and defeats the purpose of vectorizing.
However, this operator is convenient when writing simple serial code in a non-bottlenecked section.
|
inline |
|
inlinestatic |
|
staticconstexpr |
| __m128 rack::simd::Vector< float, 4 >::v |
| float rack::simd::Vector< float, 4 >::s[4] |
Accessing this array of scalars is slow and defeats the purpose of vectorizing.
| union rack::simd::Vector< float, 4 > { ... } rack::simd::Vector< float, 4 > |