|
JPL Spatial
Sound spatialization and propagation library
|
Minimal 4-wide 32-bit float vector implementation for SIMD. More...
#include <JPLSpatial/Math/SIMD.h>
Public Types | |
| using | Type = std::array< float, 4 > |
Static Public Member Functions | |
| template<int Scale> | |
| static JPL_INLINE simd | gather (const float *base, const simd_mask &offsets) |
| Gather 4 floats from memory at base + offsets[i] * Scale. | |
| static JPL_INLINE simd | zero () noexcept |
| Vector with all zeros. | |
| static JPL_INLINE simd | nan () noexcept |
| Vector with all NaN's. | |
| static JPL_INLINE simd | inf () noexcept |
| static JPL_INLINE simd | c_0 () noexcept |
| Frequently used constants. | |
| static JPL_INLINE simd | c_1 () noexcept |
| static JPL_INLINE simd | c_0p5 () noexcept |
| static JPL_INLINE simd | c_pi () noexcept |
| static constexpr std::size_t | size () noexcept |
| Get number of element of the vector. | |
| static JPL_INLINE simd | select (const simd_mask &mask, const simd &a, const simd &b) noexcept |
| Component-wise select, returns 'a' if mask is true, 'b' otherwise. | |
| static JPL_INLINE simd | reciprocal (const simd &vec) noexcept |
| Reciprocal vector (1 / value) for each of the components. | |
Public Attributes | |
| Type | mNative |
Friends | |
| JPL_INLINE simd | operator* (float value, const simd &other) noexcept |
| Multiply vector with float. | |
| std::ostream & | operator<< (std::ostream &inStream, const simd &vec) |
Minimal 4-wide 32-bit float vector implementation for SIMD.
| using JPL::simd::Type = std::array<float, 4> |
|
defaultnoexcept |
|
inlinenoexcept |
|
noexcept |
|
noexcept |
| JPL_INLINE JPL::simd::simd | ( | const float * | mem | ) |
|
noexcept |
Reinterpret simd as a simd_mask (doesn't change the bits)
|
staticnoexcept |
Frequently used constants.
|
staticnoexcept |
|
staticnoexcept |
|
staticnoexcept |
|
static |
Gather 4 floats from memory at base + offsets[i] * Scale.
|
noexcept |
Get float component by index known at compile-time.
|
staticnoexcept |
| JPL_INLINE void JPL::simd::load | ( | const float * | mem | ) |
Load values from memory into simd, 'mem' should point to memory with at least size() number of floats.
|
staticnoexcept |
Vector with all NaN's.
|
inlinenoexcept |
|
noexcept |
Component-wise logical AND.
|
noexcept |
Multiply two float vectors (component wise)
|
noexcept |
Multiply vector with float.
|
noexcept |
Multiply vector with vector.
|
noexcept |
Multiply vector with float.
|
noexcept |
Add two float vectors (component wise)
|
noexcept |
Add two float vectors (component wise)
|
noexcept |
Negate.
|
noexcept |
Subtract two float vectors (component wise)
|
noexcept |
Subtract two float vectors (component wise)
|
noexcept |
Divide (component wise)
|
noexcept |
Divide vector by float.
|
noexcept |
Divide vector by vector.
|
noexcept |
Divide vector by float.
|
noexcept |
Get float component by index.
|
noexcept |
Component-wise logical XOR.
|
noexcept |
Component-wise logical OR.
|
staticnoexcept |
Reciprocal vector (1 / value) for each of the components.
|
noexcept |
Returns sum of all components.
|
noexcept |
Returns max component.
|
inlinenoexcept |
Returns mean of the components.
|
noexcept |
Returns min component.
|
staticnoexcept |
Component-wise select, returns 'a' if mask is true, 'b' otherwise.
Get number of element of the vector.
| JPL_INLINE simd JPL::simd::splat | ( | ) | const |
Replicate component at LaneIndex to all components.
| JPL_INLINE void JPL::simd::store | ( | float * | mem | ) | const |
Store values from simd to provided memory location.
|
noexcept |
Convert each component from a float to an int.
|
staticnoexcept |
Vector with all zeros.
| Type JPL::simd::mNative |