mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2026-02-18 22:42:58 +00:00
thumb32: Implement QSUB
This commit is contained in:
@@ -277,7 +277,7 @@ std::optional<std::reference_wrapper<const Thumb32Matcher<V>>> DecodeThumb32(u32
|
||||
// Miscellaneous Operations
|
||||
//INST(&V::thumb32_QADD, "QADD", "111110101000----1111----1000----"),
|
||||
INST(&V::thumb32_QDADD, "QDADD", "111110101000nnnn1111dddd1001mmmm"),
|
||||
//INST(&V::thumb32_QSUB, "QSUB", "111110101000----1111----1010----"),
|
||||
INST(&V::thumb32_QSUB, "QSUB", "111110101000nnnn1111dddd1010mmmm"),
|
||||
INST(&V::thumb32_QDSUB, "QDSUB", "111110101000nnnn1111dddd1011mmmm"),
|
||||
INST(&V::thumb32_REV, "REV", "111110101001nnnn1111dddd1000mmmm"),
|
||||
INST(&V::thumb32_REV16, "REV16", "111110101001nnnn1111dddd1001mmmm"),
|
||||
|
||||
@@ -51,6 +51,20 @@ bool ThumbTranslatorVisitor::thumb32_QDSUB(Reg n, Reg d, Reg m) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ThumbTranslatorVisitor::thumb32_QSUB(Reg n, Reg d, Reg m) {
|
||||
if (d == Reg::PC || n == Reg::PC || m == Reg::PC) {
|
||||
return UnpredictableInstruction();
|
||||
}
|
||||
|
||||
const auto reg_m = ir.GetRegister(m);
|
||||
const auto reg_n = ir.GetRegister(n);
|
||||
const auto result = ir.SignedSaturatedSub(reg_m, reg_n);
|
||||
|
||||
ir.SetRegister(d, result.result);
|
||||
ir.OrQFlag(result.overflow);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ThumbTranslatorVisitor::thumb32_RBIT(Reg n, Reg d, Reg m) {
|
||||
if (m != n || d == Reg::PC || m == Reg::PC) {
|
||||
return UnpredictableInstruction();
|
||||
|
||||
@@ -120,6 +120,7 @@ struct ThumbTranslatorVisitor final {
|
||||
bool thumb32_CLZ(Reg n, Reg d, Reg m);
|
||||
bool thumb32_QDADD(Reg n, Reg d, Reg m);
|
||||
bool thumb32_QDSUB(Reg n, Reg d, Reg m);
|
||||
bool thumb32_QSUB(Reg n, Reg d, Reg m);
|
||||
bool thumb32_RBIT(Reg n, Reg d, Reg m);
|
||||
bool thumb32_REV(Reg n, Reg d, Reg m);
|
||||
bool thumb32_REV16(Reg n, Reg d, Reg m);
|
||||
|
||||
Reference in New Issue
Block a user