Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rust-lang/rust
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 8da871a10c9bd2c40d8773be9ae67d3daecd4dbb
Choose a base ref
..
head repository: rust-lang/rust
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 9d73c6997b4cdd2c802da756decc8d55adedaa44
Choose a head ref
Showing with 4 additions and 5 deletions.
  1. +4 −5 compiler/rustc_codegen_llvm/src/intrinsic.rs
9 changes: 4 additions & 5 deletions compiler/rustc_codegen_llvm/src/intrinsic.rs
Original file line number Diff line number Diff line change
@@ -1377,9 +1377,8 @@ fn generic_simd_intrinsic<'ll, 'tcx>(
}

if name == sym::simd_bitmask {
// The `fn simd_bitmask(vector) -> unsigned integer` intrinsic takes a
// vector mask and returns the most significant bit (MSB) of each lane in the form
// of either:
// The `fn simd_bitmask(vector) -> unsigned integer` intrinsic takes a vector mask and
// returns one bit for each lane (which must all be `0` or `!0`) in the form of either:
// * an unsigned integer
// * an array of `u8`
// If the vector has less than 8 lanes, a u8 is returned with zeroed trailing bits.
@@ -1407,8 +1406,8 @@ fn generic_simd_intrinsic<'ll, 'tcx>(
}),
};

// Shift the MSB to the right by "in_elem_bitwidth - 1" into the first bit position.
// FIXME: the docs say that valid inputs are `0` or `!0`, so the shift seems unnecessary.
// LLVM doesn't always know the inputs are `0` or `!0`, so we shift here so it optimizes to
// `pmovmskb` and similar on x86.
let shift_indices =
vec![
bx.cx.const_int(bx.type_ix(in_elem_bitwidth), (in_elem_bitwidth - 1) as _);