From 8b9b85e92cde81ef9eb0cf6595be59c96fd13f97 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Mon, 15 Nov 2010 19:37:03 -0800 Subject: O3: Make O3 support variably lengthed instructions. --- src/arch/sparc/predecoder.hh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/arch/sparc') 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(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; } }; -- cgit v1.2.3