summaryrefslogtreecommitdiff
path: root/src/arch/sparc/predecoder.hh
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2010-11-15 19:37:03 -0800
committerGabe Black <gblack@eecs.umich.edu>2010-11-15 19:37:03 -0800
commit8b9b85e92cde81ef9eb0cf6595be59c96fd13f97 (patch)
treecf5a39118cebc1595f27072b26dd3dd6b3a2e140 /src/arch/sparc/predecoder.hh
parent776c07591797ccd103619de111ec27df04f96bb3 (diff)
downloadgem5-8b9b85e92cde81ef9eb0cf6595be59c96fd13f97.tar.xz
O3: Make O3 support variably lengthed instructions.
Diffstat (limited to 'src/arch/sparc/predecoder.hh')
-rw-r--r--src/arch/sparc/predecoder.hh13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/arch/sparc/predecoder.hh b/src/arch/sparc/predecoder.hh
index f7c7c90b4..670c547d0 100644
--- a/src/arch/sparc/predecoder.hh
+++ b/src/arch/sparc/predecoder.hh
@@ -49,9 +49,10 @@ class Predecoder
ThreadContext * tc;
// The extended machine instruction being generated
ExtMachInst emi;
+ bool emiIsReady;
public:
- Predecoder(ThreadContext * _tc) : tc(_tc)
+ Predecoder(ThreadContext * _tc) : tc(_tc), emiIsReady(false)
{}
ThreadContext *
@@ -67,7 +68,11 @@ class Predecoder
}
void process() {}
- void reset() {}
+ void
+ reset()
+ {
+ emiIsReady = false;
+ }
// Use this to give data to the predecoder. This should be used
// when there is control flow.
@@ -87,6 +92,7 @@ class Predecoder
emi |= (static_cast<ExtMachInst>(bits(inst, 12, 5))
<< (sizeof(MachInst) * 8));
}
+ emiIsReady = true;
}
bool
@@ -98,13 +104,14 @@ class Predecoder
bool
extMachInstReady()
{
- return true;
+ return emiIsReady;
}
// This returns a constant reference to the ExtMachInst to avoid a copy
const ExtMachInst &
getExtMachInst(PCState &pcState)
{
+ emiIsReady = false;
return emi;
}
};