69a70,79
> StaticInstPtr *uop = microOps;
> StaticInstPtr wbUop;
> if (writeback) {
> if (up) {
> wbUop = new MicroAddiUop(machInst, rn, rn, ones * 4);
> } else {
> wbUop = new MicroSubiUop(machInst, rn, rn, ones * 4);
> }
> }
>
72c82
< microOps[0] = new MicroAddiUop(machInst, INTREG_UREG0, rn, 0);
---
> *uop = new MicroAddiUop(machInst, INTREG_UREG0, rn, 0);
73a84,91
> // Write back at the start for loads. This covers the ldm exception return
> // case where the base needs to be written in the old mode. Stores may need
> // the original value of the base, but they don't change mode and can
> // write back at the end like before.
> if (load && writeback) {
> *++uop = wbUop;
> }
>
78c96
< for (int i = 1; i < ones + 1; i++) {
---
> for (int i = 0; i < ones; i++) {
92,94c110,111
< microOps[i] =
< new MicroLdrRetUop(machInst, regIdx,
< INTREG_UREG0, up, addr);
---
> *++uop = new MicroLdrRetUop(machInst, regIdx,
> INTREG_UREG0, up, addr);
96,97c113,114
< microOps[i] =
< new MicroLdrUop(machInst, regIdx, INTREG_UREG0, up, addr);
---
> *++uop = new MicroLdrUop(machInst, regIdx,
> INTREG_UREG0, up, addr);
100,101c117
< microOps[i] =
< new MicroStrUop(machInst, regIdx, INTREG_UREG0, up, addr);
---
> *++uop = new MicroStrUop(machInst, regIdx, INTREG_UREG0, up, addr);
110,116c126,127
< StaticInstPtr &lastUop = microOps[numMicroops - 1];
< if (writeback) {
< if (up) {
< lastUop = new MicroAddiUop(machInst, rn, rn, ones * 4);
< } else {
< lastUop = new MicroSubiUop(machInst, rn, rn, ones * 4);
< }
---
> if (!load && writeback) {
> *++uop = wbUop;
118c129,130
< lastUop->setLastMicroop();
---
>
> (*uop)->setLastMicroop();