VCV Rack API v2
Loading...
Searching...
No Matches
rack::simd Namespace Reference

Abstraction of aligned types for SIMD computation. More...

Classes

struct  Vector
 Generic class for vector types. More...
 
struct  Vector< float, 4 >
 Wrapper for __m128 representing an aligned vector of 4 single-precision float values. More...
 
struct  Vector< int32_t, 4 >
 

Typedefs

using float_4 = Vector<float, 4>
 
using int32_4 = Vector<int32_t, 4>
 

Functions

float_4 andnot (float_4 a, float_4 b)
 ~a & b
 
int movemask (float_4 a)
 Returns an integer with each bit corresponding to the most significant bit of each element.
 
int movemask (int32_4 a)
 Returns an integer with each bit corresponding to the most significant bit of each element.
 
float_4 rsqrt (float_4 x)
 Returns the approximate reciprocal square root.
 
float_4 rcp (float_4 x)
 Returns the approximate reciprocal.
 
float ifelse (bool cond, float a, float b)
 
float_4 ifelse (float_4 mask, float_4 a, float_4 b)
 Given a mask, returns a if mask is 0xffffffff per element, b if mask is 0x00000000.
 
template<typename T >
movemaskInverse (int a)
 Returns a vector where element N is all 1's if the N'th bit of a is 1, or all 0's if the N'th bit of a is 0.
 
template<>
int32_4 movemaskInverse< int32_4 > (int a)
 
template<>
float_4 movemaskInverse< float_4 > (int a)
 
float_4 fmax (float_4 x, float_4 b)
 
float_4 fmin (float_4 x, float_4 b)
 
float_4 sqrt (float_4 x)
 
float_4 log (float_4 x)
 
float_4 log10 (float_4 x)
 
float_4 log2 (float_4 x)
 
float_4 exp (float_4 x)
 
float_4 sin (float_4 x)
 
float_4 cos (float_4 x)
 
float_4 tan (float_4 x)
 
float_4 atan (float_4 x)
 
float_4 atan2 (float_4 x, float_4 y)
 
float_4 trunc (float_4 a)
 
float_4 floor (float_4 a)
 
float_4 ceil (float_4 a)
 
float_4 round (float_4 a)
 
float_4 fmod (float_4 a, float_4 b)
 
float_4 hypot (float_4 a, float_4 b)
 
float_4 fabs (float_4 a)
 
float_4 abs (float_4 a)
 
float_4 abs (std::complex< float_4 > a)
 
float_4 arg (std::complex< float_4 > a)
 
float_4 pow (float_4 a, float_4 b)
 
float_4 pow (float a, float_4 b)
 
template<typename T >
pow (T a, int b)
 
float_4 clamp (float_4 x, float_4 a=0.f, float_4 b=1.f)
 
float_4 rescale (float_4 x, float_4 xMin, float_4 xMax, float_4 yMin, float_4 yMax)
 
float_4 crossfade (float_4 a, float_4 b, float_4 p)
 
float_4 sgn (float_4 x)
 
Vector< int32_t, 4 > operator>= (const Vector< int32_t, 4 > &a, const Vector< int32_t, 4 > &b)
 
Vector< int32_t, 4 > operator<= (const Vector< int32_t, 4 > &a, const Vector< int32_t, 4 > &b)
 
Vector< int32_t, 4 > operator!= (const Vector< int32_t, 4 > &a, const Vector< int32_t, 4 > &b)
 
Vector< float, 4 > operator+ (const Vector< float, 4 > &a)
 +a
 
Vector< int32_t, 4 > operator+ (const Vector< int32_t, 4 > &a)
 
Vector< float, 4 > operator- (const Vector< float, 4 > &a)
 -a
 
Vector< int32_t, 4 > operator- (const Vector< int32_t, 4 > &a)
 
Vector< float, 4 > & operator++ (Vector< float, 4 > &a)
 ++a
 
Vector< int32_t, 4 > & operator++ (Vector< int32_t, 4 > &a)
 
Vector< float, 4 > & operator-- (Vector< float, 4 > &a)
 --a
 
Vector< int32_t, 4 > & operator-- (Vector< int32_t, 4 > &a)
 
Vector< float, 4 > operator++ (Vector< float, 4 > &a, int)
 a++
 
Vector< int32_t, 4 > operator++ (Vector< int32_t, 4 > &a, int)
 
Vector< float, 4 > operator-- (Vector< float, 4 > &a, int)
 a--
 
Vector< int32_t, 4 > operator-- (Vector< int32_t, 4 > &a, int)
 
Vector< float, 4 > operator~ (const Vector< float, 4 > &a)
 ~a
 
Vector< int32_t, 4 > operator~ (const Vector< int32_t, 4 > &a)
 
Vector< int32_t, 4 > operator<< (const Vector< int32_t, 4 > &a, const int &b)
 a << b
 
Vector< int32_t, 4 > operator>> (const Vector< int32_t, 4 > &a, const int &b)
 a >> b
 

Detailed Description

Abstraction of aligned types for SIMD computation.

Typedef Documentation

◆ float_4

using rack::simd::float_4 = Vector<float, 4>

◆ int32_4

using rack::simd::int32_4 = Vector<int32_t, 4>

Function Documentation

◆ andnot()

float_4 rack::simd::andnot ( float_4 a,
float_4 b )
inline

~a & b

◆ movemask() [1/2]

int rack::simd::movemask ( float_4 a)
inline

Returns an integer with each bit corresponding to the most significant bit of each element.

For example, movemask(float_4::mask()) returns 0xf.

◆ movemask() [2/2]

int rack::simd::movemask ( int32_4 a)
inline

Returns an integer with each bit corresponding to the most significant bit of each element.

For example, movemask(int32_4::mask()) returns 0xf.

◆ rsqrt()

float_4 rack::simd::rsqrt ( float_4 x)
inline

Returns the approximate reciprocal square root.

Much faster than 1/sqrt(x).

◆ rcp()

float_4 rack::simd::rcp ( float_4 x)
inline

Returns the approximate reciprocal.

Much faster than 1/x.

◆ ifelse() [1/2]

float rack::simd::ifelse ( bool cond,
float a,
float b )
inline

◆ ifelse() [2/2]

float_4 rack::simd::ifelse ( float_4 mask,
float_4 a,
float_4 b )
inline

Given a mask, returns a if mask is 0xffffffff per element, b if mask is 0x00000000.

◆ movemaskInverse()

template<typename T >
T rack::simd::movemaskInverse ( int a)

Returns a vector where element N is all 1's if the N'th bit of a is 1, or all 0's if the N'th bit of a is 0.

◆ movemaskInverse< int32_4 >()

template<>
int32_4 rack::simd::movemaskInverse< int32_4 > ( int a)
inline

◆ movemaskInverse< float_4 >()

template<>
float_4 rack::simd::movemaskInverse< float_4 > ( int a)
inline

◆ fmax()

float_4 rack::simd::fmax ( float_4 x,
float_4 b )
inline

◆ fmin()

float_4 rack::simd::fmin ( float_4 x,
float_4 b )
inline

◆ sqrt()

float_4 rack::simd::sqrt ( float_4 x)
inline

◆ log()

float_4 rack::simd::log ( float_4 x)
inline

◆ log10()

float_4 rack::simd::log10 ( float_4 x)
inline

◆ log2()

float_4 rack::simd::log2 ( float_4 x)
inline

◆ exp()

float_4 rack::simd::exp ( float_4 x)
inline

◆ sin()

float_4 rack::simd::sin ( float_4 x)
inline

◆ cos()

float_4 rack::simd::cos ( float_4 x)
inline

◆ tan()

float_4 rack::simd::tan ( float_4 x)
inline

◆ atan()

float_4 rack::simd::atan ( float_4 x)
inline

◆ atan2()

float_4 rack::simd::atan2 ( float_4 x,
float_4 y )
inline

◆ trunc()

float_4 rack::simd::trunc ( float_4 a)
inline

◆ floor()

float_4 rack::simd::floor ( float_4 a)
inline

◆ ceil()

float_4 rack::simd::ceil ( float_4 a)
inline

◆ round()

float_4 rack::simd::round ( float_4 a)
inline

◆ fmod()

float_4 rack::simd::fmod ( float_4 a,
float_4 b )
inline

◆ hypot()

float_4 rack::simd::hypot ( float_4 a,
float_4 b )
inline

◆ fabs()

float_4 rack::simd::fabs ( float_4 a)
inline

◆ abs() [1/2]

float_4 rack::simd::abs ( float_4 a)
inline

◆ abs() [2/2]

float_4 rack::simd::abs ( std::complex< float_4 > a)
inline

◆ arg()

float_4 rack::simd::arg ( std::complex< float_4 > a)
inline

◆ pow() [1/3]

float_4 rack::simd::pow ( float_4 a,
float_4 b )
inline

◆ pow() [2/3]

float_4 rack::simd::pow ( float a,
float_4 b )
inline

◆ pow() [3/3]

template<typename T >
T rack::simd::pow ( T a,
int b )

◆ clamp()

float_4 rack::simd::clamp ( float_4 x,
float_4 a = 0.f,
float_4 b = 1.f )
inline

◆ rescale()

float_4 rack::simd::rescale ( float_4 x,
float_4 xMin,
float_4 xMax,
float_4 yMin,
float_4 yMax )
inline

◆ crossfade()

float_4 rack::simd::crossfade ( float_4 a,
float_4 b,
float_4 p )
inline

◆ sgn()

float_4 rack::simd::sgn ( float_4 x)
inline

◆ operator>=()

Vector< int32_t, 4 > rack::simd::operator>= ( const Vector< int32_t, 4 > & a,
const Vector< int32_t, 4 > & b )
inline

◆ operator<=()

Vector< int32_t, 4 > rack::simd::operator<= ( const Vector< int32_t, 4 > & a,
const Vector< int32_t, 4 > & b )
inline

◆ operator!=()

Vector< int32_t, 4 > rack::simd::operator!= ( const Vector< int32_t, 4 > & a,
const Vector< int32_t, 4 > & b )
inline

◆ operator+() [1/2]

Vector< float, 4 > rack::simd::operator+ ( const Vector< float, 4 > & a)
inline

+a

◆ operator+() [2/2]

Vector< int32_t, 4 > rack::simd::operator+ ( const Vector< int32_t, 4 > & a)
inline

◆ operator-() [1/2]

Vector< float, 4 > rack::simd::operator- ( const Vector< float, 4 > & a)
inline

-a

◆ operator-() [2/2]

Vector< int32_t, 4 > rack::simd::operator- ( const Vector< int32_t, 4 > & a)
inline

◆ operator++() [1/4]

Vector< float, 4 > & rack::simd::operator++ ( Vector< float, 4 > & a)
inline

++a

◆ operator++() [2/4]

Vector< int32_t, 4 > & rack::simd::operator++ ( Vector< int32_t, 4 > & a)
inline

◆ operator--() [1/4]

Vector< float, 4 > & rack::simd::operator-- ( Vector< float, 4 > & a)
inline

--a

◆ operator--() [2/4]

Vector< int32_t, 4 > & rack::simd::operator-- ( Vector< int32_t, 4 > & a)
inline

◆ operator++() [3/4]

Vector< float, 4 > rack::simd::operator++ ( Vector< float, 4 > & a,
int  )
inline

a++

◆ operator++() [4/4]

Vector< int32_t, 4 > rack::simd::operator++ ( Vector< int32_t, 4 > & a,
int  )
inline

◆ operator--() [3/4]

Vector< float, 4 > rack::simd::operator-- ( Vector< float, 4 > & a,
int  )
inline

a--

◆ operator--() [4/4]

Vector< int32_t, 4 > rack::simd::operator-- ( Vector< int32_t, 4 > & a,
int  )
inline

◆ operator~() [1/2]

Vector< float, 4 > rack::simd::operator~ ( const Vector< float, 4 > & a)
inline

~a

◆ operator~() [2/2]

Vector< int32_t, 4 > rack::simd::operator~ ( const Vector< int32_t, 4 > & a)
inline

◆ operator<<()

Vector< int32_t, 4 > rack::simd::operator<< ( const Vector< int32_t, 4 > & a,
const int & b )
inline

a << b

◆ operator>>()

Vector< int32_t, 4 > rack::simd::operator>> ( const Vector< int32_t, 4 > & a,
const int & b )
inline

a >> b