Skip to content

Sync in portable-simd subtree #99491

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 43 commits into from
Jul 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
80469c6
Move comparisons to SimdPartialOrd and SimdOrd traits
calebzulawski Mar 13, 2022
2a02c4d
Create SimdFloat trait
calebzulawski Mar 13, 2022
60486e0
SimdPartialOrd implies SimdPartialEq
calebzulawski Mar 15, 2022
50fbfa4
add bitmask roundtrip test for vector length below 8
RalfJung Mar 17, 2022
60555b5
fix big-endian bitmasks smaller than a byte
RalfJung Mar 17, 2022
35e16a1
rust-lang/portable-simd#266: reduce Miri test count in round.rs
RalfJung Mar 20, 2022
0711e11
rust-lang/portable-simd#267: fix big-endian bitmasks smaller than a byte
workingjubilee Mar 21, 2022
4e14017
Standardize documentation for SIMD vector and mask types
sstangl Apr 3, 2022
c73f1fb
Update crates/core_simd/src/masks.rs
sstangl Apr 3, 2022
21b070c
Correct the Mask docs, and get them to fit in search results
sstangl Apr 3, 2022
8cd9325
Add a *small* blurb to Mask that is likely unobjectionable
sstangl Apr 3, 2022
c2fbead
rust-lang/portable-simd#272: Standardize documentation for SIMD vecto…
workingjubilee Apr 3, 2022
1ec010d
rust-lang/portable-simd#265: Move comparisons to traits
workingjubilee Apr 4, 2022
7136841
rust-lang/portable-simd#274: Use SIMD equality for PartialEq on SIMD …
sstangl Apr 11, 2022
fcc5ca0
rust-lang/portable-simd#273: Documentation update for reduce function…
sstangl Apr 11, 2022
9718639
rust-lang/portable-simd#276: Mention slice methods as_simd() and as_s…
astraw Apr 11, 2022
376957a
Move integer functions to traits.
calebzulawski Apr 11, 2022
04be48f
Add float trait, and seal traits.
calebzulawski Apr 15, 2022
528bc85
Improve copysign documentation
calebzulawski Apr 15, 2022
62d3b2e
Add Copy bound to SIMD traits
calebzulawski Apr 16, 2022
af53b5d
rust-lang/portable-simd#279: Silence clippy false alarms
calebzulawski Apr 25, 2022
98cd636
Add Mask::cast
workingjubilee Mar 3, 2022
aa11959
Add mask cast tests
calebzulawski May 21, 2022
c9f4e0e
Use Mask::cast in From impl
calebzulawski May 21, 2022
939914e
Merge pull request #251 from rust-lang/mask-cast
calebzulawski May 21, 2022
b7fea94
Generically implement ToBitMaskArray
calebzulawski Jan 14, 2022
1cee930
Fix generic_const_exprs feature
calebzulawski May 22, 2022
bca8dec
Remove incorrect comment
calebzulawski May 22, 2022
c44a608
Merge pull request #278 from rust-lang/feature/simd-traits
calebzulawski May 31, 2022
5e32004
Merge pull request #246 from rust-lang/feature/bitmask_array
calebzulawski May 31, 2022
05c92c7
Document remaining internal unsafety, and deny undocumented unsafety
calebzulawski May 21, 2022
f237f13
Merge pull request #280 from rust-lang/feature/document-unsafety
calebzulawski Jun 1, 2022
5562b02
Deduplicate to_int_unchecked
calebzulawski Jun 2, 2022
c963615
Change `Simd::splat` to not generate a loop
programmerjake Jun 6, 2022
f7412ad
add workaround comment in `Simd::splat`
programmerjake Jun 6, 2022
3e7a2ed
Merge pull request #281 from rust-lang/to-int-unchecked
calebzulawski Jun 7, 2022
0f6399b
Merge pull request #284 from programmerjake/fix_splat
calebzulawski Jun 22, 2022
ed8092e
Clarify comment
calebzulawski Jun 22, 2022
64bef29
portable-simd: use simd_arith_offset to avoid ptr-int transmutation
RalfJung Apr 12, 2022
bbf31f9
Finish bumping stage0
Mark-Simulacrum May 20, 2022
2e081db
Fix doctest imports using as_crate feature
workingjubilee Jul 21, 2022
a14404a
Sync core::simd up to rust-lang/portable-simd@2e081db92aa3ee0a4563bc2…
workingjubilee Jul 21, 2022
f8aa494
Introduce core::simd trait imports in tests
workingjubilee Jul 21, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions library/core/src/slice/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3569,6 +3569,7 @@ impl<T> [T] {
///
/// ```
/// #![feature(portable_simd)]
/// use core::simd::SimdFloat;
///
/// let short = &[1, 2, 3];
/// let (prefix, middle, suffix) = short.as_simd::<4>();
Expand Down
1 change: 1 addition & 0 deletions library/core/tests/simd.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use core::simd::f32x4;
use core::simd::SimdFloat;

#[test]
fn testing() {
Expand Down
5 changes: 5 additions & 0 deletions library/portable-simd/beginners-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,10 @@ Fortunately, most SIMD types have a fairly predictable size. `i32x4` is bit-equi

However, this is not the same as alignment. Computer architectures generally prefer aligned accesses, especially when moving data between memory and vector registers, and while some support specialized operations that can bend the rules to help with this, unaligned access is still typically slow, or even undefined behavior. In addition, different architectures can require different alignments when interacting with their native SIMD types. For this reason, any `#[repr(simd)]` type has a non-portable alignment. If it is necessary to directly interact with the alignment of these types, it should be via [`mem::align_of`].

When working with slices, data correctly aligned for SIMD can be acquired using the [`as_simd`] and [`as_simd_mut`] methods of the slice primitive.

[`mem::transmute`]: https://doc.rust-lang.org/core/mem/fn.transmute.html
[`mem::align_of`]: https://doc.rust-lang.org/core/mem/fn.align_of.html
[`as_simd`]: https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.as_simd
[`as_simd_mut`]: https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.as_simd_mut

3 changes: 2 additions & 1 deletion library/portable-simd/crates/core_simd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ categories = ["hardware-support", "no-std"]
license = "MIT OR Apache-2.0"

[features]
default = []
default = ["as_crate"]
as_crate = []
std = []
generic_const_exprs = []

Expand Down
120 changes: 0 additions & 120 deletions library/portable-simd/crates/core_simd/src/comparisons.rs

This file was deleted.

11 changes: 11 additions & 0 deletions library/portable-simd/crates/core_simd/src/elements.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
mod float;
mod int;
mod uint;

mod sealed {
pub trait Sealed {}
}

pub use float::*;
pub use int::*;
pub use uint::*;
Loading