Intel xvec
Experimental C++ simd class library
Loading...
Searching...
No Matches
Additional mathematical functions

Additional approximate, fused, integral-classification, and complex operations. More...

Functions

template<vec_complex _Vc>
_Vc xvec::simd::ceil (const _Vc &value)
 Round the real and imaginary components of each element upward.
template<vec_complex _Vc>
_Vc xvec::simd::floor (const _Vc &value)
 Round the real and imaginary components of each element downward.
template<vec_complex _Vc>
_Vc xvec::simd::trunc (const _Vc &value)
 Truncate the real and imaginary components of each element.
template<vec_complex _Vc>
_Vc xvec::simd::round (const _Vc &value)
 Apply round independently to the real and imaginary components.
template<vec_signed_integral _Vp>
constexpr _Vp xvec::simd::abs (const _Vp &v)
 Compute the absolute value of each signed-integral element.
template<detail::math_floating_point _Vp>
constexpr detail::deduced_vec_t< _Vp > xvec::simd::rcp (const _Vp &v)
 Compute the approximate reciprocal of each element.
template<detail::math_floating_point _Vp>
constexpr detail::deduced_vec_t< _Vp > xvec::simd::rsqrt (const _Vp &v)
 Compute the approximate reciprocal square root of each element.
template<vec_complex _Vp>
constexpr _Vp xvec::simd::fma (const _Vp &lhs, const _Vp &rhs, const _Vp &acc)
 Compute the complex multiply-add operation element-wise.
template<detail::math_floating_point _Vp>
constexpr detail::deduced_vec_t< _Vp > xvec::simd::fmaddsub (const _Vp &lhs, const _Vp &rhs, const _Vp &acc)
 Compute lhs * rhs - acc at even indexes and lhs * rhs + acc at odd indexes. Each expression is computed with a single rounding to the result type.
template<detail::math_floating_point _Vp>
constexpr detail::deduced_vec_t< _Vp > xvec::simd::fmsubadd (const _Vp &lhs, const _Vp &rhs, const _Vp &acc)
 Compute lhs * rhs + acc at even indexes and lhs * rhs - acc at odd indexes. Each expression is computed with a single rounding to the result type.
template<vec_integral _Vp>
constexpr _Vp::mask_type xvec::simd::signbit (const _Vp &v)
 Identify negative integral elements.

Detailed Description

Additional approximate, fused, integral-classification, and complex operations.

These are xvec extensions, not a claim of adoption into a future standard.

Function Documentation

◆ abs()

template<vec_signed_integral _Vp>
_Vp xvec::simd::abs ( const _Vp & v)
constexpr

Compute the absolute value of each signed-integral element.

Template Parameters
_VpThe input vector type.
Parameters
vThe input vector.
Returns
A vector containing the absolute values.

◆ ceil()

template<vec_complex _Vc>
_Vc xvec::simd::ceil ( const _Vc & value)
inline

Round the real and imaginary components of each element upward.

Template Parameters
_VcThe complex vector type.
Parameters
valueThe input vector.
Returns
A complex vector with each component rounded toward positive infinity.

◆ floor()

template<vec_complex _Vc>
_Vc xvec::simd::floor ( const _Vc & value)
inline

Round the real and imaginary components of each element downward.

Template Parameters
_VcThe complex vector type.
Parameters
valueThe input vector.
Returns
A complex vector with each component rounded toward negative infinity.

◆ fma()

template<vec_complex _Vp>
_Vp xvec::simd::fma ( const _Vp & lhs,
const _Vp & rhs,
const _Vp & acc )
constexpr

Compute the complex multiply-add operation element-wise.

Template Parameters
_VpThe complex vector type.
Parameters
lhsThe left multiplication operand.
rhsThe right multiplication operand.
accThe accumulator.
Returns
A vector containing the complex multiply-add results.

◆ fmaddsub()

template<detail::math_floating_point _Vp>
detail::deduced_vec_t< _Vp > xvec::simd::fmaddsub ( const _Vp & lhs,
const _Vp & rhs,
const _Vp & acc )
constexpr

Compute lhs * rhs - acc at even indexes and lhs * rhs + acc at odd indexes. Each expression is computed with a single rounding to the result type.

Template Parameters
_VpThe input vector type.
Parameters
lhsThe left multiplication operand.
rhsThe right multiplication operand.
accThe value alternately subtracted or added.
Returns
A vector containing the alternating fused results.

◆ fmsubadd()

template<detail::math_floating_point _Vp>
detail::deduced_vec_t< _Vp > xvec::simd::fmsubadd ( const _Vp & lhs,
const _Vp & rhs,
const _Vp & acc )
constexpr

Compute lhs * rhs + acc at even indexes and lhs * rhs - acc at odd indexes. Each expression is computed with a single rounding to the result type.

Template Parameters
_VpThe input vector type.
Parameters
lhsThe left multiplication operand.
rhsThe right multiplication operand.
accThe value alternately added or subtracted.
Returns
A vector containing the alternating fused results.

◆ rcp()

template<detail::math_floating_point _Vp>
detail::deduced_vec_t< _Vp > xvec::simd::rcp ( const _Vp & v)
constexpr

Compute the approximate reciprocal of each element.

Template Parameters
_VpThe input vector type.
Parameters
vThe input vector.
Returns
A vector containing approximate reciprocals.

◆ round()

template<vec_complex _Vc>
_Vc xvec::simd::round ( const _Vc & value)
inline

Apply round independently to the real and imaginary components.

Template Parameters
_VcThe complex vector type.
Parameters
valueThe input vector.
Returns
A complex vector containing the rounded components.

◆ rsqrt()

template<detail::math_floating_point _Vp>
detail::deduced_vec_t< _Vp > xvec::simd::rsqrt ( const _Vp & v)
constexpr

Compute the approximate reciprocal square root of each element.

Template Parameters
_VpThe input vector type.
Parameters
vThe input vector.
Returns
A vector containing approximate reciprocal square roots.

◆ signbit()

template<vec_integral _Vp>
_Vp::mask_type xvec::simd::signbit ( const _Vp & v)
constexpr

Identify negative integral elements.

Template Parameters
_VpThe integral vector type.
Parameters
vThe input vector.
Returns
A mask whose elements are true for negative inputs. All output elements are false for unsigned input types.

◆ trunc()

template<vec_complex _Vc>
_Vc xvec::simd::trunc ( const _Vc & value)
inline

Truncate the real and imaginary components of each element.

Template Parameters
_VcThe complex vector type.
Parameters
valueThe input vector.
Returns
A complex vector with each component rounded toward zero.