aboutsummaryrefslogtreecommitdiff
path: root/differential-tests/tests/differential-v7-thumb.rs
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2026-07-26 08:30:08 +0000
committeriximeow <me@iximeow.net>2026-07-28 07:28:15 +0000
commita421dc4262d602728c562876e67129cb2fc3a741 (patch)
treed6a6f6c390b3b9d7820faafb55d8bda63366f463 /differential-tests/tests/differential-v7-thumb.rs
parentec1d76f6adfe82ca822534c487dd9f0db5ebc573 (diff)
capstone prints thumb add/sub sp+immediate as two operands
Diffstat (limited to 'differential-tests/tests/differential-v7-thumb.rs')
-rw-r--r--differential-tests/tests/differential-v7-thumb.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/differential-tests/tests/differential-v7-thumb.rs b/differential-tests/tests/differential-v7-thumb.rs
index aff45cb..835604e 100644
--- a/differential-tests/tests/differential-v7-thumb.rs
+++ b/differential-tests/tests/differential-v7-thumb.rs
@@ -528,6 +528,31 @@ fn capstone_differential_thumb() {
return true;
}
}
+
+ // capstone prints the T2 encoding of `ADD (SP plus immediate)` with
+ // two operands instead of the three from the manual.
+ if word & 0xff80 == 0xb000 &&
+ parsed_yax.opcode == "add" &&
+ parsed_cs.opcode == "add" &&
+ parsed_yax.operands[0] == parsed_cs.operands[0] &&
+ parsed_yax.operands[0] == parsed_yax.operands[1] &&
+ parsed_cs.operands[1] == parsed_yax.operands[2] {
+ return true;
+ }
+ }
+
+ if (parsed_yax.opcode == "sub" &&
+ parsed_cs.opcode == "sub") {
+ // capstone prints the T1 encoding of `SUB (SP minus immediate)` with
+ // two operands instead of the three from the manual.
+ if word & 0xff80 == 0xb080 &&
+ parsed_yax.opcode == "sub" &&
+ parsed_cs.opcode == "sub" &&
+ parsed_yax.operands[0] == parsed_cs.operands[0] &&
+ parsed_yax.operands[0] == parsed_yax.operands[1] &&
+ parsed_cs.operands[1] == parsed_yax.operands[2] {
+ return true;
+ }
}
// TODO: yaxpeax-arm doesn't know about armv8-m yet, which gets `bxns` to