mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2026-01-05 05:58:19 +01:00
thumb32: Implement QADD
This commit is contained in:
parent
cd6e4c7afd
commit
36fc596a51
4 changed files with 23 additions and 1 deletions
|
|
@ -275,7 +275,7 @@ std::optional<std::reference_wrapper<const Thumb32Matcher<V>>> DecodeThumb32(u32
|
|||
//INST(&V::thumb32_UHSUB8, "UHSUB8", "111110101100----1111----0110----"),
|
||||
|
||||
// Miscellaneous Operations
|
||||
//INST(&V::thumb32_QADD, "QADD", "111110101000----1111----1000----"),
|
||||
INST(&V::thumb32_QADD, "QADD", "111110101000nnnn1111dddd1000mmmm"),
|
||||
INST(&V::thumb32_QDADD, "QDADD", "111110101000nnnn1111dddd1001mmmm"),
|
||||
INST(&V::thumb32_QSUB, "QSUB", "111110101000nnnn1111dddd1010mmmm"),
|
||||
INST(&V::thumb32_QDSUB, "QDSUB", "111110101000nnnn1111dddd1011mmmm"),
|
||||
|
|
|
|||
|
|
@ -19,6 +19,20 @@ bool ThumbTranslatorVisitor::thumb32_CLZ(Reg n, Reg d, Reg m) {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool ThumbTranslatorVisitor::thumb32_QADD(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.SignedSaturatedAdd(reg_m, reg_n);
|
||||
|
||||
ir.SetRegister(d, result.result);
|
||||
ir.OrQFlag(result.overflow);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ThumbTranslatorVisitor::thumb32_QDADD(Reg n, Reg d, Reg m) {
|
||||
if (d == Reg::PC || n == Reg::PC || m == Reg::PC) {
|
||||
return UnpredictableInstruction();
|
||||
|
|
|
|||
|
|
@ -118,6 +118,7 @@ struct ThumbTranslatorVisitor final {
|
|||
|
||||
// thumb32 miscellaneous instructions
|
||||
bool thumb32_CLZ(Reg n, Reg d, Reg m);
|
||||
bool thumb32_QADD(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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue