Correct implementation of thumb16_SVC and arm_SVC
This commit is contained in:
parent
a32063fa60
commit
edb236ab07
2 changed files with 4 additions and 1 deletions
|
@ -17,8 +17,10 @@ bool ArmTranslatorVisitor::arm_SVC(Cond cond, Imm24 imm24) {
|
||||||
u32 imm32 = imm24;
|
u32 imm32 = imm24;
|
||||||
// SVC<c> #<imm24>
|
// SVC<c> #<imm24>
|
||||||
if (ConditionPassed(cond)) {
|
if (ConditionPassed(cond)) {
|
||||||
|
ir.BranchWritePC(ir.Imm32(ir.current_location.PC() + 4));
|
||||||
ir.CallSupervisor(ir.Imm32(imm32));
|
ir.CallSupervisor(ir.Imm32(imm32));
|
||||||
return LinkToNextInstruction();
|
ir.SetTerm(IR::Term::ReturnToDispatch{});
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -769,6 +769,7 @@ struct ThumbTranslatorVisitor final {
|
||||||
bool thumb16_SVC(Imm8 imm8) {
|
bool thumb16_SVC(Imm8 imm8) {
|
||||||
u32 imm32 = imm8;
|
u32 imm32 = imm8;
|
||||||
// SVC #<imm8>
|
// SVC #<imm8>
|
||||||
|
ir.BranchWritePC(ir.Imm32(ir.current_location.PC() + 2));
|
||||||
ir.CallSupervisor(ir.Imm32(imm32));
|
ir.CallSupervisor(ir.Imm32(imm32));
|
||||||
ir.SetTerm(IR::Term::ReturnToDispatch{});
|
ir.SetTerm(IR::Term::ReturnToDispatch{});
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue