diff --git a/src/nouveau/compiler/nak/ir.rs b/src/nouveau/compiler/nak/ir.rs index f67d840e4f5..f512938edb2 100644 --- a/src/nouveau/compiler/nak/ir.rs +++ b/src/nouveau/compiler/nak/ir.rs @@ -4432,7 +4432,7 @@ fn reduce_shift_imm(shift: &mut Src, wrap: bool, bits: u32) { debug_assert!(shift.src_mod.is_none()); if let SrcRef::Imm32(shift) = &mut shift.src_ref { if wrap { - *shift = *shift & (bits - 1); + *shift &= bits - 1; } else { *shift = std::cmp::min(*shift, bits) } diff --git a/src/nouveau/compiler/nak/sm32.rs b/src/nouveau/compiler/nak/sm32.rs index df903944c86..27a2c6a5563 100644 --- a/src/nouveau/compiler/nak/sm32.rs +++ b/src/nouveau/compiler/nak/sm32.rs @@ -1053,7 +1053,7 @@ impl SM32Op for OpBfe { use RegFile::GPR; b.copy_alu_src_if_not_reg(&mut self.base, GPR, SrcType::ALU); if let SrcRef::Imm32(imm) = &mut self.range.src_ref { - *imm = *imm & 0xffff; // Only the lower 2 bytes matter + *imm &= 0xffff; // Only the lower 2 bytes matter } }