Skip to content

Commit

Permalink
Merge commit '26c02eb2904da9a53d2220d4f3069b19a3c81d3d' into sync_cg_…
Browse files Browse the repository at this point in the history
…clif-2023-12-24
  • Loading branch information
bjorn3 committed Dec 24, 2023
1 parent bfda19d commit 7325d0d
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 34 deletions.
52 changes: 26 additions & 26 deletions Cargo.lock

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

12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ crate-type = ["dylib"]

[dependencies]
# These have to be in sync with each other
cranelift-codegen = { version = "0.102", default-features = false, features = ["std", "unwind", "all-arch"] }
cranelift-frontend = { version = "0.102" }
cranelift-module = { version = "0.102" }
cranelift-native = { version = "0.102" }
cranelift-jit = { version = "0.102", optional = true }
cranelift-object = { version = "0.102" }
cranelift-codegen = { version = "0.103", default-features = false, features = ["std", "unwind", "all-arch"] }
cranelift-frontend = { version = "0.103" }
cranelift-module = { version = "0.103" }
cranelift-native = { version = "0.103" }
cranelift-jit = { version = "0.103", optional = true }
cranelift-object = { version = "0.103" }
target-lexicon = "0.12.0"
gimli = { version = "0.28", default-features = false, features = ["write"]}
object = { version = "0.32", default-features = false, features = ["std", "read_core", "write", "archive", "coff", "elf", "macho", "pe"] }
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "nightly-2023-12-19"
channel = "nightly-2023-12-24"
components = ["rust-src", "rustc-dev", "llvm-tools"]
3 changes: 2 additions & 1 deletion scripts/test_rustc_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ rm tests/ui/parser/unclosed-delimiter-in-dep.rs # submodule contains //~ERROR
# FIXME add needs-unwind to these tests
rm -r tests/run-make/libtest-junit
rm tests/ui/asm/may_unwind.rs
rm tests/ui/stable-mir-print/basic_function.rs

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

# exotic linkages
rm tests/ui/issues/issue-33992.rs # unsupported linkages
Expand Down Expand Up @@ -80,6 +80,7 @@ rm -r tests/run-make/codegen-options-parsing
rm -r tests/run-make/lto-*
rm -r tests/run-make/reproducible-build-2
rm -r tests/run-make/issue-109934-lto-debuginfo
rm -r tests/run-make/no-builtins-lto

# optimization tests
# ==================
Expand Down
31 changes: 31 additions & 0 deletions src/intrinsics/simd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,37 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
}
}

sym::simd_masked_store => {
intrinsic_args!(fx, args => (mask, ptr, val); intrinsic);

let (val_lane_count, val_lane_ty) = val.layout().ty.simd_size_and_type(fx.tcx);
let (mask_lane_count, _mask_lane_ty) = mask.layout().ty.simd_size_and_type(fx.tcx);
assert_eq!(val_lane_count, mask_lane_count);
let lane_clif_ty = fx.clif_type(val_lane_ty).unwrap();
let ptr_val = ptr.load_scalar(fx);

for lane_idx in 0..val_lane_count {
let val_lane = val.value_lane(fx, lane_idx).load_scalar(fx);
let mask_lane = mask.value_lane(fx, lane_idx).load_scalar(fx);

let if_enabled = fx.bcx.create_block();
let next = fx.bcx.create_block();

fx.bcx.ins().brif(mask_lane, if_enabled, &[], next, &[]);
fx.bcx.seal_block(if_enabled);

fx.bcx.switch_to_block(if_enabled);
let offset = lane_idx as i32 * lane_clif_ty.bytes() as i32;
fx.bcx.ins().store(MemFlags::trusted(), val_lane, ptr_val, Offset32::new(offset));
fx.bcx.ins().jump(next, &[]);

fx.bcx.seal_block(next);
fx.bcx.switch_to_block(next);

fx.bcx.ins().nop();
}
}

sym::simd_gather => {
intrinsic_args!(fx, args => (val, ptr, mask); intrinsic);

Expand Down

0 comments on commit 7325d0d

Please sign in to comment.