MCPcopy Create free account
hub / github.com/N64Recomp/N64Recomp / emit_cop0_status_read

Method emit_cop0_status_read

LiveRecomp/live_generator.cpp:1694–1706  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1692}
1693
1694void N64Recomp::LiveGenerator::emit_cop0_status_read(int reg) const {
1695 // Skip the read if the target is the zero register.
1696 if (reg != 0) {
1697 // Load ctx into R0.
1698 sljit_emit_op1(compiler, SLJIT_MOV, SLJIT_R0, 0, Registers::ctx, 0);
1699
1700 // Call cop0_status_read.
1701 sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_ARGS1V(P), SLJIT_IMM, sljit_sw(inputs.cop0_status_read));
1702
1703 // Store the result in the output register.
1704 sljit_emit_op1(compiler, SLJIT_MOV, SLJIT_MEM1(Registers::ctx), get_gpr_context_offset(reg), SLJIT_R0, 0);
1705 }
1706}
1707
1708void N64Recomp::LiveGenerator::emit_cop0_status_write(int reg) const {
1709 sljit_sw src;

Callers

nothing calls this directly

Calls 1

get_gpr_context_offsetFunction · 0.85

Tested by

no test coverage detected