Skip to content
This repository has been archived by the owner on Jul 10, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1797 from reicast/skmp/fix-imm-readms
Browse files Browse the repository at this point in the history
JIT: Correctly pass context to immm reads that become static calls
  • Loading branch information
skmp committed Feb 11, 2020
2 parents 67019c6 + a424ce3 commit 34390bf
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion libswirl/jit/backend/arm32/rec_arm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,8 @@ void ngen_compile_opcode(RuntimeBlockInfo* block, shil_opcode* op, bool staging,
}
else
{
MOV32(r0,op->rs1._imm);
MOV32(r0, (uintptr_t)sh4_cpu);
MOV32(r1,op->rs1._imm);

switch(optp)
{
Expand Down
3 changes: 2 additions & 1 deletion libswirl/jit/backend/arm64/rec_arm64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,8 @@ class Arm64Assembler : public MacroAssembler
else
{
// Not RAM
Mov(w0, op.rs1._imm);
Mov(x0, (uintptr_t)sh4_cpu);
Mov(w1, op.rs1._imm);

switch(size)
{
Expand Down
3 changes: 2 additions & 1 deletion libswirl/jit/backend/x64/rec_x64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,8 @@ class BlockCompiler : public Xbyak::CodeGenerator
else
{
// Not RAM: the returned pointer is a memory handler
mov(call_regs[0], op.rs1._imm);
mov(call_regs[0].cvt64(), (uintptr_t)sh4_cpu);
mov(call_regs[1], op.rs1._imm);

switch(size) {
case 2:
Expand Down
3 changes: 2 additions & 1 deletion libswirl/jit/backend/x86/rec_x86_il.inl
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,8 @@ void ngen_opcode(RuntimeBlockInfo* block, shil_opcode* op,x86_block* x86e, bool
#ifdef PROF2
x86e->Emit(op_add32,&srmls,1);
#endif
x86e->Emit(op_mov32,ECX,op->rs1._imm);
x86e->Emit(op_mov32,ECX, (uintptr_t)(sh4_cpu));
x86e->Emit(op_mov32,EDX,op->rs1._imm);
fuct=ptr;
}
}
Expand Down

0 comments on commit 34390bf

Please sign in to comment.