Skip to content

Commit f0cbf40

Browse files
Merge pull request #414 from rust-lang/sync-2024-04-09
Sync 2024-04-09
2 parents 979a495 + b8a18fa commit f0cbf40

File tree

5 files changed

+27
-32
lines changed

5 files changed

+27
-32
lines changed

crates/core_simd/src/lib.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@
4646
#![unstable(feature = "portable_simd", issue = "86656")]
4747
//! Portable SIMD module.
4848
49-
#[prelude_import]
50-
#[allow(unused_imports)]
51-
use core::prelude::v1::*;
52-
5349
#[path = "mod.rs"]
5450
mod core_simd;
5551
pub use self::core_simd::simd;

crates/core_simd/src/simd/ptr/const_ptr.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ pub trait SimdConstPtr: Copy + Sealed {
6363
/// Equivalent to calling [`pointer::with_addr`] on each element.
6464
fn with_addr(self, addr: Self::Usize) -> Self;
6565

66-
/// Gets the "address" portion of the pointer, and "exposes" the provenance part for future use
67-
/// in [`Self::from_exposed_addr`].
68-
fn expose_addr(self) -> Self::Usize;
66+
/// Exposes the "provenance" part of the pointer for future use in
67+
/// [`Self::with_exposed_provenance`] and returns the "address" portion.
68+
fn expose_provenance(self) -> Self::Usize;
6969

7070
/// Convert an address back to a pointer, picking up a previously "exposed" provenance.
7171
///
72-
/// Equivalent to calling [`core::ptr::from_exposed_addr`] on each element.
73-
fn from_exposed_addr(addr: Self::Usize) -> Self;
72+
/// Equivalent to calling [`core::ptr::with_exposed_provenance`] on each element.
73+
fn with_exposed_provenance(addr: Self::Usize) -> Self;
7474

7575
/// Calculates the offset from a pointer using wrapping arithmetic.
7676
///
@@ -152,15 +152,15 @@ where
152152
}
153153

154154
#[inline]
155-
fn expose_addr(self) -> Self::Usize {
155+
fn expose_provenance(self) -> Self::Usize {
156156
// Safety: `self` is a pointer vector
157-
unsafe { core::intrinsics::simd::simd_expose_addr(self) }
157+
unsafe { core::intrinsics::simd::simd_expose_provenance(self) }
158158
}
159159

160160
#[inline]
161-
fn from_exposed_addr(addr: Self::Usize) -> Self {
161+
fn with_exposed_provenance(addr: Self::Usize) -> Self {
162162
// Safety: `self` is a pointer vector
163-
unsafe { core::intrinsics::simd::simd_from_exposed_addr(addr) }
163+
unsafe { core::intrinsics::simd::simd_with_exposed_provenance(addr) }
164164
}
165165

166166
#[inline]

crates/core_simd/src/simd/ptr/mut_ptr.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,14 @@ pub trait SimdMutPtr: Copy + Sealed {
6060
/// Equivalent to calling [`pointer::with_addr`] on each element.
6161
fn with_addr(self, addr: Self::Usize) -> Self;
6262

63-
/// Gets the "address" portion of the pointer, and "exposes" the provenance part for future use
64-
/// in [`Self::from_exposed_addr`].
65-
fn expose_addr(self) -> Self::Usize;
63+
/// Exposes the "provenance" part of the pointer for future use in
64+
/// [`Self::with_exposed_provenance`] and returns the "address" portion.
65+
fn expose_provenance(self) -> Self::Usize;
6666

6767
/// Convert an address back to a pointer, picking up a previously "exposed" provenance.
6868
///
69-
/// Equivalent to calling [`core::ptr::from_exposed_addr_mut`] on each element.
70-
fn from_exposed_addr(addr: Self::Usize) -> Self;
69+
/// Equivalent to calling [`core::ptr::with_exposed_provenance_mut`] on each element.
70+
fn with_exposed_provenance(addr: Self::Usize) -> Self;
7171

7272
/// Calculates the offset from a pointer using wrapping arithmetic.
7373
///
@@ -149,15 +149,15 @@ where
149149
}
150150

151151
#[inline]
152-
fn expose_addr(self) -> Self::Usize {
152+
fn expose_provenance(self) -> Self::Usize {
153153
// Safety: `self` is a pointer vector
154-
unsafe { core::intrinsics::simd::simd_expose_addr(self) }
154+
unsafe { core::intrinsics::simd::simd_expose_provenance(self) }
155155
}
156156

157157
#[inline]
158-
fn from_exposed_addr(addr: Self::Usize) -> Self {
158+
fn with_exposed_provenance(addr: Self::Usize) -> Self {
159159
// Safety: `self` is a pointer vector
160-
unsafe { core::intrinsics::simd::simd_from_exposed_addr(addr) }
160+
unsafe { core::intrinsics::simd::simd_with_exposed_provenance(addr) }
161161
}
162162

163163
#[inline]

crates/core_simd/src/vector.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use crate::simd::{
44
ptr::{SimdConstPtr, SimdMutPtr},
55
LaneCount, Mask, MaskElement, SupportedLaneCount, Swizzle,
66
};
7-
use core::convert::{TryFrom, TryInto};
87

98
/// A SIMD vector with the shape of `[T; N]` but the operations of `T`.
109
///

crates/core_simd/tests/pointers.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ macro_rules! common_tests {
3232
);
3333
}
3434

35-
fn expose_addr<const LANES: usize>() {
35+
fn expose_provenance<const LANES: usize>() {
3636
test_helpers::test_unary_elementwise(
37-
&Simd::<*$constness u32, LANES>::expose_addr,
38-
&<*$constness u32>::expose_addr,
37+
&Simd::<*$constness u32, LANES>::expose_provenance,
38+
&<*$constness u32>::expose_provenance,
3939
&|_| true,
4040
);
4141
}
@@ -80,10 +80,10 @@ mod const_ptr {
8080
);
8181
}
8282

83-
fn from_exposed_addr<const LANES: usize>() {
83+
fn with_exposed_provenance<const LANES: usize>() {
8484
test_helpers::test_unary_elementwise(
85-
&Simd::<*const u32, LANES>::from_exposed_addr,
86-
&core::ptr::from_exposed_addr::<u32>,
85+
&Simd::<*const u32, LANES>::with_exposed_provenance,
86+
&core::ptr::with_exposed_provenance::<u32>,
8787
&|_| true,
8888
);
8989
}
@@ -103,10 +103,10 @@ mod mut_ptr {
103103
);
104104
}
105105

106-
fn from_exposed_addr<const LANES: usize>() {
106+
fn with_exposed_provenance<const LANES: usize>() {
107107
test_helpers::test_unary_elementwise(
108-
&Simd::<*mut u32, LANES>::from_exposed_addr,
109-
&core::ptr::from_exposed_addr_mut::<u32>,
108+
&Simd::<*mut u32, LANES>::with_exposed_provenance,
109+
&core::ptr::with_exposed_provenance_mut::<u32>,
110110
&|_| true,
111111
);
112112
}

0 commit comments

Comments
 (0)