Trait std::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

对可变指针的 SIMD vectors 的操作。

Required Associated Types§

source

type Usize

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

usize 的 Vector 与 lanes 的数量相同。

source

type Isize

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

isize 的 Vector 与 lanes 的数量相同。

source

type ConstPtr

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

常量指针的 Vector 指向同一类型。

source

type Mask

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

用于操作此 SIMD vector 类型的掩码类型。

Required Methods§

source

fn is_null(self) -> Self::Mask

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

为每个为空的 lane 返回 true

source

fn cast_const(self) -> Self::ConstPtr

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

更改常量而不更改类型。

相当于在每个 lane 上调用 pointer::cast_const

source

fn addr(self) -> Self::Usize

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

获取指针的 “address” 部分。

该方法丢弃了指针语义元数据,因此不能将结果直接转换为有效指针。

相当于在每个 lane 上调用 pointer::addr

source

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

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

使用给定地址创建一个新指针。

这执行与强制转换相同的操作,但将 selfaddress-spaceprovenance 复制到新指针。

相当于在每个 lane 上调用 pointer::with_addr

source

fn expose_addr(self) -> Self::Usize

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

获取指针的 “address” 部分,“exposes” 是 future 在 Self::from_exposed_addr 中使用的出处部分。

source

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

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

将地址转换回指针,获取以前的 “exposed” 出处。

相当于在每个 lane 上调用 core::ptr::from_exposed_addr_mut

source

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

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

使用换行算法计算与指针的偏移量。

相当于在每个 lane 上调用 pointer::wrapping_offset

source

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

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

使用换行算法计算与指针的偏移量。

相当于在每个 lane 上调用 pointer::wrapping_add

source

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

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

使用换行算法计算与指针的偏移量。

相当于在每个 lane 上调用 pointer::wrapping_sub

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>