| 204 | } |
| 205 | |
| 206 | static inline gpr do_ldr(uint8_t* rdram, gpr initial_value, gpr offset, gpr reg) { |
| 207 | // Calculate the overall address |
| 208 | gpr address = (offset + reg); |
| 209 | |
| 210 | // Load the aligned dword |
| 211 | gpr dword_address = address & ~0x7; |
| 212 | uint64_t loaded_value = load_doubleword(rdram, 0, dword_address); |
| 213 | |
| 214 | // Mask the existing value and shift the loaded value appropriately |
| 215 | gpr misalignment = address & 0x7; |
| 216 | gpr masked_value = initial_value & ~(0xFFFFFFFFFFFFFFFFu >> (56 - misalignment * 8)); |
| 217 | loaded_value >>= (56 - misalignment * 8); |
| 218 | |
| 219 | return masked_value | loaded_value; |
| 220 | } |
| 221 | |
| 222 | static inline void do_sdl(uint8_t* rdram, gpr offset, gpr reg, gpr val) { |
| 223 | // Calculate the overall address |
nothing calls this directly
no test coverage detected