diff --git a/src/frontend/A32/decoder/thumb32.inc b/src/frontend/A32/decoder/thumb32.inc index da51e73e..dc0dc136 100644 --- a/src/frontend/A32/decoder/thumb32.inc +++ b/src/frontend/A32/decoder/thumb32.inc @@ -198,7 +198,7 @@ INST(thumb32_SXTH, "SXTH", "11111010000011111111dddd10rrmmmm") INST(thumb32_SXTAH, "SXTAH", "111110100000nnnn1111dddd10rrmmmm") 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_SXTAB16, "SXTAB16", "111110100010----1111----1-------") //INST(thumb32_UXTB16, "UXTB16", "11111010001111111111----1-------") diff --git a/src/frontend/A32/translate/impl/thumb32_data_processing_register.cpp b/src/frontend/A32/translate/impl/thumb32_data_processing_register.cpp index fe61f1b3..2ca195c7 100644 --- a/src/frontend/A32/translate/impl/thumb32_data_processing_register.cpp +++ b/src/frontend/A32/translate/impl/thumb32_data_processing_register.cpp @@ -48,4 +48,17 @@ bool ThumbTranslatorVisitor::thumb32_UXTH(Reg d, SignExtendRotation rotate, Reg 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 diff --git a/src/frontend/A32/translate/impl/translate_thumb.h b/src/frontend/A32/translate/impl/translate_thumb.h index d1571ecf..33792a82 100644 --- a/src/frontend/A32/translate/impl/translate_thumb.h +++ b/src/frontend/A32/translate/impl/translate_thumb.h @@ -125,6 +125,7 @@ struct ThumbTranslatorVisitor final { bool thumb32_SXTH(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_UXTAH(Reg n, Reg d, SignExtendRotation rotate, Reg m); // thumb32 long multiply, long multiply accumulate, and divide instructions bool thumb32_SDIV(Reg n, Reg d, Reg m);