Aarch64: mask shift-amounts incorporated into reg-reg-shift ALU insts.
We had previously fixed a bug in which constant shift amounts should be masked to modulo the number of bits in the operand; however, we did not fix the analogous case for shifts incorporated into the second register argument of ALU instructions that support integrated shifts. This failure to mask resulted in illegal instructions being generated, e.g. in https://bugzilla.mozilla.org/show_bug.cgi?id=1653502. This PR fixes the issue by masking the amount, as the shift semantics require.
This commit is contained in:
@@ -52,6 +52,11 @@ impl ShiftOpShiftImm {
|
||||
pub fn value(self) -> u8 {
|
||||
self.0
|
||||
}
|
||||
|
||||
/// Mask down to a given number of bits.
|
||||
pub fn mask(self, bits: u8) -> ShiftOpShiftImm {
|
||||
ShiftOpShiftImm(self.0 & (bits - 1))
|
||||
}
|
||||
}
|
||||
|
||||
/// A shift operator with an amount, guaranteed to be within range.
|
||||
|
||||
Reference in New Issue
Block a user