| 188 | } |
| 189 | |
| 190 | static 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 | |
| 206 | static inline gpr do_ldr(uint8_t* rdram, gpr initial_value, gpr offset, gpr reg) { |
| 207 | // Calculate the overall address |
nothing calls this directly
no test coverage detected