thumb32: Implement UXTAH

This commit is contained in:
Lioncash 2021-02-10 16:09:37 -05:00
parent e12ee8d4d7
commit 39a75472e2
3 changed files with 15 additions and 1 deletions

View file

@ -198,7 +198,7 @@
INST(thumb32_SXTH, "SXTH", "11111010000011111111dddd10rrmmmm") INST(thumb32_SXTH, "SXTH", "11111010000011111111dddd10rrmmmm")
INST(thumb32_SXTAH, "SXTAH", "111110100000nnnn1111dddd10rrmmmm") INST(thumb32_SXTAH, "SXTAH", "111110100000nnnn1111dddd10rrmmmm")
INST(thumb32_UXTH, "UXTH", "11111010000111111111dddd10rrmmmm") INST(thumb32_UXTH, "UXTH", "11111010000111111111dddd10rrmmmm")
//INST(thumb32_UXTAH, "UXTAH", "111110100001----1111----1-------") INST(thumb32_UXTAH, "UXTAH", "111110100001nnnn1111dddd10rrmmmm")
//INST(thumb32_SXTB16, "SXTB16", "11111010001011111111----1-------") //INST(thumb32_SXTB16, "SXTB16", "11111010001011111111----1-------")
//INST(thumb32_SXTAB16, "SXTAB16", "111110100010----1111----1-------") //INST(thumb32_SXTAB16, "SXTAB16", "111110100010----1111----1-------")
//INST(thumb32_UXTB16, "UXTB16", "11111010001111111111----1-------") //INST(thumb32_UXTB16, "UXTB16", "11111010001111111111----1-------")

View file

@ -48,4 +48,17 @@ bool ThumbTranslatorVisitor::thumb32_UXTH(Reg d, SignExtendRotation rotate, Reg
return true; return true;
} }
bool ThumbTranslatorVisitor::thumb32_UXTAH(Reg n, Reg d, SignExtendRotation rotate, Reg m) {
if (d == Reg::PC || m == Reg::PC) {
return UnpredictableInstruction();
}
const auto rotated = Rotate(ir, m, rotate);
const auto reg_n = ir.GetRegister(n);
const auto result = ir.Add(reg_n, ir.ZeroExtendHalfToWord(ir.LeastSignificantHalf(rotated)));
ir.SetRegister(d, result);
return true;
}
} // namespace Dynarmic::A32 } // namespace Dynarmic::A32

View file

@ -125,6 +125,7 @@ struct ThumbTranslatorVisitor final {
bool thumb32_SXTH(Reg d, SignExtendRotation rotate, Reg m); bool thumb32_SXTH(Reg d, SignExtendRotation rotate, Reg m);
bool thumb32_SXTAH(Reg n, Reg d, SignExtendRotation rotate, Reg m); bool thumb32_SXTAH(Reg n, Reg d, SignExtendRotation rotate, Reg m);
bool thumb32_UXTH(Reg d, SignExtendRotation rotate, Reg m); bool thumb32_UXTH(Reg d, SignExtendRotation rotate, Reg m);
bool thumb32_UXTAH(Reg n, Reg d, SignExtendRotation rotate, Reg m);
// thumb32 long multiply, long multiply accumulate, and divide instructions // thumb32 long multiply, long multiply accumulate, and divide instructions
bool thumb32_SDIV(Reg n, Reg d, Reg m); bool thumb32_SDIV(Reg n, Reg d, Reg m);