| 173 | } |
| 174 | |
| 175 | static inline void do_swr(uint8_t* rdram, gpr offset, gpr reg, gpr val) { |
| 176 | // Calculate the overall address |
| 177 | gpr address = (offset + reg); |
| 178 | |
| 179 | // Get the initial value of the aligned word |
| 180 | gpr word_address = address & ~0x3; |
| 181 | uint32_t initial_value = MEM_W(0, word_address); |
| 182 | |
| 183 | // Mask the initial value and shift the input value appropriately |
| 184 | gpr misalignment = address & 0x3; |
| 185 | uint32_t masked_initial_value = initial_value & ~(0xFFFFFFFFu << (24 - misalignment * 8)); |
| 186 | uint32_t shifted_input_value = ((uint32_t)val) << (24 - misalignment * 8); |
| 187 | MEM_W(0, word_address) = masked_initial_value | shifted_input_value; |
| 188 | } |
| 189 | |
| 190 | static inline gpr do_ldl(uint8_t* rdram, gpr initial_value, gpr offset, gpr reg) { |
| 191 | // Calculate the overall address |
nothing calls this directly
no outgoing calls
no test coverage detected