aboutsummaryrefslogtreecommitdiff
path: root/test/armv8/a64.rs
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2021-10-21 15:19:09 -0700
committeriximeow <me@iximeow.net>2021-10-21 15:22:29 -0700
commit4a03599767c0ebac12e730a837abe1d15ac800e5 (patch)
tree424cb49217ac9a6799e257ed61941c9da18ea613 /test/armv8/a64.rs
parenteadc1ab0ceb5b3cd5f88b696d72b5c0592a63da5 (diff)
data processing instructions (one source)
Diffstat (limited to 'test/armv8/a64.rs')
-rw-r--r--test/armv8/a64.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/armv8/a64.rs b/test/armv8/a64.rs
index 5b480df..feb878a 100644
--- a/test/armv8/a64.rs
+++ b/test/armv8/a64.rs
@@ -295,6 +295,25 @@ fn test_decode_ccm() {
}
#[test]
+fn test_decode_data_processing_one_source() {
+ const TESTS: &[([u8; 4], &'static str)] = &[
+ ([0x14, 0x02, 0xc0, 0x5a], "rbit w20, w16"),
+ ([0x14, 0x06, 0xc0, 0x5a], "rev16 w20, w16"),
+ ([0x14, 0x12, 0xc0, 0x5a], "clz w20, w16"),
+ ([0x14, 0x12, 0xc0, 0x5a], "clz w20, w16"),
+ ([0x14, 0x16, 0xc0, 0x5a], "cls w20, w16"),
+ ([0x14, 0x16, 0xc0, 0xda], "cls x20, x16"),
+ ([0x14, 0x0a, 0xc0, 0xda], "rev32 x20, x16"),
+ ];
+
+ for (bytes, instr) in TESTS {
+ test_display(*bytes, instr);
+ }
+
+ test_err([0x14, 0x0e, 0xc0, 0x5a], DecodeError::InvalidOpcode);
+}
+
+#[test]
fn test_decode_chrome_entrypoint() {
// 1400 instructions from the entrypoint of a chrome binary, sorted by
// instruction word for no good reason.