Skip to content

Commit 86f9bcf

Browse files
committed
Merge commit '61667dedf55e3e5aa584f7ae2bd0471336b92ce9' into sync_cg_clif-2021-09-19
2 parents 7a3d1a5 + 61667de commit 86f9bcf

24 files changed

+332
-294
lines changed

compiler/rustc_codegen_cranelift/.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

compiler/rustc_codegen_cranelift/Cargo.lock

+20-20
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
3333

3434
[[package]]
3535
name = "cranelift-bforest"
36-
version = "0.75.0"
37-
source = "git+https://github.com/bytecodealliance/wasmtime.git#5deda279775dca5e37449c829cda1f6276d6542b"
36+
version = "0.76.0"
37+
source = "git+https://github.com/bytecodealliance/wasmtime.git#9c550fcf41425942ed97c747f0169b2ca81f9c1b"
3838
dependencies = [
3939
"cranelift-entity",
4040
]
4141

4242
[[package]]
4343
name = "cranelift-codegen"
44-
version = "0.75.0"
45-
source = "git+https://github.com/bytecodealliance/wasmtime.git#5deda279775dca5e37449c829cda1f6276d6542b"
44+
version = "0.76.0"
45+
source = "git+https://github.com/bytecodealliance/wasmtime.git#9c550fcf41425942ed97c747f0169b2ca81f9c1b"
4646
dependencies = [
4747
"cranelift-bforest",
4848
"cranelift-codegen-meta",
@@ -57,27 +57,27 @@ dependencies = [
5757

5858
[[package]]
5959
name = "cranelift-codegen-meta"
60-
version = "0.75.0"
61-
source = "git+https://github.com/bytecodealliance/wasmtime.git#5deda279775dca5e37449c829cda1f6276d6542b"
60+
version = "0.76.0"
61+
source = "git+https://github.com/bytecodealliance/wasmtime.git#9c550fcf41425942ed97c747f0169b2ca81f9c1b"
6262
dependencies = [
6363
"cranelift-codegen-shared",
6464
"cranelift-entity",
6565
]
6666

6767
[[package]]
6868
name = "cranelift-codegen-shared"
69-
version = "0.75.0"
70-
source = "git+https://github.com/bytecodealliance/wasmtime.git#5deda279775dca5e37449c829cda1f6276d6542b"
69+
version = "0.76.0"
70+
source = "git+https://github.com/bytecodealliance/wasmtime.git#9c550fcf41425942ed97c747f0169b2ca81f9c1b"
7171

7272
[[package]]
7373
name = "cranelift-entity"
74-
version = "0.75.0"
75-
source = "git+https://github.com/bytecodealliance/wasmtime.git#5deda279775dca5e37449c829cda1f6276d6542b"
74+
version = "0.76.0"
75+
source = "git+https://github.com/bytecodealliance/wasmtime.git#9c550fcf41425942ed97c747f0169b2ca81f9c1b"
7676

7777
[[package]]
7878
name = "cranelift-frontend"
79-
version = "0.75.0"
80-
source = "git+https://github.com/bytecodealliance/wasmtime.git#5deda279775dca5e37449c829cda1f6276d6542b"
79+
version = "0.76.0"
80+
source = "git+https://github.com/bytecodealliance/wasmtime.git#9c550fcf41425942ed97c747f0169b2ca81f9c1b"
8181
dependencies = [
8282
"cranelift-codegen",
8383
"log",
@@ -87,8 +87,8 @@ dependencies = [
8787

8888
[[package]]
8989
name = "cranelift-jit"
90-
version = "0.75.0"
91-
source = "git+https://github.com/bytecodealliance/wasmtime.git#5deda279775dca5e37449c829cda1f6276d6542b"
90+
version = "0.76.0"
91+
source = "git+https://github.com/bytecodealliance/wasmtime.git#9c550fcf41425942ed97c747f0169b2ca81f9c1b"
9292
dependencies = [
9393
"anyhow",
9494
"cranelift-codegen",
@@ -104,8 +104,8 @@ dependencies = [
104104

105105
[[package]]
106106
name = "cranelift-module"
107-
version = "0.75.0"
108-
source = "git+https://github.com/bytecodealliance/wasmtime.git#5deda279775dca5e37449c829cda1f6276d6542b"
107+
version = "0.76.0"
108+
source = "git+https://github.com/bytecodealliance/wasmtime.git#9c550fcf41425942ed97c747f0169b2ca81f9c1b"
109109
dependencies = [
110110
"anyhow",
111111
"cranelift-codegen",
@@ -115,8 +115,8 @@ dependencies = [
115115

116116
[[package]]
117117
name = "cranelift-native"
118-
version = "0.75.0"
119-
source = "git+https://github.com/bytecodealliance/wasmtime.git#5deda279775dca5e37449c829cda1f6276d6542b"
118+
version = "0.76.0"
119+
source = "git+https://github.com/bytecodealliance/wasmtime.git#9c550fcf41425942ed97c747f0169b2ca81f9c1b"
120120
dependencies = [
121121
"cranelift-codegen",
122122
"libc",
@@ -125,8 +125,8 @@ dependencies = [
125125

126126
[[package]]
127127
name = "cranelift-object"
128-
version = "0.75.0"
129-
source = "git+https://github.com/bytecodealliance/wasmtime.git#5deda279775dca5e37449c829cda1f6276d6542b"
128+
version = "0.76.0"
129+
source = "git+https://github.com/bytecodealliance/wasmtime.git#9c550fcf41425942ed97c747f0169b2ca81f9c1b"
130130
dependencies = [
131131
"anyhow",
132132
"cranelift-codegen",

compiler/rustc_codegen_cranelift/build_sysroot/Cargo.lock

+26-15
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ version = 3
44

55
[[package]]
66
name = "addr2line"
7-
version = "0.14.1"
7+
version = "0.16.0"
88
source = "registry+https://github.com/rust-lang/crates.io-index"
9-
checksum = "a55f82cfe485775d02112886f4169bde0c5894d75e79ead7eafe7e40a25e45f7"
9+
checksum = "3e61f2b7f93d2c7d2b08263acaa4a363b3e276806c68af6134c44f523bf1aacd"
1010
dependencies = [
1111
"compiler_builtins",
1212
"gimli",
@@ -40,9 +40,9 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
4040

4141
[[package]]
4242
name = "cc"
43-
version = "1.0.69"
43+
version = "1.0.70"
4444
source = "registry+https://github.com/rust-lang/crates.io-index"
45-
checksum = "e70cc2f62c6ce1868963827bd677764c62d07c3d9a3e1fb1177ee1a9ab199eb2"
45+
checksum = "d26a6ce4b6a484fa3edb70f7efa6fc430fd2b87285fe8b84304fd0936faa0dc0"
4646

4747
[[package]]
4848
name = "cfg-if"
@@ -56,7 +56,7 @@ dependencies = [
5656

5757
[[package]]
5858
name = "compiler_builtins"
59-
version = "0.1.46"
59+
version = "0.1.50"
6060
dependencies = [
6161
"rustc-std-workspace-core",
6262
]
@@ -99,9 +99,9 @@ dependencies = [
9999

100100
[[package]]
101101
name = "gimli"
102-
version = "0.23.0"
102+
version = "0.25.0"
103103
source = "registry+https://github.com/rust-lang/crates.io-index"
104-
checksum = "f6503fe142514ca4799d4c26297c4248239fe8838d827db6bd6065c6ed29a6ce"
104+
checksum = "f0a01e0497841a3b2db4f8afa483cce65f7e96a3498bd6c541734792aeac8fe7"
105105
dependencies = [
106106
"compiler_builtins",
107107
"rustc-std-workspace-alloc",
@@ -132,13 +132,23 @@ dependencies = [
132132

133133
[[package]]
134134
name = "libc"
135-
version = "0.2.98"
135+
version = "0.2.102"
136136
source = "registry+https://github.com/rust-lang/crates.io-index"
137-
checksum = "320cfe77175da3a483efed4bc0adc1968ca050b098ce4f2f1c13a56626128790"
137+
checksum = "a2a5ac8f984bfcf3a823267e5fde638acc3325f6496633a5da6bb6eb2171e103"
138138
dependencies = [
139139
"rustc-std-workspace-core",
140140
]
141141

142+
[[package]]
143+
name = "memchr"
144+
version = "2.4.1"
145+
source = "registry+https://github.com/rust-lang/crates.io-index"
146+
checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a"
147+
dependencies = [
148+
"compiler_builtins",
149+
"rustc-std-workspace-core",
150+
]
151+
142152
[[package]]
143153
name = "miniz_oxide"
144154
version = "0.4.4"
@@ -154,11 +164,12 @@ dependencies = [
154164

155165
[[package]]
156166
name = "object"
157-
version = "0.22.0"
167+
version = "0.26.2"
158168
source = "registry+https://github.com/rust-lang/crates.io-index"
159-
checksum = "8d3b63360ec3cb337817c2dbd47ab4a0f170d285d8e5a2064600f3def1402397"
169+
checksum = "39f37e50073ccad23b6d09bcb5b263f4e76d3bb6038e4a3c08e52162ffa8abc2"
160170
dependencies = [
161171
"compiler_builtins",
172+
"memchr",
162173
"rustc-std-workspace-alloc",
163174
"rustc-std-workspace-core",
164175
]
@@ -195,9 +206,9 @@ dependencies = [
195206

196207
[[package]]
197208
name = "rustc-demangle"
198-
version = "0.1.20"
209+
version = "0.1.21"
199210
source = "registry+https://github.com/rust-lang/crates.io-index"
200-
checksum = "dead70b0b5e03e9c814bcb6b01e03e68f7c57a80aa48c72ec92152ab3e818d49"
211+
checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342"
201212
dependencies = [
202213
"compiler_builtins",
203214
"rustc-std-workspace-core",
@@ -286,9 +297,9 @@ dependencies = [
286297

287298
[[package]]
288299
name = "unicode-width"
289-
version = "0.1.8"
300+
version = "0.1.9"
290301
source = "registry+https://github.com/rust-lang/crates.io-index"
291-
checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3"
302+
checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973"
292303
dependencies = [
293304
"compiler_builtins",
294305
"rustc-std-workspace-core",

compiler/rustc_codegen_cranelift/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
}

compiler/rustc_codegen_cranelift/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/

compiler/rustc_codegen_cranelift/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.

compiler/rustc_codegen_cranelift/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;

compiler/rustc_codegen_cranelift/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

compiler/rustc_codegen_cranelift/patches/0001-stdsimd-Disable-unsupported-tests.patch renamed to compiler/rustc_codegen_cranelift/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)