Use ISA specific makeExtMI.
src/arch/alpha/utility.hh: For now makeExtMI will be specific to the ISA. --HG-- extra : convert_revision : 89959c6499efcc3df9301ad8ea039580764a1496
This commit is contained in:
parent
f763864786
commit
ccaf80cc46
5 changed files with 21 additions and 4 deletions
|
@ -43,11 +43,11 @@ namespace AlphaISA
|
||||||
{
|
{
|
||||||
|
|
||||||
static inline ExtMachInst
|
static inline ExtMachInst
|
||||||
makeExtMI(MachInst inst, ThreadContext * xc) {
|
makeExtMI(MachInst inst, Addr pc) {
|
||||||
#if FULL_SYSTEM
|
#if FULL_SYSTEM
|
||||||
ExtMachInst ext_inst = inst;
|
ExtMachInst ext_inst = inst;
|
||||||
if (xc->readPC() && 0x1)
|
if (pc && 0x1)
|
||||||
return ext_inst|=(static_cast<ExtMachInst>(xc->readPC() & 0x1) << 32);
|
return ext_inst|=(static_cast<ExtMachInst>(pc & 0x1) << 32);
|
||||||
else
|
else
|
||||||
return ext_inst;
|
return ext_inst;
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -199,8 +199,13 @@ Checker<DynInstPtr>::verify(DynInstPtr &completed_inst)
|
||||||
// Checks both the machine instruction and the PC.
|
// Checks both the machine instruction and the PC.
|
||||||
validateInst(inst);
|
validateInst(inst);
|
||||||
|
|
||||||
|
#if THE_ISA == ALPHA_ISA
|
||||||
|
curStaticInst = StaticInst::decode(makeExtMI(machInst,
|
||||||
|
thread->readPC()));
|
||||||
|
#elif THE_ISA == SPARC_ISA
|
||||||
curStaticInst = StaticInst::decode(makeExtMI(machInst,
|
curStaticInst = StaticInst::decode(makeExtMI(machInst,
|
||||||
thread->getTC()));
|
thread->getTC()));
|
||||||
|
#endif
|
||||||
|
|
||||||
#if FULL_SYSTEM
|
#if FULL_SYSTEM
|
||||||
thread->setInst(machInst);
|
thread->setInst(machInst);
|
||||||
|
|
|
@ -1117,7 +1117,11 @@ DefaultFetch<Impl>::fetch(bool &status_change)
|
||||||
inst = TheISA::gtoh(*reinterpret_cast<TheISA::MachInst *>
|
inst = TheISA::gtoh(*reinterpret_cast<TheISA::MachInst *>
|
||||||
(&cacheData[tid][offset]));
|
(&cacheData[tid][offset]));
|
||||||
|
|
||||||
ext_inst = TheISA::makeExtMI(inst, cpu->tcBase(tid));
|
#if THE_ISA == ALPHA_ISA
|
||||||
|
ext_inst = TheISA::makeExtMI(inst, fetch_PC);
|
||||||
|
#elif THE_ISA == SPARC_ISA
|
||||||
|
ext_inst = TheISA::makeExtMI(inst, cpu->thread[tid]->getTC());
|
||||||
|
#endif
|
||||||
|
|
||||||
// Create a new DynInst from the instruction fetched.
|
// Create a new DynInst from the instruction fetched.
|
||||||
DynInstPtr instruction = new DynInst(ext_inst, fetch_PC,
|
DynInstPtr instruction = new DynInst(ext_inst, fetch_PC,
|
||||||
|
|
|
@ -882,7 +882,11 @@ FrontEnd<Impl>::getInstFromCacheline()
|
||||||
// Get the instruction from the array of the cache line.
|
// Get the instruction from the array of the cache line.
|
||||||
inst = htog(*reinterpret_cast<MachInst *>(&cacheData[offset]));
|
inst = htog(*reinterpret_cast<MachInst *>(&cacheData[offset]));
|
||||||
|
|
||||||
|
#if THE_ISA == ALPHA_ISA
|
||||||
|
ExtMachInst decode_inst = TheISA::makeExtMI(inst, PC);
|
||||||
|
#elif THE_ISA == SPARC_ISA
|
||||||
ExtMachInst decode_inst = TheISA::makeExtMI(inst, tc);
|
ExtMachInst decode_inst = TheISA::makeExtMI(inst, tc);
|
||||||
|
#endif
|
||||||
|
|
||||||
// Create a new DynInst from the instruction fetched.
|
// Create a new DynInst from the instruction fetched.
|
||||||
DynInstPtr instruction = new DynInst(decode_inst, PC, PC+sizeof(MachInst),
|
DynInstPtr instruction = new DynInst(decode_inst, PC, PC+sizeof(MachInst),
|
||||||
|
|
|
@ -398,7 +398,11 @@ BaseSimpleCPU::preExecute()
|
||||||
inst = gtoh(inst);
|
inst = gtoh(inst);
|
||||||
//If we're not in the middle of a macro instruction
|
//If we're not in the middle of a macro instruction
|
||||||
if (!curMacroStaticInst) {
|
if (!curMacroStaticInst) {
|
||||||
|
#if THE_ISA == ALPHA_ISA
|
||||||
|
StaticInstPtr instPtr = StaticInst::decode(makeExtMI(inst, thread->readPC()));
|
||||||
|
#elif THE_ISA == SPARC_ISA
|
||||||
StaticInstPtr instPtr = StaticInst::decode(makeExtMI(inst, thread->getTC()));
|
StaticInstPtr instPtr = StaticInst::decode(makeExtMI(inst, thread->getTC()));
|
||||||
|
#endif
|
||||||
if (instPtr->isMacroOp()) {
|
if (instPtr->isMacroOp()) {
|
||||||
curMacroStaticInst = instPtr;
|
curMacroStaticInst = instPtr;
|
||||||
curStaticInst = curMacroStaticInst->
|
curStaticInst = curMacroStaticInst->
|
||||||
|
|
Loading…
Reference in a new issue