Skip to content

Commit 500e22e

Browse files
committed
Auto merge of rust-lang#89092 - bjorn3:sync_cg_clif-2021-09-19, r=bjorn3
Sync rustc_codegen_cranelift Nothing exciting this time. Mostly internal refactorings. r? `@ghost` `@rustbot` label +A-codegen +A-cranelift +T-compiler
2 parents 1b34e2d + 5d3b8e7 commit 500e22e

24 files changed

+332
-293
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ perf.data.old
1515
/rand
1616
/regex
1717
/simple-raytracer
18-
/stdsimd
18+
/portable-simd

Cargo.lock

+20-20
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build_sysroot/Cargo.lock

+26-15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build_system/prepare.rs

+5-5
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+
"8cf7a62e5d2552961df51e5200aaa5b7c890a4bf",
3434
);
35-
apply_patches("stdsimd", Path::new("stdsimd"));
35+
apply_patches("portable-simd", Path::new("portable-simd"));
3636

3737
clone_repo(
3838
"simple-raytracer",
@@ -92,7 +92,7 @@ fn prepare_sysroot() {
9292
clone_repo(
9393
"build_sysroot/compiler-builtins",
9494
"https://github.com/rust-lang/compiler-builtins.git",
95-
"0.1.46",
95+
"0.1.50",
9696
);
9797
apply_patches("compiler-builtins", Path::new("build_sysroot/compiler-builtins"));
9898
}

clean_all.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ set -e
33

44
rm -rf build_sysroot/{sysroot_src/,target/,compiler-builtins/,rustc_version}
55
rm -rf target/ build/ perf.data{,.old}
6-
rm -rf rand/ regex/ simple-raytracer/ stdsimd/
6+
rm -rf rand/ regex/ simple-raytracer/ portable-simd/

docs/usage.md

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ $ $cg_clif_dir/build/bin/cg_clif my_crate.rs
2424

2525
## Jit mode
2626

27+
> ⚠⚠⚠ The JIT mode is highly experimental. It may be slower than AOT compilation due to lack of incremental compilation. It may also be hard to setup if you have cargo dependencies. ⚠⚠⚠
28+
2729
In jit mode cg_clif will immediately execute your code without creating an executable file.
2830

2931
> This requires all dependencies to be available as dynamic library.

example/alloc_example.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(start, core_intrinsics, alloc_prelude, alloc_error_handler)]
1+
#![feature(start, core_intrinsics, alloc_prelude, alloc_error_handler, box_syntax)]
22
#![no_std]
33

44
extern crate alloc;

example/mini_core_hello_world.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(no_core, lang_items, never_type, linkage, extern_types, thread_local)]
1+
#![feature(no_core, lang_items, never_type, linkage, extern_types, thread_local, box_syntax)]
22
#![no_core]
33
#![allow(dead_code, non_camel_case_types)]
44

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

+19-32
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.
@@ -85,21 +71,22 @@ diff --git a/crates/core_simd/tests/masks.rs b/crates/core_simd/tests/masks.rs
8571
index 61d8e44..2bccae2 100644
8672
--- a/crates/core_simd/tests/masks.rs
8773
+++ b/crates/core_simd/tests/masks.rs
88-
@@ -67,18 +67,6 @@ macro_rules! test_mask_api {
74+
@@ -67,19 +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
-
79+
- #[cfg(feature = "generic_const_exprs")]
9380
- #[test]
9481
- fn roundtrip_bitmask_conversion() {
9582
- let values = [
9683
- true, false, false, true, false, false, true, false,
9784
- true, true, false, false, false, false, false, true,
9885
- ];
99-
- let mask = core_simd::$name::<16>::from_array(values);
86+
- let mask = core_simd::Mask::<$type, 16>::from_array(values);
10087
- let bitmask = mask.to_bitmask();
10188
- assert_eq!(bitmask, [0b01001001, 0b10000011]);
102-
- assert_eq!(core_simd::$name::<16>::from_bitmask(bitmask), mask);
89+
- assert_eq!(core_simd::Mask::<$type, 16>::from_bitmask(bitmask), mask);
10390
- }
10491
}
10592
}
@@ -122,7 +109,7 @@ index cb39e73..fc0ebe1 100644
122109
}
123110
+ */
124111

125-
fn sqrt<const LANES: usize>() {
112+
fn recip<const LANES: usize>() {
126113
test_helpers::test_unary_elementwise(
127114
@@ -581,6 +585,7 @@ macro_rules! impl_float_tests {
128115
});
@@ -138,8 +125,8 @@ index cb39e73..fc0ebe1 100644
138125
}
139126
+ */
140127
}
141-
}
142-
}
128+
129+
#[cfg(feature = "std")]
143130
diff --git a/crates/core_simd/tests/round.rs b/crates/core_simd/tests/round.rs
144131
index 37044a7..4cdc6b7 100644
145132
--- a/crates/core_simd/tests/round.rs

0 commit comments

Comments
 (0)