diff options
| author | Grond <grond@grondhaus.net> | 2026-06-24 14:11:18 -0700 |
|---|---|---|
| committer | iximeow <me@iximeow.net> | 2026-07-28 02:53:24 +0000 |
| commit | 44f91bf710081d98b465252487a6b168b2f2597e (patch) | |
| tree | 4a345f7574fc83ccfa7d4fe7a757e39eacf2eb93 /src/armv7/display.rs | |
| parent | 40743d84ffc8bbe0a4e24b9af4d65d58a1367b23 (diff) | |
Implement the RRX immediate shift type
Diffstat (limited to 'src/armv7/display.rs')
| -rw-r--r-- | src/armv7/display.rs | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/src/armv7/display.rs b/src/armv7/display.rs index 5ceedd6..29d3ed6 100644 --- a/src/armv7/display.rs +++ b/src/armv7/display.rs @@ -97,22 +97,25 @@ impl<T: DisplaySink> DisplayingOperandVisitor<'_, T> { match shift.into_shift() { RegShiftStyle::RegImm(imm_shift) => { self.f.write_reg(imm_shift.shiftee().number())?; - if imm_shift.imm() != 0 || imm_shift.stype() != ShiftStyle::LSL { + let stype = imm_shift.stype(); + if imm_shift.imm() != 0 || stype != ShiftStyle::LSL { self.f.write_fixed_size(", ")?; - self.emit_shift_type(imm_shift.stype())?; - self.f.write_char(' ')?; - let sh = imm_shift.imm(); - if sh >= 30 { - self.f.write_char('3')?; - self.f.write_char((sh - 30 + 0x30) as char)?; - } else if sh >= 20 { - self.f.write_char('2')?; - self.f.write_char((sh - 20 + 0x30) as char)?; - } else if sh >= 10 { - self.f.write_char('1')?; - self.f.write_char((sh - 10 + 0x30) as char)?; - } else { - self.f.write_char((sh + 0x30) as char)?; + self.emit_shift_type(stype)?; + if stype != ShiftStyle::RRX { + self.f.write_char(' ')?; + let sh = imm_shift.imm(); + if sh >= 30 { + self.f.write_char('3')?; + self.f.write_char((sh - 30 + 0x30) as char)?; + } else if sh >= 20 { + self.f.write_char('2')?; + self.f.write_char((sh - 20 + 0x30) as char)?; + } else if sh >= 10 { + self.f.write_char('1')?; + self.f.write_char((sh - 10 + 0x30) as char)?; + } else { + self.f.write_char((sh + 0x30) as char)?; + } } } } |
