Skip to content

Commit e281e6f

Browse files
committed
Sync from rust e5cfc55
2 parents 9436eae + da1ed4d commit e281e6f

File tree

3 files changed

+34
-69
lines changed

3 files changed

+34
-69
lines changed

Cargo.lock

+28-28
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+6-6
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.101.1", features = ["unwind", "all-arch"] }
12-
cranelift-frontend = { version = "0.101.1" }
13-
cranelift-module = { version = "0.101.1" }
14-
cranelift-native = { version = "0.101.1" }
15-
cranelift-jit = { version = "0.101.1", optional = true }
16-
cranelift-object = { version = "0.101.1" }
11+
cranelift-codegen = { version = "0.101.2", default-features = false, features = ["std", "unwind", "all-arch"] }
12+
cranelift-frontend = { version = "0.101.2" }
13+
cranelift-module = { version = "0.101.2" }
14+
cranelift-native = { version = "0.101.2" }
15+
cranelift-jit = { version = "0.101.2", optional = true }
16+
cranelift-object = { version = "0.101.2" }
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"] }

src/intrinsics/llvm_x86.rs

-35
Original file line numberDiff line numberDiff line change
@@ -32,41 +32,6 @@ pub(crate) fn codegen_x86_llvm_intrinsic_call<'tcx>(
3232
ret.write_cvalue(fx, CValue::by_val(res, fx.layout_of(fx.tcx.types.i64)));
3333
}
3434

35-
// Used by `_mm_movemask_epi8` and `_mm256_movemask_epi8`
36-
"llvm.x86.sse2.pmovmskb.128"
37-
| "llvm.x86.avx2.pmovmskb"
38-
| "llvm.x86.sse.movmsk.ps"
39-
| "llvm.x86.sse2.movmsk.pd" => {
40-
intrinsic_args!(fx, args => (a); intrinsic);
41-
42-
let (lane_count, lane_ty) = a.layout().ty.simd_size_and_type(fx.tcx);
43-
let lane_ty = fx.clif_type(lane_ty).unwrap();
44-
assert!(lane_count <= 32);
45-
46-
let mut res = fx.bcx.ins().iconst(types::I32, 0);
47-
48-
for lane in (0..lane_count).rev() {
49-
let a_lane = a.value_lane(fx, lane).load_scalar(fx);
50-
51-
// cast float to int
52-
let a_lane = match lane_ty {
53-
types::F32 => codegen_bitcast(fx, types::I32, a_lane),
54-
types::F64 => codegen_bitcast(fx, types::I64, a_lane),
55-
_ => a_lane,
56-
};
57-
58-
// extract sign bit of an int
59-
let a_lane_sign = fx.bcx.ins().ushr_imm(a_lane, i64::from(lane_ty.bits() - 1));
60-
61-
// shift sign bit into result
62-
let a_lane_sign = clif_intcast(fx, a_lane_sign, types::I32, false);
63-
res = fx.bcx.ins().ishl_imm(res, 1);
64-
res = fx.bcx.ins().bor(res, a_lane_sign);
65-
}
66-
67-
let res = CValue::by_val(res, fx.layout_of(fx.tcx.types.i32));
68-
ret.write_cvalue(fx, res);
69-
}
7035
"llvm.x86.sse.cmp.ps" | "llvm.x86.sse2.cmp.pd" => {
7136
let (x, y, kind) = match args {
7237
[x, y, kind] => (x, y, kind),

0 commit comments

Comments
 (0)