aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2020-12-06 11:36:52 -0800
committeriximeow <me@iximeow.net>2020-12-06 11:58:57 -0800
commitf483afc2654391962a821ae41f4a50b484ad9bae (patch)
tree3ab3d41c1975552b3231225569c6f5bf554a2c7b /src
parent9e919c5cccf3b72498505043a93e08b428c356f3 (diff)
remove "Incomplete" opcode from arm7 non-thumb decoder
Diffstat (limited to 'src')
-rw-r--r--src/armv7.rs11
-rw-r--r--src/armv7/thumb.rs1
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 <T: fmt::Write, Color: fmt::Display, Y: YaxColors<Color>> ShowContextual<u3
_ => { 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 <T: fmt::Write, Color: fmt::Display, Y: YaxColors<Color>> ShowContextual<u3
impl <T: fmt::Write, Color: fmt::Display, Y: YaxColors<Color>> Colorize<T, Color, Y> 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<Instruction> 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<Instruction> 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<T: IntoIterator<Item=u8>>(decoder: &InstDecoder, inst: &mut I
}
0b100 => {
/* MOV on page A8-485 */
-
let imm8 = instr2[0..8].load::<u32>();
let rd = instr2[8..11].load::<u8>();
inst.opcode = Opcode::MOV;