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/alpha/predecoder.hh | 11 ++++++++--- src/arch/mips/predecoder.hh | 11 ++++++++--- src/arch/power/predecoder.hh | 8 ++++++-- src/arch/sparc/predecoder.hh | 13 ++++++++++--- 4 files changed, 32 insertions(+), 11 deletions(-) (limited to 'src/arch') diff --git a/src/arch/alpha/predecoder.hh b/src/arch/alpha/predecoder.hh index f9a716b7f..a8788051f 100644 --- a/src/arch/alpha/predecoder.hh +++ b/src/arch/alpha/predecoder.hh @@ -47,10 +47,11 @@ class Predecoder // The extended machine instruction being generated ExtMachInst ext_inst; + bool emiIsReady; public: Predecoder(ThreadContext * _tc) - : tc(_tc) + : tc(_tc), emiIsReady(false) {} ThreadContext * @@ -71,7 +72,9 @@ class Predecoder void reset() - { } + { + emiIsReady = false; + } // Use this to give data to the predecoder. This should be used // when there is control flow. @@ -79,6 +82,7 @@ class Predecoder moreBytes(const PCState &pc, Addr fetchPC, MachInst inst) { ext_inst = inst; + emiIsReady = true; #if FULL_SYSTEM ext_inst |= (static_cast(pc.pc() & 0x1) << 32); #endif @@ -93,13 +97,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 &pc) { + emiIsReady = false; return ext_inst; } }; diff --git a/src/arch/mips/predecoder.hh b/src/arch/mips/predecoder.hh index f059710e5..4220b768c 100644 --- a/src/arch/mips/predecoder.hh +++ b/src/arch/mips/predecoder.hh @@ -47,9 +47,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 *getTC() @@ -70,7 +71,9 @@ class Predecoder void reset() - {} + { + emiIsReady = false; + } //Use this to give data to the predecoder. This should be used //when there is control flow. @@ -78,6 +81,7 @@ class Predecoder moreBytes(const PCState &pc, Addr fetchPC, MachInst inst) { emi = inst; + emiIsReady = true; } bool @@ -89,13 +93,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 &pc) { + emiIsReady = false; return emi; } }; diff --git a/src/arch/power/predecoder.hh b/src/arch/power/predecoder.hh index b1f2b6e38..431c5d1b7 100644 --- a/src/arch/power/predecoder.hh +++ b/src/arch/power/predecoder.hh @@ -51,10 +51,11 @@ class Predecoder // The extended machine instruction being generated ExtMachInst emi; + bool emiIsReady; public: Predecoder(ThreadContext * _tc) - : tc(_tc) + : tc(_tc), emiIsReady(false) { } @@ -78,6 +79,7 @@ class Predecoder void reset() { + emiIsReady = false; } // Use this to give data to the predecoder. This should be used @@ -86,6 +88,7 @@ class Predecoder moreBytes(const PCState &pc, Addr fetchPC, MachInst inst) { emi = inst; + emiIsReady = true; } // Use this to give data to the predecoder. This should be used @@ -105,13 +108,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; } }; 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