A32: Implement Thumb-1's CBZ/CBNZ instructions

Introduced in ARMv6T2, this allows for short forward branches.
This commit is contained in:
Lioncash
2019-05-03 18:17:08 -04:00
committed by MerryMage
parent bd755ae494
commit 03e6899fd7
4 changed files with 32 additions and 0 deletions

View File

@@ -337,6 +337,13 @@ public:
return fmt::format("blx {}", m);
}
std::string thumb16_CBZ_CBNZ(bool nonzero, Imm<1> i, Imm<5> imm5, Reg n) {
const char* const name = nonzero ? "cbnz" : "cbz";
const u32 imm = concatenate(i, imm5, Imm<1>{0}).ZeroExtend();
return fmt::format("{} {}, #{}", name, n, imm);
}
std::string thumb16_UDF() {
return fmt::format("udf");
}