| 158 | } |
| 159 | |
| 160 | static inline void do_swl(uint8_t* rdram, gpr offset, gpr reg, gpr val) { |
| 161 | // Calculate the overall address |
| 162 | gpr address = (offset + reg); |
| 163 | |
| 164 | // Get the initial value of the aligned word |
| 165 | gpr word_address = address & ~0x3; |
| 166 | uint32_t initial_value = MEM_W(0, word_address); |
| 167 | |
| 168 | // Mask the initial value and shift the input value appropriately |
| 169 | gpr misalignment = address & 0x3; |
| 170 | uint32_t masked_initial_value = initial_value & ~(0xFFFFFFFFu >> (misalignment * 8)); |
| 171 | uint32_t shifted_input_value = ((uint32_t)val) >> (misalignment * 8); |
| 172 | MEM_W(0, word_address) = masked_initial_value | shifted_input_value; |
| 173 | } |
| 174 | |
| 175 | static inline void do_swr(uint8_t* rdram, gpr offset, gpr reg, gpr val) { |
| 176 | // Calculate the overall address |
nothing calls this directly
no outgoing calls
no test coverage detected