Trait core::simd::SimdMutPtr

source ·
pub trait SimdMutPtr: Copy + Sealed {
    type Usize;
    type Isize;
    type ConstPtr;
    type Mask;

    // Required methods
    fn is_null(self) -> Self::Mask;
    fn cast_const(self) -> Self::ConstPtr;
    fn addr(self) -> Self::Usize;
    fn with_addr(self, addr: Self::Usize) -> Self;
    fn expose_addr(self) -> Self::Usize;
    fn from_exposed_addr(addr: Self::Usize) -> Self;
    fn wrapping_offset(self, offset: Self::Isize) -> Self;
    fn wrapping_add(self, count: Self::Usize) -> Self;
    fn wrapping_sub(self, count: Self::Usize) -> Self;
}
🔬This is a nightly-only experimental API. (portable_simd #86656)
Expand description

Operations on SIMD vectors of mutable pointers.

Required Associated Types§

source

type Usize

🔬This is a nightly-only experimental API. (portable_simd #86656)

Vector of usize with the same number of lanes.

source

type Isize

🔬This is a nightly-only experimental API. (portable_simd #86656)

Vector of isize with the same number of lanes.

source

type ConstPtr

🔬This is a nightly-only experimental API. (portable_simd #86656)

Vector of constant pointers to the same type.

source

type Mask

🔬This is a nightly-only experimental API. (portable_simd #86656)

Mask type used for manipulating this SIMD vector type.

Required Methods§

source

fn is_null(self) -> Self::Mask

🔬This is a nightly-only experimental API. (portable_simd #86656)

Returns true for each lane that is null.

source

fn cast_const(self) -> Self::ConstPtr

🔬This is a nightly-only experimental API. (portable_simd #86656)

Changes constness without changing the type.

Equivalent to calling pointer::cast_const on each lane.

source

fn addr(self) -> Self::Usize

🔬This is a nightly-only experimental API. (portable_simd #86656)

Gets the “address” portion of the pointer.

This method discards pointer semantic metadata, so the result cannot be directly cast into a valid pointer.

Equivalent to calling pointer::addr on each lane.

source

fn with_addr(self, addr: Self::Usize) -> Self

🔬This is a nightly-only experimental API. (portable_simd #86656)

Creates a new pointer with the given address.

This performs the same operation as a cast, but copies the address-space and provenance of self to the new pointer.

Equivalent to calling pointer::with_addr on each lane.

source

fn expose_addr(self) -> Self::Usize

🔬This is a nightly-only experimental API. (portable_simd #86656)

Gets the “address” portion of the pointer, and “exposes” the provenance part for future use in Self::from_exposed_addr.

source

fn from_exposed_addr(addr: Self::Usize) -> Self

🔬This is a nightly-only experimental API. (portable_simd #86656)

Convert an address back to a pointer, picking up a previously “exposed” provenance.

Equivalent to calling core::ptr::from_exposed_addr_mut on each lane.

source

fn wrapping_offset(self, offset: Self::Isize) -> Self

🔬This is a nightly-only experimental API. (portable_simd #86656)

Calculates the offset from a pointer using wrapping arithmetic.

Equivalent to calling pointer::wrapping_offset on each lane.

source

fn wrapping_add(self, count: Self::Usize) -> Self

🔬This is a nightly-only experimental API. (portable_simd #86656)

Calculates the offset from a pointer using wrapping arithmetic.

Equivalent to calling pointer::wrapping_add on each lane.

source

fn wrapping_sub(self, count: Self::Usize) -> Self

🔬This is a nightly-only experimental API. (portable_simd #86656)

Calculates the offset from a pointer using wrapping arithmetic.

Equivalent to calling pointer::wrapping_sub on each lane.

Implementors§

source§

impl<T, const LANES: usize> SimdMutPtr for Simd<*mut T, LANES>where LaneCount<LANES>: SupportedLaneCount,

§

type Usize = Simd<usize, LANES>

§

type Isize = Simd<isize, LANES>

§

type ConstPtr = Simd<*const T, LANES>

§

type Mask = Mask<isize, LANES>