Use ISA specific makeExtMI.
authorKevin Lim <ktlim@umich.edu>
Thu, 2 Nov 2006 18:11:38 +0000 (13:11 -0500)
committerKevin Lim <ktlim@umich.edu>
Thu, 2 Nov 2006 18:11:38 +0000 (13:11 -0500)
src/arch/alpha/utility.hh:
    For now makeExtMI will be specific to the ISA.

--HG--
extra : convert_revision : 89959c6499efcc3df9301ad8ea039580764a1496

src/arch/alpha/utility.hh
src/cpu/checker/cpu_impl.hh
src/cpu/o3/fetch_impl.hh
src/cpu/ozone/front_end_impl.hh
src/cpu/simple/base.cc

index 0304d1c3a382718a0f98b0c0cf55bb869bb57aa8..cb86c7e9eb14164ab66731cec3ec75f781544352 100644 (file)
@@ -43,11 +43,11 @@ namespace AlphaISA
 {
 
     static inline ExtMachInst
-    makeExtMI(MachInst inst, ThreadContext * xc) {
+    makeExtMI(MachInst inst, Addr pc) {
 #if FULL_SYSTEM
         ExtMachInst ext_inst = inst;
-        if (xc->readPC() && 0x1)
-            return ext_inst|=(static_cast<ExtMachInst>(xc->readPC() & 0x1) << 32);
+        if (pc && 0x1)
+            return ext_inst|=(static_cast<ExtMachInst>(pc & 0x1) << 32);
         else
             return ext_inst;
 #else
index 36c7349e6ee14568b90c8045ce430ae48d8d5fc6..56e13dd1ec6f482b7d0c798766bd425cb3db21ae 100644 (file)
@@ -199,8 +199,13 @@ Checker<DynInstPtr>::verify(DynInstPtr &completed_inst)
             // Checks both the machine instruction and the PC.
             validateInst(inst);
 
+#if THE_ISA == ALPHA_ISA
+            curStaticInst = StaticInst::decode(makeExtMI(machInst,
+                                                         thread->readPC()));
+#elif THE_ISA == SPARC_ISA
             curStaticInst = StaticInst::decode(makeExtMI(machInst,
                                                          thread->getTC()));
+#endif
 
 #if FULL_SYSTEM
             thread->setInst(machInst);
index 2b152e37650951cd0f769eaf83207ded3f584a94..31f3b96d6a0e282b961d4d4359455287c48db590 100644 (file)
@@ -1117,7 +1117,11 @@ DefaultFetch<Impl>::fetch(bool &status_change)
             inst = TheISA::gtoh(*reinterpret_cast<TheISA::MachInst *>
                         (&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.
             DynInstPtr instruction = new DynInst(ext_inst, fetch_PC,
index 63cf0a952fd8c2892e88905628818530f5435a91..6d02c58cb16bea4f83a04f00d81e25003dd75bdf 100644 (file)
@@ -882,7 +882,11 @@ FrontEnd<Impl>::getInstFromCacheline()
     // Get the instruction from the array of the cache line.
     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);
+#endif
 
     // Create a new DynInst from the instruction fetched.
     DynInstPtr instruction = new DynInst(decode_inst, PC, PC+sizeof(MachInst),
index 47b3b938fbeb9008aef337121b118ef7da6e4304..6a2c0bbe93f47d268c45428ae78e969c0136cfb3 100644 (file)
@@ -398,7 +398,11 @@ BaseSimpleCPU::preExecute()
     inst = gtoh(inst);
     //If we're not in the middle of a macro instruction
     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()));
+#endif
         if (instPtr->isMacroOp()) {
             curMacroStaticInst = instPtr;
             curStaticInst = curMacroStaticInst->