Skip to content

Commit a14404a

Browse files
Sync core::simd up to rust-lang/portable-simd@2e081db
2 parents 246f66a + 2e081db commit a14404a

31 files changed

+1606
-881
lines changed

library/portable-simd/beginners-guide.md

+5
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,10 @@ Fortunately, most SIMD types have a fairly predictable size. `i32x4` is bit-equi
8282

8383
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`].
8484

85+
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.
86+
8587
[`mem::transmute`]: https://doc.rust-lang.org/core/mem/fn.transmute.html
8688
[`mem::align_of`]: https://doc.rust-lang.org/core/mem/fn.align_of.html
89+
[`as_simd`]: https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.as_simd
90+
[`as_simd_mut`]: https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.as_simd_mut
91+

library/portable-simd/crates/core_simd/Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ categories = ["hardware-support", "no-std"]
99
license = "MIT OR Apache-2.0"
1010

1111
[features]
12-
default = []
12+
default = ["as_crate"]
13+
as_crate = []
1314
std = []
1415
generic_const_exprs = []
1516

library/portable-simd/crates/core_simd/src/comparisons.rs

-120
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
mod float;
2+
mod int;
3+
mod uint;
4+
5+
mod sealed {
6+
pub trait Sealed {}
7+
}
8+
9+
pub use float::*;
10+
pub use int::*;
11+
pub use uint::*;

0 commit comments

Comments
 (0)