Skip to content

Commit 66ccff1

Browse files
committed
Update protable-simd
1 parent 0b00772 commit 66ccff1

File tree

3 files changed

+23
-37
lines changed

3 files changed

+23
-37
lines changed

build_system/prepare.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ pub(crate) fn prepare() {
2828
);
2929

3030
clone_repo(
31-
"stdsimd",
32-
"https://github.com/rust-lang/stdsimd",
33-
"be96995d8ddec03fac9a0caf4d4c51c7fbc33507",
31+
"portable-simd",
32+
"https://github.com/rust-lang/portable-simd",
33+
"d42875302dd9e924f8d667b32e88989388989b79",
3434
);
35-
apply_patches("stdsimd", Path::new("stdsimd"));
35+
apply_patches("portable-simd", Path::new("portable-simd"));
3636

3737
clone_repo(
3838
"simple-raytracer",

patches/0001-stdsimd-Disable-unsupported-tests.patch renamed to patches/0001-portable-simd-Disable-unsupported-tests.patch

Lines changed: 17 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,20 @@ Date: Sun, 25 Jul 2021 18:39:31 +0200
44
Subject: [PATCH] Disable unsupported tests
55

66
---
7-
crates/core_simd/src/array.rs | 2 ++
8-
crates/core_simd/src/lib.rs | 2 +-
7+
crates/core_simd/src/vector.rs | 2 ++
98
crates/core_simd/src/math.rs | 4 ++++
109
crates/core_simd/tests/masks.rs | 12 ------------
1110
crates/core_simd/tests/ops_macros.rs | 6 ++++++
1211
crates/core_simd/tests/round.rs | 2 ++
1312
6 files changed, 15 insertions(+), 13 deletions(-)
1413

15-
diff --git a/crates/core_simd/src/array.rs b/crates/core_simd/src/array.rs
14+
diff --git a/crates/core_simd/src/vector.rs b/crates/core_simd/src/vector.rs
1615
index 25c5309..2b3d819 100644
17-
--- a/crates/core_simd/src/array.rs
18-
+++ b/crates/core_simd/src/array.rs
16+
--- a/crates/core_simd/src/vector.rs
17+
+++ b/crates/core_simd/src/vector.rs
1918
@@ -22,6 +22,7 @@ where
20-
#[must_use]
21-
fn splat(val: Self::Scalar) -> Self;
19+
self.0
20+
}
2221

2322
+ /*
2423
/// SIMD gather: construct a SIMD vector by reading from a slice, using potentially discontiguous indices.
@@ -31,27 +30,14 @@ index 25c5309..2b3d819 100644
3130
+ */
3231
}
3332

34-
macro_rules! impl_simdarray_for {
35-
diff --git a/crates/core_simd/src/lib.rs b/crates/core_simd/src/lib.rs
36-
index a64904d..299eb11 100644
37-
--- a/crates/core_simd/src/lib.rs
38-
+++ b/crates/core_simd/src/lib.rs
39-
@@ -1,7 +1,7 @@
40-
#![no_std]
41-
#![allow(incomplete_features)]
42-
#![feature(
43-
- const_generics,
44-
+ const_generics,
45-
platform_intrinsics,
46-
repr_simd,
47-
simd_ffi,
33+
impl<T, const LANES: usize> Copy for Simd<T, LANES>
4834
diff --git a/crates/core_simd/src/math.rs b/crates/core_simd/src/math.rs
4935
index 7290a28..e394730 100644
5036
--- a/crates/core_simd/src/math.rs
5137
+++ b/crates/core_simd/src/math.rs
5238
@@ -2,6 +2,7 @@ macro_rules! impl_uint_arith {
53-
($(($name:ident, $n:ident)),+) => {
54-
$( impl<const LANES: usize> $name<LANES> where Self: crate::LanesAtMost32 {
39+
($($ty:ty),+) => {
40+
$( impl<const LANES: usize> Simd<$ty, LANES> where LaneCount<LANES>: SupportedLaneCount {
5541

5642
+ /*
5743
/// Lanewise saturating add.
@@ -66,8 +52,8 @@ index 7290a28..e394730 100644
6652
}
6753
}
6854
@@ -46,6 +48,7 @@ macro_rules! impl_int_arith {
69-
($(($name:ident, $n:ident)),+) => {
70-
$( impl<const LANES: usize> $name<LANES> where Self: crate::LanesAtMost32 {
55+
($($ty:ty),+) => {
56+
$( impl<const LANES: usize> Simd<$ty, LANES> where LaneCount<LANES>: SupportedLaneCount {
7157

7258
+ /*
7359
/// Lanewise saturating add.
@@ -87,7 +73,7 @@ index 61d8e44..2bccae2 100644
8773
+++ b/crates/core_simd/tests/masks.rs
8874
@@ -67,18 +67,6 @@ macro_rules! test_mask_api {
8975
assert_eq!(int.to_array(), [-1, 0, 0, -1, 0, 0, -1, 0]);
90-
assert_eq!(core_simd::$name::<8>::from_int(int), mask);
76+
assert_eq!(core_simd::Mask::<$type, 8>::from_int(int), mask);
9177
}
9278
-
9379
- #[test]
@@ -96,10 +82,10 @@ index 61d8e44..2bccae2 100644
9682
- true, false, false, true, false, false, true, false,
9783
- true, true, false, false, false, false, false, true,
9884
- ];
99-
- let mask = core_simd::$name::<16>::from_array(values);
85+
- let mask = core_simd::Mask::<$type, 16>::from_array(values);
10086
- let bitmask = mask.to_bitmask();
10187
- assert_eq!(bitmask, [0b01001001, 0b10000011]);
102-
- assert_eq!(core_simd::$name::<16>::from_bitmask(bitmask), mask);
88+
- assert_eq!(core_simd::Mask::<$type, 16>::from_bitmask(bitmask), mask);
10389
- }
10490
}
10591
}
@@ -122,7 +108,7 @@ index cb39e73..fc0ebe1 100644
122108
}
123109
+ */
124110

125-
fn sqrt<const LANES: usize>() {
111+
fn recip<const LANES: usize>() {
126112
test_helpers::test_unary_elementwise(
127113
@@ -581,6 +585,7 @@ macro_rules! impl_float_tests {
128114
});
@@ -138,8 +124,8 @@ index cb39e73..fc0ebe1 100644
138124
}
139125
+ */
140126
}
141-
}
142-
}
127+
128+
#[cfg(feature = "std")]
143129
diff --git a/crates/core_simd/tests/round.rs b/crates/core_simd/tests/round.rs
144130
index 37044a7..4cdc6b7 100644
145131
--- a/crates/core_simd/tests/round.rs

scripts/tests.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ function extended_sysroot_tests() {
137137
fi
138138
popd
139139

140-
pushd stdsimd
141-
echo "[TEST] rust-lang/stdsimd"
140+
pushd portable-simd
141+
echo "[TEST] rust-lang/portable-simd"
142142
../build/cargo clean
143143
../build/cargo build --all-targets --target $TARGET_TRIPLE
144144
if [[ "$HOST_TRIPLE" = "$TARGET_TRIPLE" ]]; then

0 commit comments

Comments
 (0)