Skip to content

Commit

Permalink
Auto merge of rust-lang#89092 - bjorn3:sync_cg_clif-2021-09-19, r=bjorn3
Browse files Browse the repository at this point in the history
Sync rustc_codegen_cranelift

Nothing exciting this time. Mostly internal refactorings.

r? `@ghost`

`@rustbot` label +A-codegen +A-cranelift +T-compiler
  • Loading branch information
bors committed Sep 26, 2021
2 parents 1b34e2d + 5d3b8e7 commit 500e22e
Show file tree
Hide file tree
Showing 24 changed files with 332 additions and 293 deletions.
2 changes: 1 addition & 1 deletion .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 Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 26 additions & 15 deletions build_sysroot/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions 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 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 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 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
2 changes: 1 addition & 1 deletion example/mini_core_hello_world.rs
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 500e22e

Please sign in to comment.