Deleted Added
sdiff udiff text old ( 7310:239ab4e0c7d4 ) new ( 7342:72166bc39ff8 )
full compact
1/*
2 * Copyright (c) 2010 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 122 unchanged lines hidden (view full) ---

131}
132
133MacroVFPMemOp::MacroVFPMemOp(const char *mnem, ExtMachInst machInst,
134 OpClass __opClass, IntRegIndex rn,
135 RegIndex vd, bool single, bool up,
136 bool writeback, bool load, uint32_t offset) :
137 PredMacroOp(mnem, machInst, __opClass)
138{
139 const int maxMicroops = 17;
140 microOps = new StaticInstPtr[maxMicroops];
141 int i = 0;
142
143 // The lowest order bit selects fldmx (set) or fldmd (clear). These seem
144 // to be functionally identical except that fldmx is deprecated. For now
145 // we'll assume they're otherwise interchangable.
146 int count = (single ? offset : (offset / 2));
147 if (count == 0 || count > NumFloatArchRegs)
148 warn_once("Bad offset field for VFP load/store multiple.\n");
149 if (count == 0) {
150 // Force there to be at least one microop so the macroop makes sense.
151 writeback = true;
152 }
153 if (count > NumFloatArchRegs)
154 count = NumFloatArchRegs;
155
156 uint32_t addr = 0;
157
158 if (up)
159 addr = -4 * offset;
160
161 for (int j = 0; j < count; j++) {
162 if (load) {
163 microOps[i++] = new MicroLdrFpUop(machInst, vd++, rn,
164 true, addr);
165 if (!single)
166 microOps[i++] = new MicroLdrFpUop(machInst, vd++, rn,
167 true, addr + 4);
168 } else {
169 microOps[i++] = new MicroStrFpUop(machInst, vd++, rn,
170 true, addr);
171 if (!single)
172 microOps[i++] = new MicroStrFpUop(machInst, vd++, rn,
173 true, addr + 4);
174 }
175 addr += (single ? 4 : 8);
176 }
177
178 if (writeback) {
179 if (up) {
180 microOps[i++] =
181 new MicroAddiUop(machInst, rn, rn, 4 * offset);
182 } else {
183 microOps[i++] =
184 new MicroSubiUop(machInst, rn, rn, 4 * offset);
185 }
186 }
187
188 numMicroops = i;
189 assert(numMicroops <= maxMicroops);
190 microOps[numMicroops - 1]->setLastMicroop();
191}
192
193}