mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2026-01-01 20:24:36 +01:00
thumb32: Implement ASR (register)
This commit is contained in:
parent
e06d4bcbb2
commit
abf3548b2a
3 changed files with 15 additions and 1 deletions
|
|
@ -11,6 +11,19 @@ static IR::U32 Rotate(A32::IREmitter& ir, Reg m, SignExtendRotation rotate) {
|
|||
return ir.RotateRight(ir.GetRegister(m), ir.Imm8(rotate_by), ir.Imm1(0)).result;
|
||||
}
|
||||
|
||||
bool ThumbTranslatorVisitor::thumb32_ASR_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.ArithmeticShiftRight(ir.GetRegister(m), shift_s, apsr_c);
|
||||
|
||||
ir.SetRegister(d, result_carry.result);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ThumbTranslatorVisitor::thumb32_LSL_reg(Reg m, Reg d, Reg s) {
|
||||
if (d == Reg::PC || m == Reg::PC || s == Reg::PC) {
|
||||
return UnpredictableInstruction();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue