diff --git a/src/dynarmic/backend/x64/a32_emit_x64_memory.cpp b/src/dynarmic/backend/x64/a32_emit_x64_memory.cpp index 35588758..804a114a 100644 --- a/src/dynarmic/backend/x64/a32_emit_x64_memory.cpp +++ b/src/dynarmic/backend/x64/a32_emit_x64_memory.cpp @@ -243,6 +243,7 @@ void A32EmitX64::EmitMemoryRead(A32EmitContext& ctx, IR::Inst* inst) { // Neither fastmem nor page table: Use callbacks ctx.reg_alloc.HostCall(inst, {}, args[0]); Devirtualize(conf.callbacks).EmitCall(code); + code.ZeroExtendFrom(bitsize, code.ABI_RETURN); return; } @@ -386,6 +387,7 @@ void A32EmitX64::ExclusiveReadMemory(A32EmitContext& ctx, IR::Inst* inst) { return (conf.callbacks->*callback)(vaddr); }); }); + code.ZeroExtendFrom(bitsize, code.ABI_RETURN); } template diff --git a/src/dynarmic/backend/x64/a64_emit_x64_memory.cpp b/src/dynarmic/backend/x64/a64_emit_x64_memory.cpp index d86bdf3f..29aeaf01 100644 --- a/src/dynarmic/backend/x64/a64_emit_x64_memory.cpp +++ b/src/dynarmic/backend/x64/a64_emit_x64_memory.cpp @@ -406,6 +406,7 @@ void A64EmitX64::EmitMemoryRead(A64EmitContext& ctx, IR::Inst* inst) { } else { ctx.reg_alloc.HostCall(inst, {}, args[0]); Devirtualize(conf.callbacks).EmitCall(code); + code.ZeroExtendFrom(bitsize, code.ABI_RETURN); } return; } @@ -574,6 +575,7 @@ void A64EmitX64::EmitExclusiveReadMemory(A64EmitContext& ctx, IR::Inst* inst) { return (conf.callbacks->*callback)(vaddr); }); }); + code.ZeroExtendFrom(bitsize, code.ABI_RETURN); } else { const Xbyak::Xmm result = ctx.reg_alloc.ScratchXmm(); ctx.reg_alloc.Use(args[0], ABI_PARAM2); diff --git a/src/dynarmic/backend/x64/emit_x64_sm4.cpp b/src/dynarmic/backend/x64/emit_x64_sm4.cpp index bee51a80..b084a92f 100644 --- a/src/dynarmic/backend/x64/emit_x64_sm4.cpp +++ b/src/dynarmic/backend/x64/emit_x64_sm4.cpp @@ -15,6 +15,7 @@ void EmitX64::EmitSM4AccessSubstitutionBox(EmitContext& ctx, IR::Inst* inst) { ctx.reg_alloc.HostCall(inst, args[0]); code.CallFunction(&Common::Crypto::SM4::AccessSubstitutionBox); + code.movzx(code.ABI_RETURN.cvt32(), code.ABI_RETURN.cvt8()); } } // namespace Dynarmic::Backend::X64