Skip to content

Commit 40cc891

Browse files
committed
Remove from cranelift codegen LLVM intrinsics that are no longer needed
1 parent 5d85a24 commit 40cc891

File tree

1 file changed

+0
-35
lines changed

1 file changed

+0
-35
lines changed

Diff for: 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)