Skip to content

Commit

Permalink
Use i1 instead of bool
Browse files Browse the repository at this point in the history
  • Loading branch information
calebzulawski committed Jul 28, 2023
1 parent 4709ca2 commit ce4a48f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions compiler/rustc_codegen_llvm/src/intrinsic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2104,9 +2104,16 @@ fn generic_simd_intrinsic<'ll, 'tcx>(
);

return Ok(if matches!(name, sym::simd_ctlz | sym::simd_cttz) {
let fn_ty = bx.type_func(&[vec_ty, bx.type_bool()], vec_ty);
let fn_ty = bx.type_func(&[vec_ty, bx.type_i1()], vec_ty);
let f = bx.declare_cfn(llvm_intrinsic, llvm::UnnamedAddr::No, fn_ty);
bx.call(fn_ty, None, None, f, &[args[0].immediate(), bx.const_bool(false)], None)
bx.call(
fn_ty,
None,
None,
f,
&[args[0].immediate(), bx.const_int(bx.type_i1(), 0)],
None,
)
} else {
let fn_ty = bx.type_func(&[vec_ty], vec_ty);
let f = bx.declare_cfn(llvm_intrinsic, llvm::UnnamedAddr::No, fn_ty);
Expand Down

0 comments on commit ce4a48f

Please sign in to comment.