Skip to main content

Divide

Struct Divide 

Source
pub struct Divide<SubU, T, const N: usize>(/* private fields */);
Expand description

Strategy that splits the underlier into SubU-sized lanes, applies the sub-packing PackedPrimitiveType<SubU, F>’s op to each lane, and recombines — a generic fallback for packings that lack a specialized full-width Square, InvertOrZero, or WideMul. The sub-underlier SubU is a PhantomData parameter so the packing type T stays last for the macro’s Divide<SubU, $name, N> form.

N is the lane count: callers always pass N = <U as Divisible<SubU>>::N (or the literal it works out to). Square/InvertOrZero stream through Divisible and ignore N, but it is still required so every Divide instantiation names its lane count explicitly. WideMul must defer reduction, so it materializes one unreduced product per lane in an N-element LaneWideProduct — and an associated const can’t be an array length without generic_const_exprs, which is why N is a const generic rather than read from Divisible.

Trait Implementations§

Source§

impl<U, SubU, F, const N: usize> InvertOrZero for Divide<SubU, PackedPrimitiveType<U, F>, N>

Source§

fn invert_or_zero(self) -> Self

Returns the inverted value or zero in case when self is zero
Source§

unsafe fn invert(self) -> Self
where Self: Sized,

Returns the multiplicative inverse. Read more
Source§

impl<U, SubU, F, const N: usize> Square for Divide<SubU, PackedPrimitiveType<U, F>, N>

Source§

fn square(self) -> Self

Returns the value multiplied by itself
Source§

impl<SubU, T, const N: usize> TransparentWrapper<T> for Divide<SubU, T, N>

§

fn wrap(s: Inner) -> Self
where Self: Sized,

Convert the inner type into the wrapper type.
§

fn wrap_ref(s: &Inner) -> &Self

Convert a reference to the inner type into a reference to the wrapper type.
§

fn wrap_mut(s: &mut Inner) -> &mut Self

Convert a mutable reference to the inner type into a mutable reference to the wrapper type.
§

fn wrap_slice(s: &[Inner]) -> &[Self]
where Self: Sized,

Convert a slice to the inner type into a slice to the wrapper type.
§

fn wrap_slice_mut(s: &mut [Inner]) -> &mut [Self]
where Self: Sized,

Convert a mutable slice to the inner type into a mutable slice to the wrapper type.
§

fn peel(s: Self) -> Inner
where Self: Sized,

Convert the wrapper type into the inner type.
§

fn peel_ref(s: &Self) -> &Inner

Convert a reference to the wrapper type into a reference to the inner type.
§

fn peel_mut(s: &mut Self) -> &mut Inner

Convert a mutable reference to the wrapper type into a mutable reference to the inner type.
§

fn peel_slice(s: &[Self]) -> &[Inner]
where Self: Sized,

Convert a slice to the wrapped type into a slice to the inner type.
§

fn peel_slice_mut(s: &mut [Self]) -> &mut [Inner]
where Self: Sized,

Convert a mutable slice to the wrapped type into a mutable slice to the inner type.
Source§

impl<U, SubU, F, const N: usize> WideMul for Divide<SubU, PackedPrimitiveType<U, F>, N>

Source§

type Output = LaneWideProduct<<PackedPrimitiveType<SubU, F> as WideMul>::Output, N>

Source§

fn wide_mul(a: Self, b: Self) -> Self::Output

Source§

fn reduce(wide: Self::Output) -> Self

Auto Trait Implementations§

§

impl<SubU, T, const N: usize> Freeze for Divide<SubU, T, N>
where T: Freeze,

§

impl<SubU, T, const N: usize> RefUnwindSafe for Divide<SubU, T, N>
where T: RefUnwindSafe, SubU: RefUnwindSafe,

§

impl<SubU, T, const N: usize> Send for Divide<SubU, T, N>
where T: Send, SubU: Send,

§

impl<SubU, T, const N: usize> Sync for Divide<SubU, T, N>
where T: Sync, SubU: Sync,

§

impl<SubU, T, const N: usize> Unpin for Divide<SubU, T, N>
where T: Unpin, SubU: Unpin,

§

impl<SubU, T, const N: usize> UnsafeUnpin for Divide<SubU, T, N>
where T: UnsafeUnpin,

§

impl<SubU, T, const N: usize> UnwindSafe for Divide<SubU, T, N>
where T: UnwindSafe, SubU: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<I, T> TransparentWrapperAlloc<I> for T
where T: TransparentWrapper<I> + ?Sized, I: ?Sized,

§

fn wrap_vec(s: Vec<Inner>) -> Vec<Self>
where Self: Sized,

Convert a vec of the inner type into a vec of the wrapper type.
§

fn wrap_box(s: Box<Inner>) -> Box<Self>

Convert a box to the inner type into a box to the wrapper type.
§

fn wrap_rc(s: Rc<Inner>) -> Rc<Self>

Convert an Rc to the inner type into an Rc to the wrapper type.
§

fn wrap_arc(s: Arc<Inner>) -> Arc<Self>

Convert an Arc to the inner type into an Arc to the wrapper type.
§

fn peel_vec(s: Vec<Self>) -> Vec<Inner>
where Self: Sized,

Convert a vec of the wrapper type into a vec of the inner type.
§

fn peel_box(s: Box<Self>) -> Box<Inner>

Convert a box to the wrapper type into a box to the inner type.
§

fn peel_rc(s: Rc<Self>) -> Rc<Inner>

Convert an Rc to the wrapper type into an Rc to the inner type.
§

fn peel_arc(s: Arc<Self>) -> Arc<Inner>

Convert an Arc to the wrapper type into an Arc to the inner type.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more