ARM: Implemented UXTB16. (#42)

It passes tests.
This commit is contained in:
Sebastian Valle 2016-11-24 03:21:12 -05:00 committed by Merry
parent 32615d0eff
commit f32921d493

View file

@ -121,7 +121,16 @@ bool ArmTranslatorVisitor::arm_UXTB(Cond cond, Reg d, SignExtendRotation rotate,
}
bool ArmTranslatorVisitor::arm_UXTB16(Cond cond, Reg d, SignExtendRotation rotate, Reg m) {
return InterpretThisInstruction();
if (d == Reg::PC || m == Reg::PC)
return UnpredictableInstruction();
if (ConditionPassed(cond)) {
auto rotated = SignZeroExtendRor(m, rotate);
auto lower_half = ir.ZeroExtendByteToWord(ir.LeastSignificantByte(rotated));
auto upper_half = ir.And(rotated, ir.Imm32(0x00FF0000));
auto result = ir.Or(lower_half, upper_half);
ir.SetRegister(d, result);
}
return true;
}
bool ArmTranslatorVisitor::arm_UXTH(Cond cond, Reg d, SignExtendRotation rotate, Reg m) {