From f483afc2654391962a821ae41f4a50b484ad9bae Mon Sep 17 00:00:00 2001 From: iximeow Date: Sun, 6 Dec 2020 11:36:52 -0800 Subject: remove "Incomplete" opcode from arm7 non-thumb decoder --- src/armv7.rs | 11 ++--------- src/armv7/thumb.rs | 1 - 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/armv7.rs b/src/armv7.rs index c7fb6e4..91b65bd 100644 --- a/src/armv7.rs +++ b/src/armv7.rs @@ -175,9 +175,6 @@ impl > ShowContextual { unreachable!(); } } }, - Opcode::Incomplete(word) => { - write!(out, "incomplete: {:#x}", word) - }, Opcode::STC2L(coproc) => { write!(out, "stc2l p{}", coproc)?; let ops = self.operands.iter(); @@ -331,7 +328,6 @@ impl > ShowContextual> Colorize for ConditionedOpcode { fn colorize(&self, colors: &Y, out: &mut T) -> fmt::Result { match self.0 { - Opcode::Incomplete(_) | Opcode::UDF | Opcode::Invalid => { write!(out, "{}", colors.invalid_op(self)) }, Opcode::TBB | @@ -528,7 +524,6 @@ impl Display for Opcode { Opcode::QSUB => { write!(f, "qsub") }, Opcode::QDADD => { write!(f, "qdadd") }, Opcode::QDSUB => { write!(f, "qdsub") }, - Opcode::Incomplete(word) => { write!(f, "incomplete: {:#x}", word) }, Opcode::Invalid => { write!(f, "invalid") }, Opcode::POP => { write!(f, "pop") }, Opcode::PUSH => { write!(f, "push") }, @@ -675,7 +670,6 @@ impl Display for Opcode { #[derive(Debug, Copy, Clone, PartialEq, Eq)] #[allow(non_camel_case_types)] pub enum Opcode { - Incomplete(u32), Invalid, /* * These two don't really have direct encodings, but are for the specific instances @@ -2022,7 +2016,7 @@ impl Decoder for InstDecoder { } else { // op1=0xxxxxxx, "Memory hints, Advanced SIMD instructions, and miscellaneous // instructions on pge A5-215" - inst.opcode = Opcode::Incomplete(word); + return Err(DecodeError::Incomplete); } return Ok(()); } else { @@ -3429,8 +3423,7 @@ impl Decoder for InstDecoder { // coprocessor instructions and supervisor call // page A5-213 // low bit of 0b110 or 0b111 corresponds to high bit of op1 - inst.opcode = Opcode::Incomplete(word); - return Ok(()); + return Err(DecodeError::Incomplete); }, _ => { unreachable!(); } } diff --git a/src/armv7/thumb.rs b/src/armv7/thumb.rs index 9450c13..dc2b0e9 100644 --- a/src/armv7/thumb.rs +++ b/src/armv7/thumb.rs @@ -2947,7 +2947,6 @@ pub fn decode_into>(decoder: &InstDecoder, inst: &mut I } 0b100 => { /* MOV on page A8-485 */ - let imm8 = instr2[0..8].load::(); let rd = instr2[8..11].load::(); inst.opcode = Opcode::MOV; -- cgit v1.1