cpu: Use cprintf and C++ type magic to get rid of a THE_ISA.
authorGabe Black <gabeblack@google.com>
Sat, 19 Sep 2020 06:28:40 +0000 (23:28 -0700)
committerGabe Black <gabeblack@google.com>
Wed, 23 Sep 2020 12:40:42 +0000 (12:40 +0000)
It should be fine to let operator overloading take care of figuring out
how to print the ExtMachInst type for a given ISA.

Change-Id: I173fd9f49013d92191118775d20344219a69337e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/34822
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/cpu/minor/dyn_inst.cc

index af02d9fc1930b783586ffc95f5346986ec9aa796..1b43fc80772ca39e7d94e56668836f29d81ca168 100644 (file)
@@ -214,10 +214,7 @@ MinorDynInst::minorTraceInst(const Named &named_object) const
                     regs_str << ',';
             }
 
-#if THE_ISA == ARM_ISA
-            regs_str << " extMachInst=" << std::hex << std::setw(16)
-                << std::setfill('0') << staticInst->machInst << std::dec;
-#endif
+            ccprintf(regs_str, " extMachInst=%160x", staticInst->machInst);
         }
 
         std::ostringstream flags;