From 88db0bb355e14ba58658026df7708e62696978b2 Mon Sep 17 00:00:00 2001 From: Grond Date: Wed, 24 Jun 2026 18:19:33 -0700 Subject: Simplify decoding of register-shifted-register data-processing instructions Previously, immediate-shifted-register and register-shifted-register data-processing instructions were decoded using separate decoding paths, which caused extra complexity. These two forms differ only in the interpretation of their shifting constructs, which is already handled through the `RegShift` type. This change also fixes instructions like `cmp r0, r1, lsl r2` from being decoded with an extra operand. --- tests/armv7/mod.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests/armv7') diff --git a/tests/armv7/mod.rs b/tests/armv7/mod.rs index 58f7e0c..78d725b 100644 --- a/tests/armv7/mod.rs +++ b/tests/armv7/mod.rs @@ -740,8 +740,10 @@ fn test_cmp_immediate_decode() { fn test_cmp_register_decode() { test_all([0x01, 0x00, 0x52, 0xe1], "cmps r2, r1"); test_all([0x01, 0x03, 0x52, 0xe1], "cmps r2, r1, lsl 6"); + test_all([0x11, 0x03, 0x52, 0xe1], "cmps r2, r1, lsl r3"); test_all([0x01, 0x00, 0x72, 0xe1], "cmns r2, r1"); test_all([0x01, 0x03, 0x72, 0xe1], "cmns r2, r1, lsl 6"); + test_all([0x11, 0x03, 0x72, 0xe1], "cmns r2, r1, lsl r3"); } static INSTRUCTION_BYTES: [u8; 4 * 60] = [ -- cgit v1.1