| 4267 | } |
| 4268 | |
| 4269 | Ref OpDispatchBuilder::LoadGPRRegister(uint32_t GPR, IR::OpSize Size, uint8_t Offset, bool AllowUpperGarbage) { |
| 4270 | const auto GPRSize = GetGPROpSize(); |
| 4271 | if (Size == OpSize::iInvalid) { |
| 4272 | Size = GPRSize; |
| 4273 | } |
| 4274 | Ref Reg = LoadGPR(GPR); |
| 4275 | |
| 4276 | if ((!AllowUpperGarbage && (Size != GPRSize)) || Offset != 0) { |
| 4277 | // Extract the subregister if requested. |
| 4278 | const auto OpSize = std::max(OpSize::i32Bit, Size); |
| 4279 | if (AllowUpperGarbage) { |
| 4280 | Reg = _Lshr(OpSize, Reg, Constant(Offset)); |
| 4281 | } else { |
| 4282 | Reg = _Bfe(OpSize, IR::OpSizeAsBits(Size), Offset, Reg); |
| 4283 | } |
| 4284 | } |
| 4285 | return Reg; |
| 4286 | } |
| 4287 | |
| 4288 | void OpDispatchBuilder::StoreGPRRegister(uint32_t GPR, const Ref Src, IR::OpSize Size, uint8_t Offset) { |
| 4289 | const auto GPRSize = GetGPROpSize(); |
nothing calls this directly
no test coverage detected