aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/armv8/a64.rs6
-rw-r--r--test/armv8/a64.rs16
2 files changed, 19 insertions, 3 deletions
diff --git a/src/armv8/a64.rs b/src/armv8/a64.rs
index abe0cae..b698f6c 100644
--- a/src/armv8/a64.rs
+++ b/src/armv8/a64.rs
@@ -4138,11 +4138,11 @@ impl Decoder<ARMv8> for InstDecoder {
}
}
} else {
- if op3 & 0b000100001 == 0b000000001 && op0 & 0b1011 == 0b0010 {
+ if op3 & 0b000100001 == 0b000000000 && op0 & 0b1011 == 0b0010 {
// `Advanced SIMD extract`
let Rd = (word >> 0) & 0b11111;
- let Rn = (word >> 6) & 0b11111;
- let imm4 = (word >> 11) & 0b111;
+ let Rn = (word >> 5) & 0b11111;
+ let imm4 = (word >> 11) & 0b1111;
let Rm = (word >> 16) & 0b11111;
let op2 = (word >> 22) & 0b11;
let Q = (word >> 30) & 1 == 1;
diff --git a/test/armv8/a64.rs b/test/armv8/a64.rs
index eb88da2..6f43c22 100644
--- a/test/armv8/a64.rs
+++ b/test/armv8/a64.rs
@@ -4267,3 +4267,19 @@ fn test_fabd_general() {
assert!(errs.is_empty());
}
+
+#[test]
+fn test_ext() {
+ const TESTS: &[([u8; 4], &'static str)] = &[
+ ([0xa5, 0x40, 0x05, 0x6e], "ext v5.16b, v5.16b, v5.16b, 0x8"),
+ ([0xc7, 0x40, 0x06, 0x6e], "ext v7.16b, v6.16b, v6.16b, 0x8"),
+ ([0xc7, 0x20, 0x06, 0x2e], "ext v7.8b, v6.8b, v6.8b, 0x4"),
+ ];
+ let errs = run_tests(TESTS);
+
+ for err in errs.iter() {
+ println!("{}", err);
+ }
+
+ assert!(errs.is_empty());
+}