Basic functions¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “xsimd::abs” with arguments ((batch<T, A> const&)) in doxygen xml output for project “xsimd” from directory: ../xml. Potential matches:
- template<class T, class A> batch<T, A> abs(batch<T, A> const &x) noexcept
- template<class T, class A> batch<T, A> abs(batch<std::complex<T>, A> const &z) noexcept
-
template<class
T, classA>
batch<T, A>xsimd::fabs(batch<T, A> const &x) noexcept¶ Computes the absolute values of each scalar in the batch
x.- Return
the asbolute values of
x.- Parameters
x: batch floating point values.
-
template<class
T, classA>
batch<T, A>xsimd::fmod(batch<T, A> const &x, batch<T, A> const &y) noexcept¶ Computes the modulo of the batch
xby the batchy.- Return
the result of the modulo.
- Parameters
x: batch involved in the modulo.y: batch involved in the modulo.
-
template<class
T, classA>
batch<T, A>xsimd::remainder(batch<T, A> const &x, batch<T, A> const &y) noexcept¶ Computes the remainder of dividing
xbyy.- Return
the result of the addition.
- Parameters
x: batch of scalar valuesy: batch of scalar values
-
template<class
T, classA>
batch<T, A>xsimd::fma(batch<T, A> const &x, batch<T, A> const &y, batch<T, A> const &z) noexcept¶ Computes
(x*y) + zin a single instruction when possible.- Return
the result of the fused multiply-add operation.
- Parameters
x: a batch of integer or floating point values.y: a batch of integer or floating point values.z: a batch of integer or floating point values.
-
template<class
T, classA>
batch<T, A>xsimd::fms(batch<T, A> const &x, batch<T, A> const &y, batch<T, A> const &z) noexcept¶ Computes
(x*y) - zin a single instruction when possible.- Return
the result of the fused multiply-sub operation.
- Parameters
x: a batch of integer or floating point values.y: a batch of integer or floating point values.z: a batch of integer or floating point values.
-
template<class
T, classA>
batch<T, A>xsimd::fnma(batch<T, A> const &x, batch<T, A> const &y, batch<T, A> const &z) noexcept¶ Computes
-(x*y) + zin a single instruction when possible.- Return
the result of the fused negated multiply-add operation.
- Parameters
x: a batch of integer or floating point values.y: a batch of integer or floating point values.z: a batch of integer or floating point values.
-
template<class
T, classA>
batch<T, A>xsimd::fnms(batch<T, A> const &x, batch<T, A> const &y, batch<T, A> const &z) noexcept¶ Computes
-(x*y) - zin a single instruction when possible.- Return
the result of the fused negated multiply-sub operation.
- Parameters
x: a batch of integer or floating point values.y: a batch of integer or floating point values.z: a batch of integer or floating point values.
-
template<class
T, classA>
batch<T, A>xsimd::min(batch<T, A> const &x, batch<T, A> const &y) noexcept¶ Computes the smaller values of the batches
xandy.- Return
a batch of the smaller values.
- Parameters
x: a batch of integer or floating point values.y: a batch of integer or floating point values.
-
template<class
T, classA>
batch<T, A>xsimd::max(batch<T, A> const &x, batch<T, A> const &y) noexcept¶ Computes the larger values of the batches
xandy.- Return
a batch of the larger values.
- Parameters
x: a batch of integer or floating point values.y: a batch of integer or floating point values.
-
template<class
T, classA>
batch<T, A>xsimd::fmin(batch<T, A> const &x, batch<T, A> const &y) noexcept¶ Computes the smaller values of the batches
xandy.- Return
a batch of the larger values.
- Parameters
x: a batch of integer or floating point values.y: a batch of integer or floating point values.
-
template<class
T, classA>
batch<T, A>xsimd::fmax(batch<T, A> const &x, batch<T, A> const &y) noexcept¶ Computes the larger values of the batches
xandy.- Return
a batch of the larger values.
- Parameters
x: a batch of integer or floating point values.y: a batch of integer or floating point values.
-
template<class
T, classA>
batch<T, A>xsimd::fdim(batch<T, A> const &x, batch<T, A> const &y) noexcept¶ Computes the positive difference between
xandy, that is,max(0, x-y).- Return
the positive difference.
- Parameters
x: batch of floating point values.y: batch of floating point values.
-
template<class
T, classTp>
autoxsimd::sadd(T const &x, Tp const &y) noexcept -> decltype(x + y)¶ Computes the saturate sum of the batch
xand the batchy.x.- Return
the result of the saturated addition.
- Template Parameters
X: the actual type of batch.
- Parameters
x: batch involved in the saturated addition.y: batch involved in the saturated addition.
-
template<class
T, classTp>
autoxsimd::ssub(T const &x, Tp const &y) noexcept -> decltype(x - y)¶ Computes the saturate difference of the batch
xand the batchy.x.- Return
the result of the saturated difference.
- Template Parameters
X: the actual type of batch.
- Parameters
x: batch involved in the saturated difference.y: batch involved in the saturated difference.
-
template<class
A, classT>
batch<T, A>xsimd::clip(batch<T, A> const &x, batch<T, A> const &lo, batch<T, A> const &hi) noexcept¶ Clips the values of the batch
xbetween those of the batchesloandhi.- Return
the result of the clipping.
- Parameters
x: batch of floating point values.lo: batch of floating point values.hi: batch of floating point values.