1/*
2 * Copyright (c) 2010 ARM Limited
3 * Copyright (c) 2013 Advanced Micro Devices, Inc.
4 * All rights reserved
5 *
6 * The license below extends only to copyright in the software and shall
7 * not be construed as granting a license to any other intellectual
8 * property including but not limited to intellectual property relating

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

62 public:
63 /** Typedef for the CPU. */
64 typedef typename Impl::O3CPU O3CPU;
65
66 /** Binary machine instruction type. */
67 typedef TheISA::MachInst MachInst;
68 /** Extended machine instruction type. */
69 typedef TheISA::ExtMachInst ExtMachInst;
70 /** Logical register index type. */
71 typedef TheISA::RegIndex RegIndex;
72 /** Integer register index type. */
70 /** Register types. */
71 typedef TheISA::IntReg IntReg;
72 typedef TheISA::FloatReg FloatReg;
73 typedef TheISA::FloatRegBits FloatRegBits;
74 typedef TheISA::CCReg CCReg;
75
78 /** Misc register index type. */
76 /** Misc register type. */
77 typedef TheISA::MiscReg MiscReg;
78
79 enum {
80 MaxInstSrcRegs = TheISA::MaxInstSrcRegs, //< Max source regs
81 MaxInstDestRegs = TheISA::MaxInstDestRegs //< Max dest regs
82 };
83
84 public:

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

165 _numDestMiscRegs++;
166 }
167
168 /** Reads a misc. register, including any side-effects the read
169 * might have as defined by the architecture.
170 */
171 TheISA::MiscReg readMiscRegOperand(const StaticInst *si, int idx)
172 {
175 return this->cpu->readMiscReg(
176 si->srcRegIdx(idx) - TheISA::Misc_Reg_Base,
177 this->threadNumber);
173 RegId reg = si->srcRegIdx(idx);
174 assert(reg.regClass == MiscRegClass);
175 return this->cpu->readMiscReg(reg.regIdx, this->threadNumber);
176 }
177
178 /** Sets a misc. register, including any side-effects the write
179 * might have as defined by the architecture.
180 */
181 void setMiscRegOperand(const StaticInst *si, int idx,
182 const MiscReg &val)
183 {
186 int misc_reg = si->destRegIdx(idx) - TheISA::Misc_Reg_Base;
187 setMiscReg(misc_reg, val);
184 RegId reg = si->destRegIdx(idx);
185 assert(reg.regClass == MiscRegClass);
186 setMiscReg(reg.regIdx, val);
187 }
188
189 /** Called at the commit stage to update the misc. registers. */
190 void updateMiscRegs()
191 {
192 // @todo: Pretty convoluted way to avoid squashing from happening when
193 // using the TC during an instruction's execution (specifically for
194 // instructions that have side-effects that use the TC). Fix this.

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

203 this->thread->noSquashFromTC = no_squash_from_TC;
204 }
205
206 void forwardOldRegs()
207 {
208
209 for (int idx = 0; idx < this->numDestRegs(); idx++) {
210 PhysRegIndex prev_phys_reg = this->prevDestRegIdx(idx);
212 TheISA::RegIndex original_dest_reg =
211 RegId original_dest_reg =
212 this->staticInst->destRegIdx(idx);
214 switch (regIdxToClass(original_dest_reg)) {
213 switch (original_dest_reg.regClass) {
214 case IntRegClass:
215 this->setIntRegOperand(this->staticInst.get(), idx,
216 this->cpu->readIntReg(prev_phys_reg));
217 break;
218 case FloatRegClass:
219 this->setFloatRegOperandBits(this->staticInst.get(), idx,
220 this->cpu->readFloatRegBits(prev_phys_reg));
221 break;

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

295
296 void setCCRegOperand(const StaticInst *si, int idx, CCReg val)
297 {
298 this->cpu->setCCReg(this->_destRegIdx[idx], val);
299 BaseDynInst<Impl>::setCCRegOperand(si, idx, val);
300 }
301
302#if THE_ISA == MIPS_ISA
304 MiscReg readRegOtherThread(int misc_reg, ThreadID tid)
303 MiscReg readRegOtherThread(RegId misc_reg, ThreadID tid)
304 {
305 panic("MIPS MT not defined for O3 CPU.\n");
306 return 0;
307 }
308
310 void setRegOtherThread(int misc_reg, MiscReg val, ThreadID tid)
309 void setRegOtherThread(RegId misc_reg, MiscReg val, ThreadID tid)
310 {
311 panic("MIPS MT not defined for O3 CPU.\n");
312 }
313#endif
314
315 public:
316 /** Calculates EA part of a memory instruction. Currently unused,
317 * though it may be useful in the future if we want to split

--- 19 unchanged lines hidden ---