From 6c926f4744612f1416be03ef81c64b7cb64a95eb Mon Sep 17 00:00:00 2001 From: Reiner Pope Date: Tue, 7 Mar 2023 18:03:28 -0800 Subject: [PATCH 1/6] Document alternatives to Mask that guarantee layout. --- crates/core_simd/src/masks.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/core_simd/src/masks.rs b/crates/core_simd/src/masks.rs index e58df80fca8..850707f7833 100644 --- a/crates/core_simd/src/masks.rs +++ b/crates/core_simd/src/masks.rs @@ -88,6 +88,10 @@ impl_element! { isize } /// The layout of this type is unspecified, and may change between platforms /// and/or Rust versions, and code should not assume that it is equivalent to /// `[T; LANES]`. +/// +/// For a type with layout guaranteed equivalent to `[T; LANES]`, use +/// `SIMD`. For a type with layout guaranteed to use 1 bit per +/// lane (padded up to full bytes), use `LANES::BitMask`. #[repr(transparent)] pub struct Mask(mask_impl::Mask) where From 9805f7c09a257e275851cc54be98d21294116744 Mon Sep 17 00:00:00 2001 From: Reiner Pope Date: Wed, 8 Mar 2023 04:57:05 +0000 Subject: [PATCH 2/6] Format code --- crates/core_simd/src/masks.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/core_simd/src/masks.rs b/crates/core_simd/src/masks.rs index 850707f7833..0aee0182158 100644 --- a/crates/core_simd/src/masks.rs +++ b/crates/core_simd/src/masks.rs @@ -89,7 +89,7 @@ impl_element! { isize } /// and/or Rust versions, and code should not assume that it is equivalent to /// `[T; LANES]`. /// -/// For a type with layout guaranteed equivalent to `[T; LANES]`, use +/// For a type with layout guaranteed equivalent to `[T; LANES]`, use /// `SIMD`. For a type with layout guaranteed to use 1 bit per /// lane (padded up to full bytes), use `LANES::BitMask`. #[repr(transparent)] From b44a0deea7e8276b99deb313269dd79aff7daa3d Mon Sep 17 00:00:00 2001 From: Reiner Pope Date: Thu, 9 Mar 2023 11:30:17 -0800 Subject: [PATCH 3/6] Spelling Co-authored-by: Jubilee <46493976+workingjubilee@users.noreply.github.com> --- crates/core_simd/src/masks.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/core_simd/src/masks.rs b/crates/core_simd/src/masks.rs index 0aee0182158..030ccc94f52 100644 --- a/crates/core_simd/src/masks.rs +++ b/crates/core_simd/src/masks.rs @@ -90,7 +90,7 @@ impl_element! { isize } /// `[T; LANES]`. /// /// For a type with layout guaranteed equivalent to `[T; LANES]`, use -/// `SIMD`. For a type with layout guaranteed to use 1 bit per +/// `Simd`. For a type with layout guaranteed to use 1 bit per /// lane (padded up to full bytes), use `LANES::BitMask`. #[repr(transparent)] pub struct Mask(mask_impl::Mask) From c4e2ae5338d7f37c3e7414ff8f29d8e875f7432c Mon Sep 17 00:00:00 2001 From: Reiner Pope Date: Mon, 13 Mar 2023 04:08:04 +0000 Subject: [PATCH 4/6] Update wording --- crates/core_simd/src/masks.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/core_simd/src/masks.rs b/crates/core_simd/src/masks.rs index 030ccc94f52..c2e2619c383 100644 --- a/crates/core_simd/src/masks.rs +++ b/crates/core_simd/src/masks.rs @@ -91,7 +91,7 @@ impl_element! { isize } /// /// For a type with layout guaranteed equivalent to `[T; LANES]`, use /// `Simd`. For a type with layout guaranteed to use 1 bit per -/// lane (padded up to full bytes), use `LANES::BitMask`. +/// lane (padded up to the next integer type), use [`ToBitMask::BitMask`]. #[repr(transparent)] pub struct Mask(mask_impl::Mask) where From 84bc19732d3fddc14e0a2a6a669c52e658ede277 Mon Sep 17 00:00:00 2001 From: Reiner Pope Date: Mon, 13 Mar 2023 15:02:34 +0000 Subject: [PATCH 5/6] s/layout/size. Mention BitMaskArray. --- crates/core_simd/src/masks.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/core_simd/src/masks.rs b/crates/core_simd/src/masks.rs index c2e2619c383..f9a5c2b8516 100644 --- a/crates/core_simd/src/masks.rs +++ b/crates/core_simd/src/masks.rs @@ -89,9 +89,10 @@ impl_element! { isize } /// and/or Rust versions, and code should not assume that it is equivalent to /// `[T; LANES]`. /// -/// For a type with layout guaranteed equivalent to `[T; LANES]`, use -/// `Simd`. For a type with layout guaranteed to use 1 bit per -/// lane (padded up to the next integer type), use [`ToBitMask::BitMask`]. +/// For a type with size guaranteed equivalent to `[T; LANES]`, use +/// `Simd`. For a type with size guaranteed to use 1 bit per +/// lane (padded up to the next integer type or), use [`ToBitMask::BitMask`] +/// or (with crate feature `generic_const_exprs`) `ToBitMaskArray::BitMaskArray`. #[repr(transparent)] pub struct Mask(mask_impl::Mask) where From ecb9703173d21e921eb0a6f8b3885409e996a316 Mon Sep 17 00:00:00 2001 From: Reiner Pope Date: Mon, 13 Mar 2023 15:03:01 +0000 Subject: [PATCH 6/6] Wording --- crates/core_simd/src/masks.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/core_simd/src/masks.rs b/crates/core_simd/src/masks.rs index f9a5c2b8516..cab6badc6e5 100644 --- a/crates/core_simd/src/masks.rs +++ b/crates/core_simd/src/masks.rs @@ -89,7 +89,7 @@ impl_element! { isize } /// and/or Rust versions, and code should not assume that it is equivalent to /// `[T; LANES]`. /// -/// For a type with size guaranteed equivalent to `[T; LANES]`, use +/// For a type with size guaranteed equal to `[T; LANES]`, use /// `Simd`. For a type with size guaranteed to use 1 bit per /// lane (padded up to the next integer type or), use [`ToBitMask::BitMask`] /// or (with crate feature `generic_const_exprs`) `ToBitMaskArray::BitMaskArray`.