diff options
| author | bors <bors@rust-lang.org> | 2025-06-27 20:07:50 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-06-27 20:07:50 +0000 |
| commit | bdaba05a953eb5abeba0011cdda2560d157aed2e (patch) | |
| tree | bbdaecd0be314a364edfdd760923b4b2b9967d4b /compiler | |
| parent | fe5f3dedf7b4d6bea2cadb17343f747d70b4c66b (diff) | |
| parent | d9a4fd5d51d7c93d8c8b759c656395a0ccade198 (diff) | |
| download | rust-bdaba05a953eb5abeba0011cdda2560d157aed2e.tar.gz rust-bdaba05a953eb5abeba0011cdda2560d157aed2e.zip | |
Auto merge of #143064 - flip1995:clippy-subtree-update, r=GuillaumeGomez
Clippy subtree update r? `@Manishearth` Cargo.lock update due to version bump
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_codegen_gcc/src/intrinsic/simd.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_gcc/src/intrinsic/simd.rs b/compiler/rustc_codegen_gcc/src/intrinsic/simd.rs index 6f6bc93b8b2..ac8b7f4ea48 100644 --- a/compiler/rustc_codegen_gcc/src/intrinsic/simd.rs +++ b/compiler/rustc_codegen_gcc/src/intrinsic/simd.rs @@ -61,7 +61,7 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( let (len, _) = args[1].layout.ty.simd_size_and_type(bx.tcx()); let expected_int_bits = (len.max(8) - 1).next_power_of_two(); - let expected_bytes = len / 8 + ((len % 8 > 0) as u64); + let expected_bytes = len / 8 + ((!len.is_multiple_of(8)) as u64); let mask_ty = args[0].layout.ty; let mut mask = match *mask_ty.kind() { @@ -676,7 +676,8 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( let elem_type = vector_type.get_element_type(); let expected_int_bits = in_len.max(8); - let expected_bytes = expected_int_bits / 8 + ((expected_int_bits % 8 > 0) as u64); + let expected_bytes = + expected_int_bits / 8 + ((!expected_int_bits.is_multiple_of(8)) as u64); // FIXME(antoyo): that's not going to work for masks bigger than 128 bits. let result_type = bx.type_ix(expected_int_bits); |
