aboutsummaryrefslogtreecommitdiff
path: root/src/armv7.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/armv7.rs')
-rw-r--r--src/armv7.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/armv7.rs b/src/armv7.rs
index ada486a..2901508 100644
--- a/src/armv7.rs
+++ b/src/armv7.rs
@@ -1492,6 +1492,17 @@ impl Decoder<ARMv7> for InstDecoder {
}
}
0b11 => {
+ // We know the instruction looks like this...
+ // |1 1 1 1|1 1 1|x x x x|x|x x x x|x x x x|x x x x x|x x|x|x x x x|
+ // ^ We need to check that this bit is zero, if any of the
+ // instructions decoded in this block are to match
+ // correctly.
+ // See A5-214 for the table that shows the required forms for these
+ // instructions.
+ if (op1 >> 4) & 1 != 0 {
+ return Err(DecodeError::InvalidOpcode);
+ }
+
// operands are shared between cdp2 and mcr2/mrc2, but Rt is repurposed as
// CRd
let CRm = word as u8 & 0b1111;