nak: use foo &= bar instead of foo = foo & bar

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
This commit is contained in:
Eric Engestrom 2025-10-04 16:32:53 +02:00
parent 6d881284c3
commit ce04b8a578
2 changed files with 2 additions and 2 deletions

View file

@ -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)
}

View file

@ -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
}
}