diff options
| author | iximeow <me@iximeow.net> | 2026-09-11 16:15:14 +0000 |
|---|---|---|
| committer | iximeow <me@iximeow.net> | 2026-09-11 16:19:27 +0000 |
| commit | 475321a686f346ac51cded60384a903fa8e9fdf8 (patch) | |
| tree | 4aa7514bfc80d4042db303a6fc0943e7adcc1714 /src/armv7 | |
| parent | cf151c1dc6926bf7d14eb5a50afe42b79e6fd481 (diff) | |
fix hvc immediate missing its upper four bits
Diffstat (limited to 'src/armv7')
| -rw-r--r-- | src/armv7/thumb.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/armv7/thumb.rs b/src/armv7/thumb.rs index dacf3dd..96b6b98 100644 --- a/src/armv7/thumb.rs +++ b/src/armv7/thumb.rs @@ -2091,9 +2091,11 @@ pub fn decode_into<T: Reader<<ARMv7 as Arch>::Address, <ARMv7 as Arch>::Word>>(d // `HVC` (`B8-1970`) // v7VE let imm = lower & 0b1111_1111_1111; + let imm_upper = instr & 0b1111; + let imm = (imm_upper << 12) | imm; inst.opcode = Opcode::HVC; inst.operands = [ - Operand::Imm12(imm), + Operand::Imm32(imm as u32), Operand::Nothing, Operand::Nothing, Operand::Nothing, @@ -2818,7 +2820,7 @@ pub fn decode_into<T: Reader<<ARMv7 as Arch>::Address, <ARMv7 as Arch>::Word>>(d // TODO: so, this is gross! the PLD/PLI/PLT handling needs improvement across // the board. - if inst.opcode == Opcode::PLD { + if inst.opcode == Opcode::PLD || inst.opcode == Opcode::PLI { inst.operands[0] = inst.operands[1]; inst.operands[1] = Operand::Nothing; } |
