| 456 | |
| 457 | |
| 458 | static void ByteReversedLoad(LowLevelILFunction &il, struct cs_ppc* ppc, size_t size, size_t addressSize_a=4) |
| 459 | { |
| 460 | ExprId addr = operToIL(il, &ppc->operands[1], OTI_GPR0_ZERO, PPC_IL_EXTRA_DEFAULT, addressSize_a); // (rA|0) |
| 461 | ExprId val = il.Load(size, il.Add(addressSize_a, addr, operToIL_a(il, &ppc->operands[2], addressSize_a))); // [(rA|0) + (rB)] |
| 462 | |
| 463 | if (size < addressSize_a) |
| 464 | { |
| 465 | val = il.ZeroExtend(addressSize_a, val); |
| 466 | } |
| 467 | |
| 468 | /* set reg immediately; this will cause xrefs to be sized correctly, |
| 469 | * we'll use this as the scratch while we calculate the swapped value */ |
| 470 | il.AddInstruction(il.SetRegister(addressSize_a, ppc->operands[0].reg, val)); // rD = [(rA|0) + (rB)] |
| 471 | ExprId swap = ByteReverseRegister(il, ppc->operands[0].reg, size); |
| 472 | |
| 473 | il.AddInstruction(il.SetRegister(addressSize_a, ppc->operands[0].reg, swap)); // rD = swap([(rA|0) + (rB)]) |
| 474 | } |
| 475 | |
| 476 | static void ByteReversedStore(LowLevelILFunction &il, struct cs_ppc* ppc, size_t size, size_t addressSize_a=4) |
| 477 | { |
nothing calls this directly
no test coverage detected