T-SIMD v31.1.0
A C++ template SIMD library
Loading...
Searching...
No Matches
Horizontal Functions

Description

Horizontal Functions.

See also
Masked Horizontal Functions

Subgroups

 Iterative Horizontal Accumulation
 Classes for iterative horizontal accumulation.
 

Functions

template<typename T , size_t SIMD_WIDTH>
static Vec< T, SIMD_WIDTH > simd::hadd (const Vec< T, SIMD_WIDTH > &a, const Vec< T, SIMD_WIDTH > &b)
 Horizontally adds adjacent elements of two Vec's.
 
template<typename T , size_t SIMD_WIDTH>
static T simd::hadd (const Vec< T, SIMD_WIDTH > &v)
 Adds all elements of a Vec.
 
template<typename T , size_t SIMD_WIDTH>
static Vec< T, SIMD_WIDTH > simd::hadd (const Vec< T, SIMD_WIDTH > v[Vec< T, SIMD_WIDTH >::elems])
 Sums the elements of multiple Vec's independently and returns a Vec with the results.
 
template<typename T , size_t SIMD_WIDTH>
static Vec< T, SIMD_WIDTH > simd::hadds (const Vec< T, SIMD_WIDTH > &a, const Vec< T, SIMD_WIDTH > &b)
 Horizontally adds adjacent elements of two Vec's with saturation.
 
template<typename T , size_t SIMD_WIDTH>
static T simd::hadds (const Vec< T, SIMD_WIDTH > &v)
 Adds all elements of a Vec using saturated arithmetic.
 
template<typename T , size_t SIMD_WIDTH>
static Vec< T, SIMD_WIDTH > simd::hadds (const Vec< T, SIMD_WIDTH > v[Vec< T, SIMD_WIDTH >::elems])
 Sums the elements of multiple Vec's independently using saturated arithmetic and returns a Vec with the results.
 
template<typename T , size_t SIMD_WIDTH>
static T simd::hmax (const Vec< T, SIMD_WIDTH > &v)
 Calculates the maximum of all elements of a Vec.
 
template<typename T , size_t SIMD_WIDTH>
static T simd::hmin (const Vec< T, SIMD_WIDTH > &v)
 Calculates the minimum of all elements of a Vec.
 
template<typename T , size_t SIMD_WIDTH>
static Vec< T, SIMD_WIDTH > simd::hsub (const Vec< T, SIMD_WIDTH > &a, const Vec< T, SIMD_WIDTH > &b)
 Horizontally subtracts adjacent elements of two Vec's.
 
template<typename T , size_t SIMD_WIDTH>
static Vec< T, SIMD_WIDTH > simd::hsubs (const Vec< T, SIMD_WIDTH > &a, const Vec< T, SIMD_WIDTH > &b)
 Horizontally subtracts adjacent elements of two Vec's with saturation.
 
template<typename T , size_t SIMD_WIDTH>
static simd::Vec< T, SIMD_WIDTH > simd::integrate (const simd::Vec< T, SIMD_WIDTH > &v)
 Integrates the values of a Vec.
 

Function Documentation

◆ hadd() [1/3]

template<typename T , size_t SIMD_WIDTH>
static Vec< T, SIMD_WIDTH > simd::hadd ( const Vec< T, SIMD_WIDTH > & a,
const Vec< T, SIMD_WIDTH > & b )
inlinestatic

Horizontally adds adjacent elements of two Vec's.

Parameters
afirst Vec
bsecond Vec
Returns
Vec containing the results of the horizontal additions

◆ hadd() [2/3]

template<typename T , size_t SIMD_WIDTH>
static T simd::hadd ( const Vec< T, SIMD_WIDTH > & v)
inlinestatic

Adds all elements of a Vec.

Parameters
vinput Vec
Returns
sum of all elements of the Vec

◆ hadd() [3/3]

template<typename T , size_t SIMD_WIDTH>
static Vec< T, SIMD_WIDTH > simd::hadd ( const Vec< T, SIMD_WIDTH > v[Vec< T, SIMD_WIDTH >::elems])
inlinestatic

Sums the elements of multiple Vec's independently and returns a Vec with the results.

Parameters
[in]varray of Vec's to be summed. The number of Vec's must be equal to the number of elements in a Vec
Returns
Vec with the results of the horizontal sums

◆ hadds() [1/3]

template<typename T , size_t SIMD_WIDTH>
static Vec< T, SIMD_WIDTH > simd::hadds ( const Vec< T, SIMD_WIDTH > & a,
const Vec< T, SIMD_WIDTH > & b )
inlinestatic

Horizontally adds adjacent elements of two Vec's with saturation.

Note
Does not use saturated arithmetic with floating point types.
Parameters
afirst Vec
bsecond Vec
Returns
Vec containing the results of the horizontal saturated additions

◆ hadds() [2/3]

template<typename T , size_t SIMD_WIDTH>
static T simd::hadds ( const Vec< T, SIMD_WIDTH > & v)
inlinestatic

Adds all elements of a Vec using saturated arithmetic.

Note
Does not use saturated arithmetic with floating point types.
Parameters
vVec to add all elements of
Returns
saturated sum of all elements of the Vec

◆ hadds() [3/3]

template<typename T , size_t SIMD_WIDTH>
static Vec< T, SIMD_WIDTH > simd::hadds ( const Vec< T, SIMD_WIDTH > v[Vec< T, SIMD_WIDTH >::elems])
inlinestatic

Sums the elements of multiple Vec's independently using saturated arithmetic and returns a Vec with the results.

Note
Does not use saturated arithmetic with floating point types.
Parameters
[in]varray of Vec's to be summed
Returns
Vec with the results of the saturated horizontal sums

◆ hmax()

template<typename T , size_t SIMD_WIDTH>
static T simd::hmax ( const Vec< T, SIMD_WIDTH > & v)
inlinestatic

Calculates the maximum of all elements of a Vec.

Parameters
vVec to calculate the maximum of all elements of
Returns
maximum of all elements of the Vec

◆ hmin()

template<typename T , size_t SIMD_WIDTH>
static T simd::hmin ( const Vec< T, SIMD_WIDTH > & v)
inlinestatic

Calculates the minimum of all elements of a Vec.

Parameters
vVec to calculate the minimum of all elements of
Returns
minimum of all elements of the Vec

◆ hsub()

template<typename T , size_t SIMD_WIDTH>
static Vec< T, SIMD_WIDTH > simd::hsub ( const Vec< T, SIMD_WIDTH > & a,
const Vec< T, SIMD_WIDTH > & b )
inlinestatic

Horizontally subtracts adjacent elements of two Vec's.

Parameters
afirst Vec
bsecond Vec
Returns
Vec containing the results of the horizontal subtractions

◆ hsubs()

template<typename T , size_t SIMD_WIDTH>
static Vec< T, SIMD_WIDTH > simd::hsubs ( const Vec< T, SIMD_WIDTH > & a,
const Vec< T, SIMD_WIDTH > & b )
inlinestatic

Horizontally subtracts adjacent elements of two Vec's with saturation.

Note
Does not use saturated arithmetic with floating point types.
Parameters
afirst Vec
bsecond Vec
Returns
Vec containing the results of the horizontal saturated subtractions

◆ integrate()

template<typename T , size_t SIMD_WIDTH>
static simd::Vec< T, SIMD_WIDTH > simd::integrate ( const simd::Vec< T, SIMD_WIDTH > & v)
inlinestatic

Integrates the values of a Vec.

This function integrates the values of a Vec, i.e. it computes the prefix sum of the elements.

Parameters
[in]vVec to integrate
Returns
Vec with integrated values