diff options
author | Merry <[email protected]> | 2022-07-17 22:36:34 +0100 |
---|---|---|
committer | Merry <[email protected]> | 2022-07-17 22:42:56 +0100 |
commit | 51a89dbb7a20407878092e74a58e1ac2e8a8548f (patch) | |
tree | c1b043e2ed0d83e5a274dde106aa8df308738178 | |
parent | 786161b416a80d3fd52f9f6c6684322aef015c4f (diff) | |
download | dynarmic-51a89dbb7a20407878092e74a58e1ac2e8a8548f.tar.gz dynarmic-51a89dbb7a20407878092e74a58e1ac2e8a8548f.zip |
A64CallbackConfigPass: Ensure IR instructions emitted by this pass have correct location descriptors attached
-rw-r--r-- | src/dynarmic/backend/x64/a64_emit_x64.cpp | 2 | ||||
-rw-r--r-- | src/dynarmic/frontend/A64/a64_ir_emitter.cpp | 2 | ||||
-rw-r--r-- | src/dynarmic/ir/opcodes.inc | 2 | ||||
-rw-r--r-- | src/dynarmic/ir/opt/a64_callback_config_pass.cpp | 5 |
4 files changed, 6 insertions, 5 deletions
diff --git a/src/dynarmic/backend/x64/a64_emit_x64.cpp b/src/dynarmic/backend/x64/a64_emit_x64.cpp index 97472cf6..7cc4e140 100644 --- a/src/dynarmic/backend/x64/a64_emit_x64.cpp +++ b/src/dynarmic/backend/x64/a64_emit_x64.cpp @@ -508,7 +508,7 @@ void A64EmitX64::EmitA64ExceptionRaised(A64EmitContext& ctx, IR::Inst* inst) { void A64EmitX64::EmitA64DataCacheOperationRaised(A64EmitContext& ctx, IR::Inst* inst) { auto args = ctx.reg_alloc.GetArgumentInfo(inst); - ctx.reg_alloc.HostCall(nullptr, {}, args[0], args[1]); + ctx.reg_alloc.HostCall(nullptr, {}, args[1], args[2]); Devirtualize<&A64::UserCallbacks::DataCacheOperationRaised>(conf.callbacks).EmitCall(code); } diff --git a/src/dynarmic/frontend/A64/a64_ir_emitter.cpp b/src/dynarmic/frontend/A64/a64_ir_emitter.cpp index cc471289..80d7e007 100644 --- a/src/dynarmic/frontend/A64/a64_ir_emitter.cpp +++ b/src/dynarmic/frontend/A64/a64_ir_emitter.cpp @@ -55,7 +55,7 @@ void IREmitter::ExceptionRaised(Exception exception) { } void IREmitter::DataCacheOperationRaised(DataCacheOperation op, const IR::U64& value) { - Inst(Opcode::A64DataCacheOperationRaised, Imm64(static_cast<u64>(op)), value); + Inst(Opcode::A64DataCacheOperationRaised, ImmCurrentLocationDescriptor(), Imm64(static_cast<u64>(op)), value); } void IREmitter::InstructionCacheOperationRaised(InstructionCacheOperation op, const IR::U64& value) { diff --git a/src/dynarmic/ir/opcodes.inc b/src/dynarmic/ir/opcodes.inc index 7642d1fc..791c29a5 100644 --- a/src/dynarmic/ir/opcodes.inc +++ b/src/dynarmic/ir/opcodes.inc @@ -69,7 +69,7 @@ A64OPC(OrQC, Void, U1 A64OPC(SetPC, Void, U64 ) A64OPC(CallSupervisor, Void, U32 ) A64OPC(ExceptionRaised, Void, U64, U64 ) -A64OPC(DataCacheOperationRaised, Void, U64, U64 ) +A64OPC(DataCacheOperationRaised, Void, U64, U64, U64 ) A64OPC(InstructionCacheOperationRaised, Void, U64, U64 ) A64OPC(DataSynchronizationBarrier, Void, ) A64OPC(DataMemoryBarrier, Void, ) diff --git a/src/dynarmic/ir/opt/a64_callback_config_pass.cpp b/src/dynarmic/ir/opt/a64_callback_config_pass.cpp index f9037071..1e0195c4 100644 --- a/src/dynarmic/ir/opt/a64_callback_config_pass.cpp +++ b/src/dynarmic/ir/opt/a64_callback_config_pass.cpp @@ -22,13 +22,14 @@ void A64CallbackConfigPass(IR::Block& block, const A64::UserConfig& conf) { continue; } - const auto op = static_cast<A64::DataCacheOperation>(inst.GetArg(0).GetU64()); + const auto op = static_cast<A64::DataCacheOperation>(inst.GetArg(1).GetU64()); if (op == A64::DataCacheOperation::ZeroByVA) { A64::IREmitter ir{block}; + ir.current_location = A64::LocationDescriptor{IR::LocationDescriptor{inst.GetArg(0).GetU64()}}; ir.SetInsertionPoint(&inst); size_t bytes = 4 << static_cast<size_t>(conf.dczid_el0 & 0b1111); - IR::U64 addr{inst.GetArg(1)}; + IR::U64 addr{inst.GetArg(2)}; const IR::U128 zero_u128 = ir.ZeroExtendToQuad(ir.Imm64(0)); while (bytes >= 16) { |