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

Function get_fpr_u32l_context_offset

LiveRecomp/live_generator.cpp:249–263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

247}
248
249constexpr void get_fpr_u32l_context_offset(int fpr_index, sljit_compiler* compiler, int odd_float_address_register, sljit_sw& out, sljit_sw& outw) {
250 if (fpr_index & 1) {
251 assert(compiler != nullptr);
252 // Load ctx->f_odd into the address register.
253 sljit_emit_op1(compiler, SLJIT_MOV_P, odd_float_address_register, 0, SLJIT_MEM1(Registers::ctx), offsetof(recomp_context, f_odd));
254 // sljit_emit_op0(compiler, SLJIT_BREAKPOINT);
255 out = SLJIT_MEM1(odd_float_address_register);
256 // Set a memory offset of ((fpr_index - 1) * 2) * sizeof(*f_odd).
257 outw = ((fpr_index - 1) * 2) * sizeof(*recomp_context::f_odd);
258 }
259 else {
260 out = SLJIT_MEM1(Registers::ctx);
261 outw = offsetof(recomp_context, f0.u32l) + sizeof(recomp_context::f0) * fpr_index;
262 }
263}
264
265constexpr int get_fpr_u64_context_offset(int fpr_index) {
266 return offsetof(recomp_context, f0.u64) + sizeof(recomp_context::f0) * fpr_index;

Callers 1

get_operand_valuesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected