A32/ir_emitter: Implement UpdateUpperLocationDescriptor

This commit is contained in:
MerryMage 2021-02-07 20:30:49 +00:00
parent f229a68aed
commit 62003a2d89
5 changed files with 17 additions and 0 deletions

View file

@ -770,6 +770,15 @@ void A32EmitX64::EmitA32BXWritePC(A32EmitContext& ctx, IR::Inst* inst) {
}
}
void A32EmitX64::EmitA32UpdateUpperLocationDescriptor(A32EmitContext& ctx, IR::Inst*) {
for (auto& inst : ctx.block) {
if (inst.GetOpcode() == IR::Opcode::A32BXWritePC) {
return;
}
}
EmitSetUpperLocationDescriptor(ctx.EndLocation(), ctx.Location());
}
void A32EmitX64::EmitA32CallSupervisor(A32EmitContext& ctx, IR::Inst* inst) {
ctx.reg_alloc.HostCall(nullptr);

View file

@ -121,6 +121,10 @@ void IREmitter::LoadWritePC(const IR::U32& value) {
}
}
void IREmitter::UpdateUpperLocationDescriptor() {
Inst(Opcode::A32UpdateUpperLocationDescriptor);
}
void IREmitter::CallSupervisor(const IR::U32& value) {
Inst(Opcode::A32CallSupervisor, value);
}

View file

@ -47,6 +47,7 @@ public:
void BranchWritePC(const IR::U32& value);
void BXWritePC(const IR::U32& value);
void LoadWritePC(const IR::U32& value);
void UpdateUpperLocationDescriptor();
void CallSupervisor(const IR::U32& value);
void ExceptionRaised(Exception exception);

View file

@ -155,6 +155,7 @@ bool Inst::ReadsFromCPSR() const {
case Opcode::A32GetCFlag:
case Opcode::A32GetVFlag:
case Opcode::A32GetGEFlags:
case Opcode::A32UpdateUpperLocationDescriptor:
case Opcode::A64GetCFlag:
case Opcode::A64GetNZCVRaw:
case Opcode::ConditionalSelect32:
@ -179,6 +180,7 @@ bool Inst::WritesToCPSR() const {
case Opcode::A32OrQFlag:
case Opcode::A32SetGEFlags:
case Opcode::A32SetGEFlagsCompressed:
case Opcode::A32UpdateUpperLocationDescriptor:
case Opcode::A64SetNZCVRaw:
case Opcode::A64SetNZCV:
return true;

View file

@ -31,6 +31,7 @@ A32OPC(GetGEFlags, U32,
A32OPC(SetGEFlags, Void, U32 )
A32OPC(SetGEFlagsCompressed, Void, U32 )
A32OPC(BXWritePC, Void, U32 )
A32OPC(UpdateUpperLocationDescriptor, Void, )
A32OPC(CallSupervisor, Void, U32 )
A32OPC(ExceptionRaised, Void, U32, U64 )
A32OPC(DataSynchronizationBarrier, Void, )