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

Function do_ldl

include/recomp.h:190–204  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188}
189
190static inline gpr do_ldl(uint8_t* rdram, gpr initial_value, gpr offset, gpr reg) {
191 // Calculate the overall address
192 gpr address = (offset + reg);
193
194 // Load the aligned dword
195 gpr dword_address = address & ~0x7;
196 uint64_t loaded_value = load_doubleword(rdram, 0, dword_address);
197
198 // Mask the existing value and shift the loaded value appropriately
199 gpr misalignment = address & 0x7;
200 gpr masked_value = initial_value & ~(0xFFFFFFFFFFFFFFFFu << (misalignment * 8));
201 loaded_value <<= (misalignment * 8);
202
203 return masked_value | loaded_value;
204}
205
206static inline gpr do_ldr(uint8_t* rdram, gpr initial_value, gpr offset, gpr reg) {
207 // Calculate the overall address

Callers

nothing calls this directly

Calls 1

load_doublewordFunction · 0.85

Tested by

no test coverage detected