Functions
A
function abs(const T1 &) Returns the absolute value of x. function absmax(const T1 &, const T2 &) Returns the greater in magnitude of two values. function absmin(const T1 &, const T2 &) Returns the smaller in magnitude of two values. function add(const T &) Identity add (single argument). function add(const T1 &, const T2 &, const Ts &...) Returns sum of all the arguments passed to a function. function add(initialvalue<T>) Identity element for add (returns zero). function addsub(const vec<T, N> &, const vec<T, N> &) Returns a vector with a+b in the low half and a-b in the high half. function all(const mask<T, N> &) Returns true if all elements are true. function allonesvector() Return a vector of the given type and size with all bits set to 1. function allonesvector(vec_shape<T, N>) Return a vector matching the given shape with all bits set to 1. function allonesvector(vec<T, N>) Return a vector matching the type of the given vector with all bits set to 1. function any(const mask<T, N> &) Returns true if any element is true. function apply(Fn &&) Generate a vector by calling a nullary function N times. function apply(Fn &&, const T &, Args &&...) Apply a function to a scalar (pass-through overload). function apply(Fn &&, const vec<T, N> &, Args &&...) Apply a scalar function element-wise to a vector.
B
function bitcast(const From &) Reinterpret the bits of value as type To . function bitcast(const vec<From, N> &) Reinterpret the bits of a vector as a vector of a different element type. function bitness_const(const char *, const char *) Selects between 32-bit and 64-bit compile-time constants. function bitness_const(const T &, const T &) Selects between 32-bit and 64-bit compile-time constants. function bitpermute(const vec<T, N> &) Permute the elements of a vector according to a bit permutation. function bitreverse(const vec<T, N> &) Reorders the elements of a vector by reversing the bits of their indices. function bitreverse(u32) Reverses the lowest bits bits of the given unsigned integer. function bitreverse(u32, size_t) Reverses the lowest bits bits of the given unsigned integer at runtime. function bitwiseand(const T1 &, const T2 &) Bitwise AND of x and y . function bitwiseand(double, double) function bitwiseand(float, float) function bitwiseand(initialvalue<T>) Identity element for bitwiseand (returns all ones). function bitwiseandnot(const T1 &, const T2 &) Bitwise AND-NOT of x and y . function bitwiseandnot(double, double) function bitwiseandnot(float, float) function bitwiseandnot(initialvalue<T>) Identity element for bitwiseandnot (returns all ones). function bitwisenot(const T1 &) Bitwise NOT of x . function bitwisenot(double) function bitwisenot(float) function bitwiseor(const T1 &, const T2 &) Bitwise OR of x and y . function bitwiseor(double, double) function bitwiseor(float, float) function bitwiseor(initialvalue<T>) Identity element for bitwiseor (returns zero). function bitwisexor(const T1 &, const T2 &) Bitwise XOR (exclusive OR) of x and y . function bitwisexor(double, double) function bitwisexor(float, float) function bitwisexor(initialvalue<T>) Identity element for bitwisexor (returns zero). function blend(const vec<T, N> &, const vec<T, N> &, elements_t<Indices...>) Blends lanes from x and y according to a repeating selector pattern. function block_process(size_t, csizes_t<widths...>, Fn &&) Processes a range using a sequence of decreasing block widths. function broadcast(const Ts &...) Broadcasts a pack of scalar values into a vector of length Nout. function broadcast(T) Broadcast a scalar to all N elements of a vector. function broadcastto(const From &) Broadcast-cast a scalar to To (deep rebind). function broadcastto(const vec<Tin, N> &) Broadcast-cast a vector to a different element type. function broadcastto(const vec<Tin, N> &) Identity broadcast-cast for a vector (same element type). function broadcastto(const vec<vec<Tin, N1>, N2> &) Broadcast-cast a nested vector to a different element type. function broadcastto(const vec<vec<Tin, N1>, N2> &) Identity broadcast-cast for a nested vector (same element type).
C
function cast(const From &) Cast a scalar value to To (deep rebind). function cast(const vec<Tin, N> &) Cast a vector to a different element type. function cast(const vec<Tin, N> &) Identity cast for a vector (same element type). function cast(const vec<vec<Tin, N1>, N2> &) Cast a nested vector to a different element type. function cast(const vec<vec<Tin, N1>, N2> &) Identity cast for a nested vector (same element type). function ccomp(const vec<T, N> &) Composes a vector of N/2 complex values from a flattened N-element real vector. function cconj(const T1 &) Returns the complex conjugate of the complex number x function cdecom(const vec<complex<T>, N> &) Decomposes a vector of N complex values into a flattened 2N-element real vector. function cdupimag(const vec<complex<T>, N> &) Returns vector of complex values with imaginary part duplicated function cdupreal(const vec<complex<T>, N> &) Returns vector of complex values with real part duplicated function ceil(const T1 &) Returns the smallest integer value not less than x. function clamp(const T1 &, const T2 &) Returns the first argument clamped to a range [0, hi] function clamp(const T1 &, const T2 &, const T3 &) Returns the first argument clamped to a range [lo, hi] function cnegimag(const vec<complex<T>, N> &) Returns vector of complex values with imaginary part negated function cnegreal(const vec<complex<T>, N> &) Returns vector of complex values with real part negated function column(const vec<vec<T, N1>, N2> &) Extracts a single column from a vector-of-vectors. function combine(const vec<T, N1> &, const vec<T, N2> &) Combines two vectors by selecting lanes from x or y based on index. function concat2(const vec<T, N1> &, const vec<T, N2> &) Concatenates two vectors into a single vector. function concat4(const vec<T, N> &, const vec<T, N> &, const vec<T, N> &, const vec<T, N> &) Concatenates four equal-length vectors into a single vector. function concat_and_slice(const vec<T, N1> &, const vec<T, N2> &) Concatenates two vectors of unequal length (first shorter) and extracts a slice. function concat_and_slice(const vec<T, N> &, const vec<T, N> &) Concatenates two equal-length vectors and extracts a slice of length count. function concat(const vec<T, Ns> &...) Concatenates any number of vectors into a single vector. function copysign(const vec<T, N> &, const vec<T, N> &) Compose x with the magnitude of x and the sign of y . function cpu_name(cpu_t) Returns the name of the given CPU instruction set. function cswapreim(const vec<complex<T>, N> &) Returns vector of complex values with real and imaginary parts swapped function ctranspose(const vec<T, N> &) Complex transpose: transposes pairs of adjacent lanes viewed as complex (real, imag). function ctransposeinverse(const vec<T, N> &) Inverse complex transpose. function cub(const T1 &) Returns cube of x.
D
function digitreverse4(const vec<T, N> &) Reorders the elements of a vector by reversing base-4 (quaternary) digits of their indices. function digitreverse4(u32) Reverses the digits of the given unsigned integer in base-4 (quaternary), using the lowest bits digits. function digitreverse(const vec<T, N> &) Reorders the elements of a vector by reversing the digits of their indices in the specified radix. function div(const T1 &, const T2 &) Division of x by y . function dup(const vec<T, N> &) Duplicates each element of x into a pair of adjacent lanes. function dupeven(const vec<T, N> &) Duplicates each even-indexed element into the following odd-indexed lane. function duphalves(const vec<T, N> &) Duplicates the contents of x to form a vector twice as long. function duphigh(const vec<T, N> &) Duplicates the upper half of x to fill the whole vector. function duplow(const vec<T, N> &) Duplicates the lower half of x to fill the whole vector. function dupodd(const vec<T, N> &) Duplicates each odd-indexed element into the preceding even-indexed lane.
E
F
G
H
function hadd(const vec<T, N> &) Computes the sum of all elements in the vector. function havg(const vec<T, N> &) Computes the arithmetic mean (average) of all elements in the vector. function hbitwiseand(const vec<T, N> &) Computes the bitwise AND of all elements in the vector. function hbitwiseor(const vec<T, N> &) Computes the bitwise OR of all elements in the vector. function hbitwisexor(const vec<T, N> &) Computes the bitwise XOR of all elements in the vector. function hdot(const vec<T, N> &, const vec<T, N> &) Computes the dot product of two vectors. function high(const vec<T, N> &) Extracts the high subvector of x with non-power-of-two-aware sizing. function highhalf(const vec<T, N> &) Extracts the upper half of x. function highhalf(vec_shape<T, N>) Shape-only overload of highhalf() for type deduction. function high(vec_shape<T, N>) Shape-only overload of high() for type deduction. function hmax(const vec<T, N> &) Computes the maximum element in the vector. function hmin(const vec<T, N> &) Computes the minimum element in the vector. function hmul(const vec<T, N> &) Computes the product of all elements in the vector. function horizontal(const vec<T, N> &, ReduceFn &&) Applies a reduction function horizontally across all elements of the vector. function horner_even(const T1 &, const Ts &...) Calculate polynomial using Horner's method (even powers) function horner_odd(const T1 &, const Ts &...) Calculate polynomial using Horner's method (odd powers) function horner(const T1 &, const Ts &...) Calculate polynomial using Horner's method function hproduct(const vec<T, N> &) Computes the product of all elements in the vector. function hrms(const vec<T, N> &) Computes the root-mean-square (RMS) of the vector elements. function hsum(const vec<T, N> &) Computes the sum of all elements in the vector.
I
function ibitcast(const From &) Reinterpret the bits of a scalar value as its signed counterpart type. function ibitcast(const vec<From, N> &) Reinterpret the bits of a vector as a vector of its signed counterpart type. function iceil(const T1 &) Returns the smallest integer value not less than x, as an integer type. function ifloor(const T1 &) Returns the largest integer value not greater than x, as an integer type. function imag(const complex<T> &) Returns the imaginary part of the complex value function imag(const vec<complex<T>, N> &) Returns the imaginary parts of a vector of complex values. function inrange(const T1 &, const T2 &, const T3 &) Test whether each element lies within a closed range. function inserthigh(T, const vec<T, N> &) Inserts a scalar x at the high (right) end of y, shifting y one lane to the low (left) side. function insertleft(T, const vec<T, N> &) Legacy alias for insertlow(). function insertlow(T, const vec<T, N> &) Inserts a scalar x at the low (left) end of y, shifting y one lane to the high (right) side. function insertright(T, const vec<T, N> &) Legacy alias for inserthigh(). function interleave(const vec<T, N> &, const vec<T, N> &) Interleaves the lanes of two equal-length vectors x and y. function interleavehalves(const vec<T, N> &) Interleaves the two halves of x. function ipow(const T &, int) Integer power. function iround(const T1 &) Returns the nearest integer value to x, as an integer type. function is_simd_size(size_t) Checks whether size is a valid SIMD vector size for type T. function isfinite(const vec<T, N> &) Detect finite values element-wise. function isinf(const vec<T, N> &) Detect infinite values element-wise. function isnan(const vec<T, N> &) Detect NaN (Not-a-Number) values element-wise. function isnegative(const vec<T, N> &) Detect negative values element-wise by inspecting the sign bit. function ispositive(const vec<T, N> &) Detect non-negative values element-wise. function isreal(const complex<T> &) Returns mask with true for real elements function iszero(const vec<T, N> &) Detect zero values element-wise. function itrunc(const T1 &) Returns the truncated integer part of x, as an integer type.
L
M
function make_complex(const vec<T1, N> &, const vec<T2, N> &) Constructs a vector of complex values from real and imaginary vectors. function make_complex(T1, T2) Constructs a complex value from real and imaginary scalars. function make_mask(bool, Args...) Constructs a SIMD mask vector from boolean values. function make_vector(const Arg &, const Args &...) Create a vector from scalar values. function make_vector(const vec<T, N> &) Identity overload: returns the passed vector unchanged. function make_vector(cvals_t<T, Values...>) Create a vector from a compile-time constant list. function maskbits(bool) Returns all-ones or all-zeros of type T depending on value. function max(const T1 &, const T2 &) Returns the greater of two values. function min(const T1 &, const T2 &) Returns the smaller of two values. function mix(const T1 &, const T2 &, const T3 &) Linear blend of x and y . function mixs(const T1 &, const T2 &, const T3 &) Signed linear blend of x and y . function mod(const T1 &, const T2 &) Modulo of x by y . function mul(const T1 &) Identity mul (single argument). function mul(const T1 &, const T2 &, const Ts &...) Returns product of all the arguments passed to a function. function mul(initialvalue<T>) Identity element for mul (returns one). function mulsign(const T1 &, const T2 &) Multiply x by the sign of y without a conditional branch.
N
O
function odd(const vec<T, N> &) Extracts the odd-indexed elements of x (with optional grouping). function onoff(cint_t<on>, cint_t<off>) Generates a vector with an on/off pattern over a contiguous range. function onoff(vec_shape<T, N>, cint_t<on>, cint_t<off>) Shape-driven overload of onoff() for type deduction. function operator&(const mask<T1, N> &, const mask<T2, N> &) Bitwise AND of two masks (bit-level, size must match). function operator|(const mask<T1, N> &, const mask<T2, N> &) Bitwise OR of two masks (bit-level, size must match). function operator&&(const mask<T1, N> &, const mask<T2, N> &) Logical AND of two masks (bit-level conjunction, size must match). function operator||(const mask<T1, N> &, const mask<T2, N> &) Logical OR of two masks (bit-level disjunction, size must match). function operator^(const mask<T1, N> &, const mask<T2, N> &) Bitwise XOR of two masks (bit-level, size must match). function operator~(const mask<T, N> &) Bitwise NOT of a mask. function operator!(const mask<T, N> &) Logical NOT of a mask (equivalent to bitwise NOT). function operator+(const T1 &, const vec<T2, N> &) function operator-(const T1 &, const vec<T2, N> &) function operator*(const T1 &, const vec<T2, N> &) function operator/(const T1 &, const vec<T2, N> &) function operator%(const T1 &, const vec<T2, N> &) function operator&(const T1 &, const vec<T2, N> &) function operator|(const T1 &, const vec<T2, N> &) function operator^(const T1 &, const vec<T2, N> &) function operator<<(const T1 &, const vec<T2, N> &) function operator>>(const T1 &, const vec<T2, N> &) function operator==(const T1 &, const vec<T2, N> &) function operator!=(const T1 &, const vec<T2, N> &) function operator>=(const T1 &, const vec<T2, N> &) function operator<=(const T1 &, const vec<T2, N> &) function operator>(const T1 &, const vec<T2, N> &) function operator<(const T1 &, const vec<T2, N> &) function operator+(const vec<T1, N> &, const T2 &) function operator-(const vec<T1, N> &, const T2 &) function operator*(const vec<T1, N> &, const T2 &) function operator/(const vec<T1, N> &, const T2 &) function operator%(const vec<T1, N> &, const T2 &) function operator&(const vec<T1, N> &, const T2 &) function operator|(const vec<T1, N> &, const T2 &) function operator^(const vec<T1, N> &, const T2 &) function operator==(const vec<T1, N> &, const T2 &) function operator!=(const vec<T1, N> &, const T2 &) function operator>=(const vec<T1, N> &, const T2 &) function operator<=(const vec<T1, N> &, const T2 &) function operator>(const vec<T1, N> &, const T2 &) function operator<(const vec<T1, N> &, const T2 &) function operator+(const vec<T1, N> &, const vec<T2, N> &) function operator-(const vec<T1, N> &, const vec<T2, N> &) function operator*(const vec<T1, N> &, const vec<T2, N> &) function operator/(const vec<T1, N> &, const vec<T2, N> &) function operator%(const vec<T1, N> &, const vec<T2, N> &) function operator&(const vec<T1, N> &, const vec<T2, N> &) function operator|(const vec<T1, N> &, const vec<T2, N> &) function operator^(const vec<T1, N> &, const vec<T2, N> &) function operator<<(const vec<T1, N> &, const vec<T2, N> &) function operator>>(const vec<T1, N> &, const vec<T2, N> &) function operator==(const vec<T1, N> &, const vec<T2, N> &) function operator!=(const vec<T1, N> &, const vec<T2, N> &) function operator>=(const vec<T1, N> &, const vec<T2, N> &) function operator<=(const vec<T1, N> &, const vec<T2, N> &) function operator>(const vec<T1, N> &, const vec<T2, N> &) function operator<(const vec<T1, N> &, const vec<T2, N> &) function operator<<(const vec<T1, N> &, unsigned int) function operator>>(const vec<T1, N> &, unsigned int) function operator-(const vec<T, N> &) function operator~(const vec<T, N> &) function operator+=(vec<T1, N> &, const T2 &) function operator-=(vec<T1, N> &, const T2 &) function operator*=(vec<T1, N> &, const T2 &) function operator/=(vec<T1, N> &, const T2 &) function operator%=(vec<T1, N> &, const T2 &) function operator&=(vec<T1, N> &, const T2 &) function operator|=(vec<T1, N> &, const T2 &) function operator^=(vec<T1, N> &, const T2 &) function operator+=(vec<T1, N> &, const vec<T2, N> &) function operator-=(vec<T1, N> &, const vec<T2, N> &) function operator*=(vec<T1, N> &, const vec<T2, N> &) function operator/=(vec<T1, N> &, const vec<T2, N> &) function operator%=(vec<T1, N> &, const vec<T2, N> &) function operator&=(vec<T1, N> &, const vec<T2, N> &) function operator|=(vec<T1, N> &, const vec<T2, N> &) function operator^=(vec<T1, N> &, const vec<T2, N> &) function operator<<=(vec<T1, N> &, const vec<T2, N> &) function operator>>=(vec<T1, N> &, const vec<T2, N> &) function operator<<=(vec<T1, N> &, unsigned int) function operator>>=(vec<T1, N> &, unsigned int) function optimized_bitshuffle(const vec<T, N> &) Internal ADL-provided implementation for bit-shuffle expressions.
P
function pack(const Arg &, const Args &...) Pack scalar values into a vector of numeric type. function packtranspose(const vec<T, N1> &, const vec<T, Ns> &...) Transposes and packs sizeof...(Ns)+1 vectors of length N1 into a vector of vectors of length N1 . function padhigh(const vec<T, N> &) Pads x with Ncount zero-initialized lanes on the high side. function padhigh(const vec<T, N> &, std::type_identity_t<T>) Pads x with Ncount copies of newvalue on the high side. function padlow(const vec<T, N> &) Pads x with Ncount zero-initialized lanes on the low side. function padlow(const vec<T, N> &, std::type_identity_t<T>) Pads x with Ncount copies of newvalue on the low side. function part(const vec<T, N> &) Extracts the number-th of total equal-sized parts of x. function partial_mask(size_t) Returns a vector of N elements with index leading all-ones elements followed by zeros. function partial_mask(size_t, vec_shape<T, N>) Returns a vector of N elements with index leading all-ones elements followed by zeros. function partial_read(const T *, size_t) Reads up to count elements into a vector. function partial_write(T *, const vec<T, N> &, size_t) Writes up to count leading elements of a vector to memory. function permute(const vec<T, N> &, elements_t<Indices...>) Permutes the lanes of x using a repeating index pattern. function permutegroups(const vec<T, N> &, elements_t<Indices...>) Group-wise variant of permute() that operates on blocks of group elements. function pow2(const T &) Returns \(x^2\) . function pow3(const T &) Returns \(x^3\) . function pow4(const T &) Returns \(x^4\) . function pow5(const T &) Returns \(x^5\) . function promoteto(const Tin &) Promote a scalar to Tout . function promoteto(const vec<Tin, N> &) Promote a vector to a different element type. function promoteto(const vec<vec<Tin, N1>, N2> &) Promote a nested vector to a different element type.
R
function read_group(const T *, size_t) Reads count groups of group*N elements separated by stride groups. function read(const T *) Reads a vector of N elements of type T from memory. function real(const complex<T> &) Returns the real part of the complex value function real(const T &) Returns the real part of the complex value function real(const vec<complex<T>, N> &) Returns the real parts of a vector of complex values. function reciprocal(const T &) Multiplicative inverse of x . function rem(const T1 &, const T2 &) Remainder of x divided by y . function rem(const vec<T, N> &, const vec<T, N> &) Returns the element-wise floating-point remainder of vectors x and y. function repeat(const vec<T, N> &) Repeats the contents of x count times. function replace(const vec<T, N> &, const vec<T, N> &) Replaces a contiguous range of x with the corresponding lanes of y. function resize(const vec<T, N> &) Resizes a vector to length Nout. function resize(const vec<T, N> &) Identity overload of resize() for the Nout == N case. function reverse(const vec<T, N> &) Reverses the order of lanes in x (with optional grouping). function reverse(const vec<vec<T, N1>, N2> &) Reverses the order of inner vectors in a vector of vectors. function rol(const T1 &, const T2 &) Bitwise left rotate. function ror(const T1 &, const T2 &) Bitwise right rotate. function rotateleft(const vec<T, N> &, csize_t<amount>) Rotates the lanes of x to the left by amount positions. function rotateright(const vec<T, N> &, csize_t<amount>) Rotates the lanes of x to the right by amount positions. function rotatetwo(const vec<T, N> &, const vec<T, N> &) Combines two vectors lo and hi with a rotation by shift lanes. function round(const T1 &) Returns the nearest integer value to x.
S
function satadd(const T1 &, const T2 &) Adds two numeric values using saturation arithmetic. function satsub(const T1 &, const T2 &) Subtracts two numeric values using saturation arithmetic. function scatter_stride(T *, const vec<T, N> &, size_t) Scatters N/groupsize groups of groupsize contiguous elements of value to base separated by stride. function scatter(const T *, const vec<T, N> &) Scatters elements of value to base at the given compile-time indices. function scatter(T *, const vec<IT, N> &, const vec<T, Nout> &) Scatters N groups of groupsize contiguous elements of value to base using a vector of offsets. function select(const mask<T1, N> &, const T2 &, const T3 &) Returns x if m is true, otherwise return y. Order of the arguments is same as in ternary operator. function shl(const T1 &, const T2 &) Bitwise left shift. function shr(const T1 &, const T2 &) Bitwise right shift. function shuffle(const vec<T, N> &, const vec<T, N> &, elements_t<Indices...>) Shuffles the concatenation of two equal-length vectors using a repeating index pattern. function shufflegroups(const vec<T, N> &, const vec<T, N> &, elements_t<Indices...>) Group-wise variant of shuffle() that operates on blocks of group elements. function shuffleindexbits(const vec<T, N> &, elements_t<A...>) Shuffles lanes of x by permuting the bits of each lane index. function shufflevector(const vec<complex<T>, N> &, csizes_t<indices...>) Shuffles the complex elements of x according to indices. function shufflevector(const vec<T, N> &, csizes_t<indices...>) Permute elements of a single vector. function shufflevectors(const vec<complex<T>, N> &, const vec<T, N> &, csizes_t<indices...>) Shuffles complex elements from two vectors x and y according to indices. function shufflevectors(const vec<T, N> &, const vec<T, N> &, csizes_t<indices...>) Permute elements from two concatenated vectors. function size_of() Size of a (possibly compound) type measured in bytes of its deepest scalar. function slice(const vec<T, N> &) Extracts a contiguous subvector of count elements starting at start. function slice(const vec<T, N> &, const vec<T, N> &) Extracts a contiguous subvector spanning the concatenation of x and y. function sort(const vec<T, N> &) Sort the elements in the vector in ascending order function sortdesc(const vec<T, N> &) Sort the elements in the vector in descending order function split(const vec<T, N> &) Terminal overload of split() for variadic recursion. function split(const vec<T, N> &, vec<T, N / 2> &, vec<T, N / 2> &) Splits x into two equal halves. function split(const vec<T, N> &, vec<T, N / 4> &, vec<T, N / 4> &, vec<T, N / 4> &, vec<T, N / 4> &) Splits x into four equal quarters. function split(const vec<T, N> &, vec<T, Nout> &, Args &&...) Splits x into consecutive subvectors written into the supplied output references. function splitpairs(const vec<T, N> &) Deinterleaves adjacent pairs (inverse of interleavehalves with side1 == 2). function sqr(const T1 &) Returns square of x. function sqrdiff(const T1 &, const T2 &) Returns square of the difference of two arguments. function sqrsum(const T1 &, const Ts &...) Square of the sum of all arguments. function subadd(const vec<T, N> &, const vec<T, N> &) Returns a vector with a-b in the low half and a+b in the high half. function sub(const T1 &, const T2 &) Subtraction of two values. function sub(initialvalue<T>) Identity element for sub (returns zero). function swapbyteorder(const T &) Swap byte order of x . function swap(const vec<T, N> &) Swaps adjacent groups of elements lanes.
T
U
V
W
Z