#include "arch/generic/decoder.hh"
#include "base/types.hh"
#include "cpu/static_inst.hh"
+#include "debug/Decode.hh"
#include "enums/DecoderFlavor.hh"
namespace ArmISA
StaticInstPtr
decode(ExtMachInst mach_inst, Addr addr)
{
- return defaultCache.decode(this, mach_inst, addr);
+ StaticInstPtr si = defaultCache.decode(this, mach_inst, addr);
+ DPRINTF(Decode, "Decode: Decoded %s instruction: %#x\n",
+ si->getName(), mach_inst);
+ return si;
}
/**
#include "base/logging.hh"
#include "base/types.hh"
#include "cpu/static_inst.hh"
+#include "debug/Decode.hh"
namespace MipsISA
{
StaticInstPtr
decode(ExtMachInst mach_inst, Addr addr)
{
- return defaultCache.decode(this, mach_inst, addr);
+ StaticInstPtr si = defaultCache.decode(this, mach_inst, addr);
+ DPRINTF(Decode, "Decode: Decoded %s instruction: %#x\n",
+ si->getName(), mach_inst);
+ return si;
}
StaticInstPtr
#include "arch/generic/decoder.hh"
#include "arch/power/types.hh"
#include "cpu/static_inst.hh"
+#include "debug/Decode.hh"
namespace PowerISA
{
StaticInstPtr
decode(ExtMachInst mach_inst, Addr addr)
{
- return defaultCache.decode(this, mach_inst, addr);
+ StaticInstPtr si = defaultCache.decode(this, mach_inst, addr);
+ DPRINTF(Decode, "Decode: Decoded %s instruction: %#x\n",
+ si->getName(), mach_inst);
+ return si;
}
StaticInstPtr
{
DPRINTF(Decode, "Decoding instruction 0x%08x at address %#x\n",
mach_inst, addr);
- if (instMap.find(mach_inst) != instMap.end())
- return instMap[mach_inst];
- else {
- StaticInstPtr si = decodeInst(mach_inst);
- instMap[mach_inst] = si;
- return si;
- }
+
+ StaticInstPtr &si = instMap[mach_inst];
+ if (!si)
+ si = decodeInst(mach_inst);
+
+ DPRINTF(Decode, "Decode: Decoded %s instruction: %#x\n",
+ si->getName(), mach_inst);
+ return si;
}
StaticInstPtr
#include "arch/sparc/registers.hh"
#include "arch/sparc/types.hh"
#include "cpu/static_inst.hh"
+#include "debug/Decode.hh"
namespace SparcISA
{
StaticInstPtr
decode(ExtMachInst mach_inst, Addr addr)
{
- return defaultCache.decode(this, mach_inst, addr);
+ StaticInstPtr si = defaultCache.decode(this, mach_inst, addr);
+ DPRINTF(Decode, "Decode: Decoded %s instruction: %#x\n",
+ si->getName(), mach_inst);
+ return si;
}
StaticInstPtr
#include "base/logging.hh"
#include "base/trace.hh"
#include "base/types.hh"
+#include "debug/Decode.hh"
#include "debug/Decoder.hh"
namespace X86ISA
StaticInstPtr
Decoder::decode(ExtMachInst mach_inst, Addr addr)
{
+ StaticInstPtr si;
+
auto iter = instMap->find(mach_inst);
- if (iter != instMap->end())
- return iter->second;
+ if (iter != instMap->end()) {
+ si = iter->second;
+ } else {
+ si = decodeInst(mach_inst);
+ (*instMap)[mach_inst] = si;
+ }
- StaticInstPtr si = decodeInst(mach_inst);
- (*instMap)[mach_inst] = si;
+ DPRINTF(Decode, "Decode: Decoded %s instruction: %#x\n",
+ si->getName(), mach_inst);
return si;
}
#if TRACING_ON
traceData = tracer->getInstRecord(curTick(), thread->getTC(),
curStaticInst, thread->pcState(), curMacroStaticInst);
-
- DPRINTF(Decode,"Decode: Decoded %s instruction: %#x\n",
- curStaticInst->getName(), curStaticInst->machInst);
#endif // TRACING_ON
}