diff options
| author | Ralf Jung <post@ralfj.de> | 2024-03-23 11:47:11 +0100 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2024-03-23 13:18:33 +0100 |
| commit | def711f17ba31ab85a292a3eb853e5f39c1976bc (patch) | |
| tree | b596c35aa823f8fa46e9d6f72faaf50587171822 | |
| parent | f6996612ce2db070ae2a9370c71ac725d08b03e3 (diff) | |
| download | rust-def711f17ba31ab85a292a3eb853e5f39c1976bc.tar.gz rust-def711f17ba31ab85a292a3eb853e5f39c1976bc.zip | |
rename ptr::from_exposed_addr -> ptr::with_exposed_provenance
| -rw-r--r-- | crates/core_simd/src/simd/ptr/const_ptr.rs | 8 | ||||
| -rw-r--r-- | crates/core_simd/src/simd/ptr/mut_ptr.rs | 8 | ||||
| -rw-r--r-- | crates/core_simd/tests/pointers.rs | 12 |
3 files changed, 14 insertions, 14 deletions
diff --git a/crates/core_simd/src/simd/ptr/const_ptr.rs b/crates/core_simd/src/simd/ptr/const_ptr.rs index e217d1c8c87..3ec9fccbff9 100644 --- a/crates/core_simd/src/simd/ptr/const_ptr.rs +++ b/crates/core_simd/src/simd/ptr/const_ptr.rs @@ -51,13 +51,13 @@ pub trait SimdConstPtr: Copy + Sealed { fn with_addr(self, addr: Self::Usize) -> Self; /// Gets the "address" portion of the pointer, and "exposes" the provenance part for future use - /// in [`Self::from_exposed_addr`]. + /// in [`Self::with_exposed_provenance`]. fn expose_addr(self) -> Self::Usize; /// Convert an address back to a pointer, picking up a previously "exposed" provenance. /// - /// Equivalent to calling [`core::ptr::from_exposed_addr`] on each element. - fn from_exposed_addr(addr: Self::Usize) -> Self; + /// Equivalent to calling [`core::ptr::with_exposed_provenance`] on each element. + fn with_exposed_provenance(addr: Self::Usize) -> Self; /// Calculates the offset from a pointer using wrapping arithmetic. /// @@ -137,7 +137,7 @@ where } #[inline] - fn from_exposed_addr(addr: Self::Usize) -> Self { + fn with_exposed_provenance(addr: Self::Usize) -> Self { // Safety: `self` is a pointer vector unsafe { core::intrinsics::simd::simd_from_exposed_addr(addr) } } diff --git a/crates/core_simd/src/simd/ptr/mut_ptr.rs b/crates/core_simd/src/simd/ptr/mut_ptr.rs index 5cb27af4fde..1142839e213 100644 --- a/crates/core_simd/src/simd/ptr/mut_ptr.rs +++ b/crates/core_simd/src/simd/ptr/mut_ptr.rs @@ -48,13 +48,13 @@ pub trait SimdMutPtr: Copy + Sealed { fn with_addr(self, addr: Self::Usize) -> Self; /// Gets the "address" portion of the pointer, and "exposes" the provenance part for future use - /// in [`Self::from_exposed_addr`]. + /// in [`Self::with_exposed_provenance`]. fn expose_addr(self) -> Self::Usize; /// Convert an address back to a pointer, picking up a previously "exposed" provenance. /// - /// Equivalent to calling [`core::ptr::from_exposed_addr_mut`] on each element. - fn from_exposed_addr(addr: Self::Usize) -> Self; + /// Equivalent to calling [`core::ptr::with_exposed_provenance_mut`] on each element. + fn with_exposed_provenance(addr: Self::Usize) -> Self; /// Calculates the offset from a pointer using wrapping arithmetic. /// @@ -134,7 +134,7 @@ where } #[inline] - fn from_exposed_addr(addr: Self::Usize) -> Self { + fn with_exposed_provenance(addr: Self::Usize) -> Self { // Safety: `self` is a pointer vector unsafe { core::intrinsics::simd::simd_from_exposed_addr(addr) } } diff --git a/crates/core_simd/tests/pointers.rs b/crates/core_simd/tests/pointers.rs index b9f32d16e01..5984fdae2f9 100644 --- a/crates/core_simd/tests/pointers.rs +++ b/crates/core_simd/tests/pointers.rs @@ -80,10 +80,10 @@ mod const_ptr { ); } - fn from_exposed_addr<const LANES: usize>() { + fn with_exposed_provenance<const LANES: usize>() { test_helpers::test_unary_elementwise( - &Simd::<*const u32, LANES>::from_exposed_addr, - &core::ptr::from_exposed_addr::<u32>, + &Simd::<*const u32, LANES>::with_exposed_provenance, + &core::ptr::with_exposed_provenance::<u32>, &|_| true, ); } @@ -103,10 +103,10 @@ mod mut_ptr { ); } - fn from_exposed_addr<const LANES: usize>() { + fn with_exposed_provenance<const LANES: usize>() { test_helpers::test_unary_elementwise( - &Simd::<*mut u32, LANES>::from_exposed_addr, - &core::ptr::from_exposed_addr_mut::<u32>, + &Simd::<*mut u32, LANES>::with_exposed_provenance, + &core::ptr::with_exposed_provenance_mut::<u32>, &|_| true, ); } |
