Skip to content

Commit fd87c6d

Browse files
committed
Update to latest portable-simd version
1 parent d288c69 commit fd87c6d

File tree

2 files changed

+79
-88
lines changed

2 files changed

+79
-88
lines changed

build_system/prepare.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pub(crate) fn prepare() {
3030
clone_repo(
3131
"portable-simd",
3232
"https://github.com/rust-lang/portable-simd",
33-
"8cf7a62e5d2552961df51e5200aaa5b7c890a4bf",
33+
"b8d6b6844602f80af79cd96401339ec594d472d8",
3434
);
3535
apply_patches("portable-simd", Path::new("portable-simd"));
3636

Original file line numberDiff line numberDiff line change
@@ -1,152 +1,143 @@
1-
From 6bfce5dc2cbf834c74dbccb7538adc08c6eb57e7 Mon Sep 17 00:00:00 2001
1+
From 97c473937382a5b5858d9cce3c947855d23b2dc5 Mon Sep 17 00:00:00 2001
22
From: bjorn3 <[email protected]>
3-
Date: Sun, 25 Jul 2021 18:39:31 +0200
3+
Date: Thu, 18 Nov 2021 19:28:40 +0100
44
Subject: [PATCH] Disable unsupported tests
55

66
---
7-
crates/core_simd/src/vector.rs | 2 ++
8-
crates/core_simd/src/math.rs | 4 ++++
9-
crates/core_simd/tests/masks.rs | 12 ------------
10-
crates/core_simd/tests/ops_macros.rs | 6 ++++++
11-
crates/core_simd/tests/round.rs | 2 ++
12-
6 files changed, 15 insertions(+), 13 deletions(-)
7+
crates/core_simd/src/math.rs | 6 ++++++
8+
crates/core_simd/src/vector.rs | 2 ++
9+
crates/core_simd/tests/masks.rs | 2 ++
10+
crates/core_simd/tests/ops_macros.rs | 4 ++++
11+
4 files changed, 14 insertions(+)
1312

14-
diff --git a/crates/core_simd/src/vector.rs b/crates/core_simd/src/vector.rs
15-
index 25c5309..2b3d819 100644
16-
--- a/crates/core_simd/src/vector.rs
17-
+++ b/crates/core_simd/src/vector.rs
18-
@@ -22,6 +22,7 @@ where
19-
self.0
20-
}
21-
22-
+ /*
23-
/// SIMD gather: construct a SIMD vector by reading from a slice, using potentially discontiguous indices.
24-
/// If an index is out of bounds, that lane instead selects the value from the "or" vector.
25-
/// ```
26-
@@ -150,6 +151,7 @@ where
27-
// Cleared ☢️ *mut T Zone
28-
}
29-
}
30-
+ */
31-
}
32-
33-
impl<T, const LANES: usize> Copy for Simd<T, LANES>
3413
diff --git a/crates/core_simd/src/math.rs b/crates/core_simd/src/math.rs
35-
index 7290a28..e394730 100644
14+
index 2bae414..2f87499 100644
3615
--- a/crates/core_simd/src/math.rs
3716
+++ b/crates/core_simd/src/math.rs
38-
@@ -2,6 +2,7 @@ macro_rules! impl_uint_arith {
17+
@@ -5,6 +5,7 @@ macro_rules! impl_uint_arith {
3918
($($ty:ty),+) => {
4019
$( impl<const LANES: usize> Simd<$ty, LANES> where LaneCount<LANES>: SupportedLaneCount {
4120

4221
+ /*
4322
/// Lanewise saturating add.
4423
///
4524
/// # Examples
46-
@@ -38,6 +39,7 @@ macro_rules! impl_uint_arith {
25+
@@ -43,6 +44,7 @@ macro_rules! impl_uint_arith {
4726
pub fn saturating_sub(self, second: Self) -> Self {
48-
unsafe { crate::intrinsics::simd_saturating_sub(self, second) }
27+
unsafe { simd_saturating_sub(self, second) }
4928
}
5029
+ */
5130
})+
5231
}
5332
}
54-
@@ -46,6 +48,7 @@ macro_rules! impl_int_arith {
33+
@@ -51,6 +53,7 @@ macro_rules! impl_int_arith {
5534
($($ty:ty),+) => {
5635
$( impl<const LANES: usize> Simd<$ty, LANES> where LaneCount<LANES>: SupportedLaneCount {
5736

5837
+ /*
5938
/// Lanewise saturating add.
6039
///
6140
/// # Examples
62-
@@ -141,6 +144,7 @@ macro_rules! impl_int_arith {
41+
@@ -89,6 +92,7 @@ macro_rules! impl_int_arith {
42+
pub fn saturating_sub(self, second: Self) -> Self {
43+
unsafe { simd_saturating_sub(self, second) }
44+
}
45+
+ */
46+
47+
/// Lanewise absolute value, implemented in Rust.
48+
/// Every lane becomes its absolute value.
49+
@@ -109,6 +113,7 @@ macro_rules! impl_int_arith {
50+
(self^m) - m
51+
}
52+
53+
+ /*
54+
/// Lanewise saturating absolute value, implemented in Rust.
55+
/// As abs(), except the MIN value becomes MAX instead of itself.
56+
///
57+
@@ -151,6 +156,7 @@ macro_rules! impl_int_arith {
6358
pub fn saturating_neg(self) -> Self {
6459
Self::splat(0).saturating_sub(self)
6560
}
6661
+ */
6762
})+
6863
}
6964
}
65+
diff --git a/crates/core_simd/src/vector.rs b/crates/core_simd/src/vector.rs
66+
index 7c5ec2b..c8631e8 100644
67+
--- a/crates/core_simd/src/vector.rs
68+
+++ b/crates/core_simd/src/vector.rs
69+
@@ -75,6 +75,7 @@ where
70+
Self(array)
71+
}
72+
73+
+ /*
74+
/// Reads from potentially discontiguous indices in `slice` to construct a SIMD vector.
75+
/// If an index is out-of-bounds, the lane is instead selected from the `or` vector.
76+
///
77+
@@ -297,6 +298,7 @@ where
78+
// Cleared ☢️ *mut T Zone
79+
}
80+
}
81+
+ */
82+
}
83+
84+
impl<T, const LANES: usize> Copy for Simd<T, LANES>
7085
diff --git a/crates/core_simd/tests/masks.rs b/crates/core_simd/tests/masks.rs
71-
index 61d8e44..2bccae2 100644
86+
index 6a8ecd3..68fcb49 100644
7287
--- a/crates/core_simd/tests/masks.rs
7388
+++ b/crates/core_simd/tests/masks.rs
74-
@@ -67,19 +67,6 @@ macro_rules! test_mask_api {
75-
assert_eq!(int.to_array(), [-1, 0, 0, -1, 0, 0, -1, 0]);
89+
@@ -68,6 +68,7 @@ macro_rules! test_mask_api {
7690
assert_eq!(core_simd::Mask::<$type, 8>::from_int(int), mask);
7791
}
78-
-
79-
- #[cfg(feature = "generic_const_exprs")]
80-
- #[test]
81-
- fn roundtrip_bitmask_conversion() {
82-
- let values = [
83-
- true, false, false, true, false, false, true, false,
84-
- true, true, false, false, false, false, false, true,
85-
- ];
86-
- let mask = core_simd::Mask::<$type, 16>::from_array(values);
87-
- let bitmask = mask.to_bitmask();
88-
- assert_eq!(bitmask, [0b01001001, 0b10000011]);
89-
- assert_eq!(core_simd::Mask::<$type, 16>::from_bitmask(bitmask), mask);
90-
- }
92+
93+
+ /*
94+
#[cfg(feature = "generic_const_exprs")]
95+
#[test]
96+
fn roundtrip_bitmask_conversion() {
97+
@@ -80,6 +81,7 @@ macro_rules! test_mask_api {
98+
assert_eq!(bitmask, [0b01001001, 0b10000011]);
99+
assert_eq!(core_simd::Mask::<$type, 16>::from_bitmask(bitmask), mask);
100+
}
101+
+ */
91102
}
92103
}
93104
}
94105
diff --git a/crates/core_simd/tests/ops_macros.rs b/crates/core_simd/tests/ops_macros.rs
95-
index cb39e73..fc0ebe1 100644
106+
index 31b7ee2..bd04b3c 100644
96107
--- a/crates/core_simd/tests/ops_macros.rs
97108
+++ b/crates/core_simd/tests/ops_macros.rs
98-
@@ -435,6 +435,7 @@ macro_rules! impl_float_tests {
99-
)
100-
}
101-
102-
+ /*
103-
fn mul_add<const LANES: usize>() {
104-
test_helpers::test_ternary_elementwise(
105-
&Vector::<LANES>::mul_add,
106-
@@ -442,6 +443,7 @@ macro_rules! impl_float_tests {
107-
&|_, _, _| true,
108-
)
109-
}
110-
+ */
111-
112-
fn recip<const LANES: usize>() {
113-
test_helpers::test_unary_elementwise(
114-
@@ -581,6 +585,7 @@ macro_rules! impl_float_tests {
109+
@@ -567,6 +567,7 @@ macro_rules! impl_float_tests {
115110
});
116111
}
117112

118113
+ /*
119114
fn horizontal_max<const LANES: usize>() {
120115
test_helpers::test_1(&|x| {
121116
let vmax = Vector::<LANES>::from_array(x).horizontal_max();
122-
@@ -604,6 +609,7 @@ macro_rules! impl_float_tests {
117+
@@ -590,6 +591,7 @@ macro_rules! impl_float_tests {
123118
Ok(())
124119
});
125120
}
126121
+ */
127122
}
128123

129124
#[cfg(feature = "std")]
130-
diff --git a/crates/core_simd/tests/round.rs b/crates/core_simd/tests/round.rs
131-
index 37044a7..4cdc6b7 100644
132-
--- a/crates/core_simd/tests/round.rs
133-
+++ b/crates/core_simd/tests/round.rs
134-
@@ -25,6 +25,7 @@ macro_rules! float_rounding_test {
135-
)
136-
}
125+
@@ -604,6 +606,7 @@ macro_rules! impl_float_tests {
126+
)
127+
}
137128

138-
+ /*
139-
fn round<const LANES: usize>() {
140-
test_helpers::test_unary_elementwise(
141-
&Vector::<LANES>::round,
142-
@@ -32,6 +33,7 @@ macro_rules! float_rounding_test {
143-
&|_| true,
144-
)
129+
+ /*
130+
fn mul_add<const LANES: usize>() {
131+
test_helpers::test_ternary_elementwise(
132+
&Vector::<LANES>::mul_add,
133+
@@ -611,6 +614,7 @@ macro_rules! impl_float_tests {
134+
&|_, _, _| true,
135+
)
136+
}
137+
+ */
145138
}
146-
+ */
147-
148-
fn trunc<const LANES: usize>() {
149-
test_helpers::test_unary_elementwise(
139+
}
140+
}
150141
--
151142
2.26.2.7.g19db9cfb68
152143

0 commit comments

Comments
 (0)