Skip to content

Commit 7325d0d

Browse files
committed
Merge commit '26c02eb2904da9a53d2220d4f3069b19a3c81d3d' into sync_cg_clif-2023-12-24
1 parent bfda19d commit 7325d0d

File tree

5 files changed

+66
-34
lines changed

5 files changed

+66
-34
lines changed

Cargo.lock

Lines changed: 26 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ crate-type = ["dylib"]
88

99
[dependencies]
1010
# These have to be in sync with each other
11-
cranelift-codegen = { version = "0.102", default-features = false, features = ["std", "unwind", "all-arch"] }
12-
cranelift-frontend = { version = "0.102" }
13-
cranelift-module = { version = "0.102" }
14-
cranelift-native = { version = "0.102" }
15-
cranelift-jit = { version = "0.102", optional = true }
16-
cranelift-object = { version = "0.102" }
11+
cranelift-codegen = { version = "0.103", default-features = false, features = ["std", "unwind", "all-arch"] }
12+
cranelift-frontend = { version = "0.103" }
13+
cranelift-module = { version = "0.103" }
14+
cranelift-native = { version = "0.103" }
15+
cranelift-jit = { version = "0.103", optional = true }
16+
cranelift-object = { version = "0.103" }
1717
target-lexicon = "0.12.0"
1818
gimli = { version = "0.28", default-features = false, features = ["write"]}
1919
object = { version = "0.32", default-features = false, features = ["std", "read_core", "write", "archive", "coff", "elf", "macho", "pe"] }

rust-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "nightly-2023-12-19"
2+
channel = "nightly-2023-12-24"
33
components = ["rust-src", "rustc-dev", "llvm-tools"]

scripts/test_rustc_tests.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ rm tests/ui/parser/unclosed-delimiter-in-dep.rs # submodule contains //~ERROR
3131
# FIXME add needs-unwind to these tests
3232
rm -r tests/run-make/libtest-junit
3333
rm tests/ui/asm/may_unwind.rs
34+
rm tests/ui/stable-mir-print/basic_function.rs
3435

3536
# extra warning about -Cpanic=abort for proc macros
3637
rm tests/ui/proc-macro/crt-static.rs
@@ -44,7 +45,6 @@ rm tests/ui/proc-macro/no-mangle-in-proc-macro-issue-111888.rs
4445
# vendor intrinsics
4546
rm tests/ui/sse2.rs # CodegenBackend::target_features not yet implemented
4647
rm tests/ui/simd/array-type.rs # "Index argument for `simd_insert` is not a constant"
47-
rm tests/ui/simd/masked-load-store.rs
4848

4949
# exotic linkages
5050
rm tests/ui/issues/issue-33992.rs # unsupported linkages
@@ -80,6 +80,7 @@ rm -r tests/run-make/codegen-options-parsing
8080
rm -r tests/run-make/lto-*
8181
rm -r tests/run-make/reproducible-build-2
8282
rm -r tests/run-make/issue-109934-lto-debuginfo
83+
rm -r tests/run-make/no-builtins-lto
8384

8485
# optimization tests
8586
# ==================

src/intrinsics/simd.rs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -962,6 +962,37 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
962962
}
963963
}
964964

965+
sym::simd_masked_store => {
966+
intrinsic_args!(fx, args => (mask, ptr, val); intrinsic);
967+
968+
let (val_lane_count, val_lane_ty) = val.layout().ty.simd_size_and_type(fx.tcx);
969+
let (mask_lane_count, _mask_lane_ty) = mask.layout().ty.simd_size_and_type(fx.tcx);
970+
assert_eq!(val_lane_count, mask_lane_count);
971+
let lane_clif_ty = fx.clif_type(val_lane_ty).unwrap();
972+
let ptr_val = ptr.load_scalar(fx);
973+
974+
for lane_idx in 0..val_lane_count {
975+
let val_lane = val.value_lane(fx, lane_idx).load_scalar(fx);
976+
let mask_lane = mask.value_lane(fx, lane_idx).load_scalar(fx);
977+
978+
let if_enabled = fx.bcx.create_block();
979+
let next = fx.bcx.create_block();
980+
981+
fx.bcx.ins().brif(mask_lane, if_enabled, &[], next, &[]);
982+
fx.bcx.seal_block(if_enabled);
983+
984+
fx.bcx.switch_to_block(if_enabled);
985+
let offset = lane_idx as i32 * lane_clif_ty.bytes() as i32;
986+
fx.bcx.ins().store(MemFlags::trusted(), val_lane, ptr_val, Offset32::new(offset));
987+
fx.bcx.ins().jump(next, &[]);
988+
989+
fx.bcx.seal_block(next);
990+
fx.bcx.switch_to_block(next);
991+
992+
fx.bcx.ins().nop();
993+
}
994+
}
995+
965996
sym::simd_gather => {
966997
intrinsic_args!(fx, args => (val, ptr, mask); intrinsic);
967998

0 commit comments

Comments
 (0)