Skip to content

Commit

Permalink
Merge commit '61667dedf55e3e5aa584f7ae2bd0471336b92ce9' into sync_cg_…
Browse files Browse the repository at this point in the history
…clif-2021-09-19
  • Loading branch information
bjorn3 committed Sep 19, 2021
2 parents 7a3d1a5 + 61667de commit 86f9bcf
Show file tree
Hide file tree
Showing 24 changed files with 332 additions and 294 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_cranelift/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ perf.data.old
/rand
/regex
/simple-raytracer
/stdsimd
/portable-simd
40 changes: 20 additions & 20 deletions compiler/rustc_codegen_cranelift/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"

[[package]]
name = "cranelift-bforest"
version = "0.75.0"
source = "git+https://github.com/bytecodealliance/wasmtime.git#5deda279775dca5e37449c829cda1f6276d6542b"
version = "0.76.0"
source = "git+https://github.com/bytecodealliance/wasmtime.git#9c550fcf41425942ed97c747f0169b2ca81f9c1b"
dependencies = [
"cranelift-entity",
]

[[package]]
name = "cranelift-codegen"
version = "0.75.0"
source = "git+https://github.com/bytecodealliance/wasmtime.git#5deda279775dca5e37449c829cda1f6276d6542b"
version = "0.76.0"
source = "git+https://github.com/bytecodealliance/wasmtime.git#9c550fcf41425942ed97c747f0169b2ca81f9c1b"
dependencies = [
"cranelift-bforest",
"cranelift-codegen-meta",
Expand All @@ -57,27 +57,27 @@ dependencies = [

[[package]]
name = "cranelift-codegen-meta"
version = "0.75.0"
source = "git+https://github.com/bytecodealliance/wasmtime.git#5deda279775dca5e37449c829cda1f6276d6542b"
version = "0.76.0"
source = "git+https://github.com/bytecodealliance/wasmtime.git#9c550fcf41425942ed97c747f0169b2ca81f9c1b"
dependencies = [
"cranelift-codegen-shared",
"cranelift-entity",
]

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

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

[[package]]
name = "cranelift-frontend"
version = "0.75.0"
source = "git+https://github.com/bytecodealliance/wasmtime.git#5deda279775dca5e37449c829cda1f6276d6542b"
version = "0.76.0"
source = "git+https://github.com/bytecodealliance/wasmtime.git#9c550fcf41425942ed97c747f0169b2ca81f9c1b"
dependencies = [
"cranelift-codegen",
"log",
Expand All @@ -87,8 +87,8 @@ dependencies = [

[[package]]
name = "cranelift-jit"
version = "0.75.0"
source = "git+https://github.com/bytecodealliance/wasmtime.git#5deda279775dca5e37449c829cda1f6276d6542b"
version = "0.76.0"
source = "git+https://github.com/bytecodealliance/wasmtime.git#9c550fcf41425942ed97c747f0169b2ca81f9c1b"
dependencies = [
"anyhow",
"cranelift-codegen",
Expand All @@ -104,8 +104,8 @@ dependencies = [

[[package]]
name = "cranelift-module"
version = "0.75.0"
source = "git+https://github.com/bytecodealliance/wasmtime.git#5deda279775dca5e37449c829cda1f6276d6542b"
version = "0.76.0"
source = "git+https://github.com/bytecodealliance/wasmtime.git#9c550fcf41425942ed97c747f0169b2ca81f9c1b"
dependencies = [
"anyhow",
"cranelift-codegen",
Expand All @@ -115,8 +115,8 @@ dependencies = [

[[package]]
name = "cranelift-native"
version = "0.75.0"
source = "git+https://github.com/bytecodealliance/wasmtime.git#5deda279775dca5e37449c829cda1f6276d6542b"
version = "0.76.0"
source = "git+https://github.com/bytecodealliance/wasmtime.git#9c550fcf41425942ed97c747f0169b2ca81f9c1b"
dependencies = [
"cranelift-codegen",
"libc",
Expand All @@ -125,8 +125,8 @@ dependencies = [

[[package]]
name = "cranelift-object"
version = "0.75.0"
source = "git+https://github.com/bytecodealliance/wasmtime.git#5deda279775dca5e37449c829cda1f6276d6542b"
version = "0.76.0"
source = "git+https://github.com/bytecodealliance/wasmtime.git#9c550fcf41425942ed97c747f0169b2ca81f9c1b"
dependencies = [
"anyhow",
"cranelift-codegen",
Expand Down
41 changes: 26 additions & 15 deletions compiler/rustc_codegen_cranelift/build_sysroot/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ version = 3

[[package]]
name = "addr2line"
version = "0.14.1"
version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a55f82cfe485775d02112886f4169bde0c5894d75e79ead7eafe7e40a25e45f7"
checksum = "3e61f2b7f93d2c7d2b08263acaa4a363b3e276806c68af6134c44f523bf1aacd"
dependencies = [
"compiler_builtins",
"gimli",
Expand Down Expand Up @@ -40,9 +40,9 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"

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

[[package]]
name = "cfg-if"
Expand All @@ -56,7 +56,7 @@ dependencies = [

[[package]]
name = "compiler_builtins"
version = "0.1.46"
version = "0.1.50"
dependencies = [
"rustc-std-workspace-core",
]
Expand Down Expand Up @@ -99,9 +99,9 @@ dependencies = [

[[package]]
name = "gimli"
version = "0.23.0"
version = "0.25.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f6503fe142514ca4799d4c26297c4248239fe8838d827db6bd6065c6ed29a6ce"
checksum = "f0a01e0497841a3b2db4f8afa483cce65f7e96a3498bd6c541734792aeac8fe7"
dependencies = [
"compiler_builtins",
"rustc-std-workspace-alloc",
Expand Down Expand Up @@ -132,13 +132,23 @@ dependencies = [

[[package]]
name = "libc"
version = "0.2.98"
version = "0.2.102"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "320cfe77175da3a483efed4bc0adc1968ca050b098ce4f2f1c13a56626128790"
checksum = "a2a5ac8f984bfcf3a823267e5fde638acc3325f6496633a5da6bb6eb2171e103"
dependencies = [
"rustc-std-workspace-core",
]

[[package]]
name = "memchr"
version = "2.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a"
dependencies = [
"compiler_builtins",
"rustc-std-workspace-core",
]

[[package]]
name = "miniz_oxide"
version = "0.4.4"
Expand All @@ -154,11 +164,12 @@ dependencies = [

[[package]]
name = "object"
version = "0.22.0"
version = "0.26.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8d3b63360ec3cb337817c2dbd47ab4a0f170d285d8e5a2064600f3def1402397"
checksum = "39f37e50073ccad23b6d09bcb5b263f4e76d3bb6038e4a3c08e52162ffa8abc2"
dependencies = [
"compiler_builtins",
"memchr",
"rustc-std-workspace-alloc",
"rustc-std-workspace-core",
]
Expand Down Expand Up @@ -195,9 +206,9 @@ dependencies = [

[[package]]
name = "rustc-demangle"
version = "0.1.20"
version = "0.1.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dead70b0b5e03e9c814bcb6b01e03e68f7c57a80aa48c72ec92152ab3e818d49"
checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342"
dependencies = [
"compiler_builtins",
"rustc-std-workspace-core",
Expand Down Expand Up @@ -286,9 +297,9 @@ dependencies = [

[[package]]
name = "unicode-width"
version = "0.1.8"
version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3"
checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973"
dependencies = [
"compiler_builtins",
"rustc-std-workspace-core",
Expand Down
10 changes: 5 additions & 5 deletions compiler/rustc_codegen_cranelift/build_system/prepare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ pub(crate) fn prepare() {
);

clone_repo(
"stdsimd",
"https://github.com/rust-lang/stdsimd",
"be96995d8ddec03fac9a0caf4d4c51c7fbc33507",
"portable-simd",
"https://github.com/rust-lang/portable-simd",
"8cf7a62e5d2552961df51e5200aaa5b7c890a4bf",
);
apply_patches("stdsimd", Path::new("stdsimd"));
apply_patches("portable-simd", Path::new("portable-simd"));

clone_repo(
"simple-raytracer",
Expand Down Expand Up @@ -92,7 +92,7 @@ fn prepare_sysroot() {
clone_repo(
"build_sysroot/compiler-builtins",
"https://github.com/rust-lang/compiler-builtins.git",
"0.1.46",
"0.1.50",
);
apply_patches("compiler-builtins", Path::new("build_sysroot/compiler-builtins"));
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_cranelift/clean_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ set -e

rm -rf build_sysroot/{sysroot_src/,target/,compiler-builtins/,rustc_version}
rm -rf target/ build/ perf.data{,.old}
rm -rf rand/ regex/ simple-raytracer/ stdsimd/
rm -rf rand/ regex/ simple-raytracer/ portable-simd/
2 changes: 2 additions & 0 deletions compiler/rustc_codegen_cranelift/docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ $ $cg_clif_dir/build/bin/cg_clif my_crate.rs

## Jit mode

> ⚠⚠⚠ 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. ⚠⚠⚠
In jit mode cg_clif will immediately execute your code without creating an executable file.

> This requires all dependencies to be available as dynamic library.
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_cranelift/example/alloc_example.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(start, core_intrinsics, alloc_prelude, alloc_error_handler)]
#![feature(start, core_intrinsics, alloc_prelude, alloc_error_handler, box_syntax)]
#![no_std]

extern crate alloc;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(no_core, lang_items, never_type, linkage, extern_types, thread_local)]
#![feature(no_core, lang_items, never_type, linkage, extern_types, thread_local, box_syntax)]
#![no_core]
#![allow(dead_code, non_camel_case_types)]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,20 @@ Date: Sun, 25 Jul 2021 18:39:31 +0200
Subject: [PATCH] Disable unsupported tests

---
crates/core_simd/src/array.rs | 2 ++
crates/core_simd/src/lib.rs | 2 +-
crates/core_simd/src/vector.rs | 2 ++
crates/core_simd/src/math.rs | 4 ++++
crates/core_simd/tests/masks.rs | 12 ------------
crates/core_simd/tests/ops_macros.rs | 6 ++++++
crates/core_simd/tests/round.rs | 2 ++
6 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/crates/core_simd/src/array.rs b/crates/core_simd/src/array.rs
diff --git a/crates/core_simd/src/vector.rs b/crates/core_simd/src/vector.rs
index 25c5309..2b3d819 100644
--- a/crates/core_simd/src/array.rs
+++ b/crates/core_simd/src/array.rs
--- a/crates/core_simd/src/vector.rs
+++ b/crates/core_simd/src/vector.rs
@@ -22,6 +22,7 @@ where
#[must_use]
fn splat(val: Self::Scalar) -> Self;
self.0
}

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

macro_rules! impl_simdarray_for {
diff --git a/crates/core_simd/src/lib.rs b/crates/core_simd/src/lib.rs
index a64904d..299eb11 100644
--- a/crates/core_simd/src/lib.rs
+++ b/crates/core_simd/src/lib.rs
@@ -1,7 +1,7 @@
#![no_std]
#![allow(incomplete_features)]
#![feature(
- const_generics,
+ const_generics,
platform_intrinsics,
repr_simd,
simd_ffi,
impl<T, const LANES: usize> Copy for Simd<T, LANES>
diff --git a/crates/core_simd/src/math.rs b/crates/core_simd/src/math.rs
index 7290a28..e394730 100644
--- a/crates/core_simd/src/math.rs
+++ b/crates/core_simd/src/math.rs
@@ -2,6 +2,7 @@ macro_rules! impl_uint_arith {
($(($name:ident, $n:ident)),+) => {
$( impl<const LANES: usize> $name<LANES> where Self: crate::LanesAtMost32 {
($($ty:ty),+) => {
$( impl<const LANES: usize> Simd<$ty, LANES> where LaneCount<LANES>: SupportedLaneCount {

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

+ /*
/// Lanewise saturating add.
Expand All @@ -85,21 +71,22 @@ diff --git a/crates/core_simd/tests/masks.rs b/crates/core_simd/tests/masks.rs
index 61d8e44..2bccae2 100644
--- a/crates/core_simd/tests/masks.rs
+++ b/crates/core_simd/tests/masks.rs
@@ -67,18 +67,6 @@ macro_rules! test_mask_api {
@@ -67,19 +67,6 @@ macro_rules! test_mask_api {
assert_eq!(int.to_array(), [-1, 0, 0, -1, 0, 0, -1, 0]);
assert_eq!(core_simd::$name::<8>::from_int(int), mask);
assert_eq!(core_simd::Mask::<$type, 8>::from_int(int), mask);
}
-
- #[cfg(feature = "generic_const_exprs")]
- #[test]
- fn roundtrip_bitmask_conversion() {
- let values = [
- true, false, false, true, false, false, true, false,
- true, true, false, false, false, false, false, true,
- ];
- let mask = core_simd::$name::<16>::from_array(values);
- let mask = core_simd::Mask::<$type, 16>::from_array(values);
- let bitmask = mask.to_bitmask();
- assert_eq!(bitmask, [0b01001001, 0b10000011]);
- assert_eq!(core_simd::$name::<16>::from_bitmask(bitmask), mask);
- assert_eq!(core_simd::Mask::<$type, 16>::from_bitmask(bitmask), mask);
- }
}
}
Expand All @@ -122,7 +109,7 @@ index cb39e73..fc0ebe1 100644
}
+ */

fn sqrt<const LANES: usize>() {
fn recip<const LANES: usize>() {
test_helpers::test_unary_elementwise(
@@ -581,6 +585,7 @@ macro_rules! impl_float_tests {
});
Expand All @@ -138,8 +125,8 @@ index cb39e73..fc0ebe1 100644
}
+ */
}
}
}

#[cfg(feature = "std")]
diff --git a/crates/core_simd/tests/round.rs b/crates/core_simd/tests/round.rs
index 37044a7..4cdc6b7 100644
--- a/crates/core_simd/tests/round.rs
Expand Down
Loading

0 comments on commit 86f9bcf

Please sign in to comment.