139,140d138
< const int maxMicroops = 17;
< microOps = new StaticInstPtr[maxMicroops];
155a154,156
> numMicroops = count * (single ? 1 : 2) + (writeback ? 1 : 0);
> microOps = new StaticInstPtr[numMicroops];
>
158,159c159,160
< if (up)
< addr = -4 * offset;
---
> if (!up)
> addr = 4 * offset;
160a162
> bool tempUp = up;
164c166
< true, addr);
---
> tempUp, addr);
167c169
< true, addr + 4);
---
> tempUp, addr + 4);
170c172
< true, addr);
---
> tempUp, addr);
173c175
< true, addr + 4);
---
> tempUp, addr + 4);
175c177,186
< addr += (single ? 4 : 8);
---
> if (!tempUp) {
> addr -= (single ? 4 : 8);
> // The microops don't handle negative displacement, so turn if we
> // hit zero, flip polarity and start adding.
> if (addr == 0) {
> tempUp = true;
> }
> } else {
> addr += (single ? 4 : 8);
> }
188,189c199
< numMicroops = i;
< assert(numMicroops <= maxMicroops);
---
> assert(numMicroops == i);