Skip to main content

Module f32x

Module f32x 

Source
Expand description

Vector helpers for the f32 kernels.

Ported from sleef-rs rev 3671d46 (src/f32x.rs, src/f32x/constants.rs) and the doubled crate v0.3.3. See the crate-level crate::common docs for the translation table.

Every helper takes the SIMD token as its first argument. <S as Simd>::f32s is not invertible in argument position, so a signature whose only vector argument is that projection cannot be inferred from a call; passing the token first makes every call site inferrable without a turbofish.

Re-exports§

pub use crate::common::mla;
pub use crate::common::mul_sub;
pub use crate::common::neg_mul_add;
pub use crate::common::poly10;
pub use crate::common::poly11;
pub use crate::common::poly12;
pub use crate::common::poly13;
pub use crate::common::poly14;
pub use crate::common::poly15;
pub use crate::common::poly16;
pub use crate::common::poly17;
pub use crate::common::poly18;
pub use crate::common::poly19;
pub use crate::common::poly2;
pub use crate::common::poly20;
pub use crate::common::poly21;
pub use crate::common::poly3;
pub use crate::common::poly4;
pub use crate::common::poly5;
pub use crate::common::poly6;
pub use crate::common::poly7;
pub use crate::common::poly8;
pub use crate::common::poly9;
pub use constants::splat;
pub use constants::splat_bits;
pub use constants::splat_int;

Modules§

activation
Fused activation kernels: one vector pass per element.
constants
Constants and broadcast helpers for the f32 kernels.
fast
The fast tier of the f32 kernels.
special
i0e, i1e and xlogy over native-width f32 vectors.
u05
f32 kernels with a 0.5 ULP error bound (SLEEF’s u05 tier).
u10
f32 kernels with a 1.0 ULP error bound (SLEEF’s u10 tier).
u15
f32 kernels with a 1.5 ULP error bound (SLEEF’s u15 tier).
u35
f32 kernels with a 3.5 ULP error bound (SLEEF’s u35 tier).

Functions§

bits_to_int
Reinterprets a bit pattern as a signed integer vector of the same lane count.
ceil
Round towards positive infinity.
copy_sign
x with the sign of y.
expfrexp
Exponent of a floating-point number, as returned by frexp.
fabs
Absolute value.
fdim
Positive difference.
floor
Round towards negative infinity.
fma
Fused multiply-add: x * y + z with a single rounding.
fmax
Maximum, treating a NaN in y as x.
fmin
Minimum, treating a NaN in y as x.
fmod
Floating-point remainder, truncated towards zero.
frfrexp
Fractional component of a floating-point number, as returned by frexp.
from_bits
Reinterprets a bit pattern as an f32 vector.
from_slice_offset
Gathers one lane per element of vi from table.
ilogb
The exponent of d as an integer vector.
ilogb2k
The exponent of d, without subnormal handling.
ilogbk
The exponent of d, scaling subnormals into range first.
int_to_bits
Reinterprets a signed integer vector as a bit pattern.
is_integer
Whether x is integral.
is_neg_zero
Whether x is exactly -0.0.
is_odd
Whether x is an odd integer.
ldexp
Multiply by an integral power of two.
ldexp2k
d * 2^e, split into two half-range multiplications.
ldexp3k
d * 2^q by adding directly to the exponent field.
ldexpk
x * 2^q over the full exponent range, including subnormals.
modf
Splits x into its fractional and integral parts.
mul_sign
x with the sign bit of y applied.
nextafter
The next representable value after x in the direction of y.
or_sign
x with the sign bit of y set.
pow2i
2^q for an integer vector q.
remainder
IEEE remainder, rounded to nearest even quotient.
rempi
Reduces a modulo pi/2 using the Payne–Hanek tables.
rempisub
Removes the integer part of 4 * x, returning the fraction and the integer part.
rint
Round to nearest integer, ties to even.
round
Round away from zero.
roundi
Round to an integer vector, ties to even.
select3
Selects between three scalar values using two masks.
select4
Selects between four scalar values using three masks.
select_doubled
Selects between two double-double values using a mask.
select_splat
Selects between two scalars broadcast to vectors.
sign
1.0 carrying the sign of x.
sign_bit
Sign bit of x, as a bit pattern.
sqrt_as_doubled
sqrt(x) as a double-double.
to_bits
Reinterprets an f32 vector as its bit pattern.
trunc
Truncate towards zero.
trunci
Truncate to an integer vector.
v_add_dd
v + d, matching upstream’s F32x + Doubled<F32x>.
visinf2
The value of m carrying the sign of an infinite d, and zero where d is finite.