cpu/{arm|thumb}(chore): change how branch disassembly happens

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
This commit is contained in:
2024-06-11 23:03:44 +05:30
parent 0062ad424b
commit 15c4802838
10 changed files with 38 additions and 33 deletions

View File

@@ -412,7 +412,8 @@ TEST_CASE("Conditional Branch", TAG) {
CHECK(b->condition == Condition::LS);
#ifdef DISASSEMBLER
// (-76 << 1) + PC (0) + 4
// take prefetch into account
// offset + 4 = -152 + 4
CHECK(instruction.disassemble() == "BLS #-148");
#endif
}
@@ -439,7 +440,8 @@ TEST_CASE("Unconditional Branch") {
REQUIRE(b->offset == -410);
#ifdef DISASSEMBLER
// (2147483443 << 1) + PC(0) + 4
// take prefetch into account
// offset + 4 = -410 + 4
CHECK(instruction.disassemble() == "B #-406");
#endif
}