/*
* Copyright (c) 2011 ARM Limited
+ * Copyright (c) 2013 Advanced Micro Devices, Inc.
* All rights reserved
*
* The license below extends only to copyright in the software and shall
#include "config/the_isa.hh"
#include "cpu/base_dyn_inst.hh"
#include "cpu/exetrace.hh"
+#include "cpu/reg_class.hh"
#include "cpu/simple_thread.hh"
#include "cpu/static_inst.hh"
#include "cpu/thread_context.hh"
StaticInstPtr instPtr = NULL;
//Predecode, ie bundle up an ExtMachInst
- thread->decoder.setTC(thread->getTC());
//If more fetch data is needed, pass it in.
Addr fetchPC = (pcState.instAddr() & PCMask) + fetchOffset;
thread->decoder.moreBytes(pcState, fetchPC, machInst);
"registers from main CPU", curTick(), unverifiedInst->instAddr());
// Terribly convoluted way to make sure O3 model does not implode
- bool inSyscall = unverifiedInst->thread->inSyscall;
- unverifiedInst->thread->inSyscall = true;
+ bool no_squash_from_TC = unverifiedInst->thread->noSquashFromTC;
+ unverifiedInst->thread->noSquashFromTC = true;
// Heavy-weight copying of all registers
thread->copyArchRegs(unverifiedInst->tcBase());
- unverifiedInst->thread->inSyscall = inSyscall;
+ unverifiedInst->thread->noSquashFromTC = no_squash_from_TC;
// Set curStaticInst to unverifiedInst->staticInst
curStaticInst = unverifiedInst->staticInst;
// so do the fix-up then start with the next dest reg;
if (start_idx >= 0) {
RegIndex idx = inst->destRegIdx(start_idx);
- if (idx < TheISA::FP_Base_DepTag) {
+ switch (regIdxToClass(idx)) {
+ case IntRegClass:
thread->setIntReg(idx, mismatch_val);
- } else if (idx < TheISA::Ctrl_Base_DepTag) {
+ break;
+ case FloatRegClass:
thread->setFloatRegBits(idx, mismatch_val);
- } else if (idx < TheISA::Max_DepTag) {
- thread->setMiscReg(idx - TheISA::Ctrl_Base_DepTag,
+ break;
+ case CCRegClass:
+ thread->setCCReg(idx, mismatch_val);
+ break;
+ case MiscRegClass:
+ thread->setMiscReg(idx - TheISA::Misc_Reg_Base,
mismatch_val);
+ break;
}
}
start_idx++;
for (int i = start_idx; i < inst->numDestRegs(); i++) {
RegIndex idx = inst->destRegIdx(i);
inst->template popResult<uint64_t>(res);
- if (idx < TheISA::FP_Base_DepTag) {
+ switch (regIdxToClass(idx)) {
+ case IntRegClass:
thread->setIntReg(idx, res);
- } else if (idx < TheISA::Ctrl_Base_DepTag) {
+ break;
+ case FloatRegClass:
thread->setFloatRegBits(idx, res);
- } else if (idx < TheISA::Max_DepTag) {
+ break;
+ case CCRegClass:
+ thread->setCCReg(idx, res);
+ break;
+ case MiscRegClass:
// Try to get the proper misc register index for ARM here...
- thread->setMiscReg(idx - TheISA::Ctrl_Base_DepTag, res);
- } // else Register is out of range...
+ thread->setMiscReg(idx - TheISA::Misc_Reg_Base, res);
+ break;
+ // else Register is out of range...
+ }
}
}