Skip to content

Commit

Permalink
rename expose_addr to expose_provenance
Browse files Browse the repository at this point in the history
  • Loading branch information
joboet committed Apr 3, 2024
1 parent 93d3300 commit b039861
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions crates/core_simd/src/simd/ptr/const_ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ pub trait SimdConstPtr: Copy + Sealed {
/// Equivalent to calling [`pointer::with_addr`] on each element.
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::with_exposed_provenance`].
fn expose_addr(self) -> Self::Usize;
/// Exposes the "provenance" part of the pointer for future use in
/// [`Self::with_exposed_provenance`] and returns the "address" portion.
fn expose_provenance(self) -> Self::Usize;

/// Convert an address back to a pointer, picking up a previously "exposed" provenance.
///
Expand Down Expand Up @@ -131,9 +131,9 @@ where
}

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

#[inline]
Expand Down
10 changes: 5 additions & 5 deletions crates/core_simd/src/simd/ptr/mut_ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ pub trait SimdMutPtr: Copy + Sealed {
/// Equivalent to calling [`pointer::with_addr`] on each element.
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::with_exposed_provenance`].
fn expose_addr(self) -> Self::Usize;
/// Exposes the "provenance" part of the pointer for future use in
/// [`Self::with_exposed_provenance`] and returns the "address" portion.
fn expose_provenance(self) -> Self::Usize;

/// Convert an address back to a pointer, picking up a previously "exposed" provenance.
///
Expand Down Expand Up @@ -128,9 +128,9 @@ where
}

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

#[inline]
Expand Down
6 changes: 3 additions & 3 deletions crates/core_simd/tests/pointers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ macro_rules! common_tests {
);
}

fn expose_addr<const LANES: usize>() {
fn expose_provenance<const LANES: usize>() {
test_helpers::test_unary_elementwise(
&Simd::<*$constness u32, LANES>::expose_addr,
&<*$constness u32>::expose_addr,
&Simd::<*$constness u32, LANES>::expose_provenance,
&<*$constness u32>::expose_provenance,
&|_| true,
);
}
Expand Down

0 comments on commit b039861

Please sign in to comment.