Module simd
SIMD compiler intrinsics.
In this module, a "vector" is any repr(simd) type.
Enums
- SimdAlign A type for alignment options for SIMD masked load/store intrinsics.
Functions
- simd_add Adds two simd vectors elementwise.
- simd_and "And"s vectors elementwise.
- simd_arith_offset Calculates the offset from a pointer vector elementwise, potentially wrapping.
- simd_as Numerically casts a vector, elementwise.
- simd_bitmask Truncates an integer vector to a bitmask.
- simd_bitreverse Reverses bits of each element.
- simd_bswap Swaps bytes of each element.
- simd_cast Numerically casts a vector, elementwise.
- simd_cast_ptr Casts a vector of pointers.
- simd_ceil Rounds up each element to the next highest integer-valued float.
- simd_ctlz Counts the leading zeros of each element.
- simd_ctpop Counts the number of ones in each element.
- simd_cttz Counts the trailing zeros of each element.
-
simd_div
Divides
lhsbyrhselementwise. - simd_eq Tests elementwise equality of two vectors.
- simd_expose_provenance Exposes a vector of pointers as a vector of addresses.
- simd_extract Extracts an element from a vector.
- simd_extract_dyn Extracts an element from a vector.
- simd_fabs Returns absolute value of a vector, elementwise.
-
simd_fcos
Tmust be a vector of floats. -
simd_fexp
Tmust be a vector of floats. -
simd_fexp2
Tmust be a vector of floats. -
simd_flog
Tmust be a vector of floats. -
simd_flog10
Tmust be a vector of floats. -
simd_flog2
Tmust be a vector of floats. - simd_floor Rounds down each element to the next lowest integer-valued float.
-
simd_fma
Computes
(x*y) + zfor each element, but without any intermediate rounding. - simd_fmax Returns the maximum of two vectors, elementwise.
- simd_fmin Returns the minimum of two vectors, elementwise.
-
simd_fsin
Tmust be a vector of floats. - simd_fsqrt Takes the square root of each element.
- simd_funnel_shl Funnel Shifts vector left elementwise, with UB on overflow.
- simd_funnel_shr Funnel Shifts vector right elementwise, with UB on overflow.
- simd_gather Reads a vector of pointers.
-
simd_ge
Tests if
xis greater than or equal toy, elementwise. -
simd_gt
Tests if
xis greater thany, elementwise. - simd_insert Inserts an element into a vector, returning the updated vector.
- simd_insert_dyn Inserts an element into a vector, returning the updated vector.
-
simd_le
Tests if
xis less than or equal toy, elementwise. -
simd_lt
Tests if
xis less thany, elementwise. - simd_masked_load Reads a vector of pointers.
- simd_masked_store Writes to a vector of pointers.
- simd_mul Multiplies two simd vectors elementwise.
- simd_ne Tests elementwise inequality equality of two vectors.
- simd_neg Negates a vector elementwise.
- simd_or "Ors" vectors elementwise.
- simd_reduce_add_ordered Adds elements within a vector from left to right.
- simd_reduce_add_unordered Adds elements within a vector in arbitrary order. May also be re-associated with unordered additions on the inputs/outputs.
- simd_reduce_all Checks if all mask values are true.
- simd_reduce_and Logical "and"s all elements together.
- simd_reduce_any Checks if any mask value is true.
- simd_reduce_max Returns the maximum element of a vector.
- simd_reduce_min Returns the minimum element of a vector.
- simd_reduce_mul_ordered Multiplies elements within a vector from left to right.
- simd_reduce_mul_unordered Multiplies elements within a vector in arbitrary order. May also be re-associated with unordered additions on the inputs/outputs.
- simd_reduce_or Logical "ors" all elements together.
- simd_reduce_xor Logical "exclusive ors" all elements together.
-
simd_relaxed_fma
Computes
(x*y) + zfor each element, non-deterministically executing either a fused multiply-add or two operations with rounding of the intermediate result. - simd_rem Returns remainder of two vectors elementwise.
- simd_round Rounds each element to the closest integer-valued float. Ties are resolved by rounding away from 0.
- simd_round_ties_even Rounds each element to the closest integer-valued float. Ties are resolved by rounding to the number with an even least significant digit
- simd_saturating_add Adds two simd vectors elementwise, with saturation.
- simd_saturating_sub Subtracts two simd vectors elementwise, with saturation.
- simd_scatter Writes to a vector of pointers.
- simd_select Selects elements from a mask.
- simd_select_bitmask Selects elements from a bitmask.
- simd_shl Shifts vector left elementwise, with UB on overflow.
- simd_shr Shifts vector right elementwise, with UB on overflow.
- simd_shuffle Shuffles two vectors by const indices.
-
simd_sub
Subtracts
rhsfromlhselementwise. - simd_trunc Returns the integer part of each element as an integer-valued float. In other words, non-integer values are truncated towards zero.
- simd_with_exposed_provenance Creates a vector of pointers from a vector of addresses.
- simd_xor "Exclusive ors" vectors elementwise.