diff options
| -rw-r--r-- | src/armv7.rs | 16 | ||||
| -rw-r--r-- | src/armv7/display.rs | 14 |
2 files changed, 20 insertions, 10 deletions
diff --git a/src/armv7.rs b/src/armv7.rs index 1a0a7d5..06dbecb 100644 --- a/src/armv7.rs +++ b/src/armv7.rs @@ -111,11 +111,19 @@ pub enum Opcode { STC2(u8), STC2L(u8), MCRR2(u8, u8), - MCR2(u8, u8, u8), + /// > MCR (Move to Coprocessor from ARM Register) + /// + /// fields here are `coproc`, `opcode_1`, `opcode_2`, and a bool indicating if the original + /// encoding was `MCR` or `MCR2` (`true` means `MCR2`). + MCR(u8, u8, u8, bool), MRRC2(u8, u8), MCRR(u8, u8), MRRC(u8, u8), - MRC2(u8, u8, u8), + /// > MRC (Move to ARM Register from Coprocessor) + /// + /// fields here are `coproc`, `opcode_1`, `opcode_2`, and a bool indicating if the original + /// encoding was `MRC` or `MRC2` (`true` means `MRC2`). + MRC(u8, u8, u8, bool), CDP2(u8, u8, u8), SRS(bool, bool), RFE(bool, bool), @@ -1461,9 +1469,9 @@ impl Decoder<ARMv7> for InstDecoder { // MCR2/MRC2, page A8-477/A8-493 let opc1 = (word >> 21) as u8 & 0b111; if (word >> 20) & 1 == 0 { - inst.opcode = Opcode::MCR2(coproc, opc1, opc2); + inst.opcode = Opcode::MCR(coproc, opc1, opc2, true); } else { - inst.opcode = Opcode::MRC2(coproc, opc1, opc2); + inst.opcode = Opcode::MRC(coproc, opc1, opc2, true); } inst.operands = [ Operand::Reg(Reg::from_u8(Rt)), diff --git a/src/armv7/display.rs b/src/armv7/display.rs index 8eaea26..3ee0daa 100644 --- a/src/armv7/display.rs +++ b/src/armv7/display.rs @@ -513,8 +513,8 @@ pub(crate) fn visit_inst<T: DisplaySink>(instr: &Instruction, out: &mut T) -> fm return Ok(()); } - Opcode::MRC2(coproc, opc1, opc2) | - Opcode::MCR2(coproc, opc1, opc2) | + Opcode::MRC(coproc, opc1, opc2, _) | + Opcode::MCR(coproc, opc1, opc2, _) | Opcode::CDP2(coproc, opc1, opc2) => { out.span_start_opcode(); unsafe { @@ -909,9 +909,9 @@ impl <T: fmt::Write, Y: YaxColors> Colorize<T, Y> for ConditionedOpcode { Opcode::STC2(_) | Opcode::STC2L(_) | Opcode::MCRR2(_, _) | - Opcode::MCR2(_, _, _) | + Opcode::MCR(_, _, _, _) | Opcode::MRRC2(_, _) | - Opcode::MRC2(_, _, _) | + Opcode::MRC(_, _, _, _) | Opcode::MCRR(_, _) | Opcode::MRRC(_, _) | Opcode::CDP2(_, _, _) => { write!(out, "{}", colors.platform_op(self)) }, @@ -948,9 +948,11 @@ impl Opcode { Opcode::STC2(_) => { "stc2" }, Opcode::STC2L(_) => { "stc2l" }, Opcode::MCRR2(_, _) => { "mcrr2" }, - Opcode::MCR2(_, _, _) => { "mcr2" }, + Opcode::MCR(_, _, _, false) => { "mcr" }, + Opcode::MCR(_, _, _, true) => { "mcr2" }, Opcode::MRRC2(_, _) => { "mrrc2" }, - Opcode::MRC2(_, _, _) => { "mrc2" }, + Opcode::MRC(_, _, _, false) => { "mrc" }, + Opcode::MRC(_, _, _, true) => { "mrc2" }, Opcode::MCRR(_, _) => { "mcrr" }, Opcode::MRRC(_, _) => { "mrrc" }, Opcode::CDP2(_, _, _) => { "cdp2" }, |
