thumb32: Implement ROR (register)

This commit is contained in:
Lioncash 2021-02-23 04:46:06 -05:00
parent abf3548b2a
commit a7a9ed69b7
3 changed files with 15 additions and 1 deletions

View file

@ -50,6 +50,19 @@ bool ThumbTranslatorVisitor::thumb32_LSR_reg(Reg m, Reg d, Reg s) {
return true;
}
bool ThumbTranslatorVisitor::thumb32_ROR_reg(Reg m, Reg d, Reg s) {
if (d == Reg::PC || m == Reg::PC || s == Reg::PC) {
return UnpredictableInstruction();
}
const auto shift_s = ir.LeastSignificantByte(ir.GetRegister(s));
const auto apsr_c = ir.GetCFlag();
const auto result_carry = ir.RotateRight(ir.GetRegister(m), shift_s, apsr_c);
ir.SetRegister(d, result_carry.result);
return true;
}
bool ThumbTranslatorVisitor::thumb32_SXTB(Reg d, SignExtendRotation rotate, Reg m) {
if (d == Reg::PC || m == Reg::PC) {
return UnpredictableInstruction();