summaryrefslogtreecommitdiff
path: root/src/arch/sparc/predecoder.hh
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2010-11-11 02:03:58 -0800
committerGabe Black <gblack@eecs.umich.edu>2010-11-11 02:03:58 -0800
commitcdc585e0e8ceb305de83053c488ba041367b7cd6 (patch)
treeea3342231f3fdcbe52e3603294bfc46f072aaef7 /src/arch/sparc/predecoder.hh
parent0b7967d606cdda184df8df1446852e4aac93331d (diff)
downloadgem5-cdc585e0e8ceb305de83053c488ba041367b7cd6.tar.xz
SPARC: Clean up some historical style issues.
Diffstat (limited to 'src/arch/sparc/predecoder.hh')
-rw-r--r--src/arch/sparc/predecoder.hh108
1 files changed, 56 insertions, 52 deletions
diff --git a/src/arch/sparc/predecoder.hh b/src/arch/sparc/predecoder.hh
index 8a2587929..f7c7c90b4 100644
--- a/src/arch/sparc/predecoder.hh
+++ b/src/arch/sparc/predecoder.hh
@@ -42,68 +42,72 @@ class ThreadContext;
namespace SparcISA
{
- class Predecoder
- {
- protected:
- ThreadContext * tc;
- //The extended machine instruction being generated
- ExtMachInst emi;
- public:
- Predecoder(ThreadContext * _tc) : tc(_tc)
- {}
+class Predecoder
+{
+ protected:
+ ThreadContext * tc;
+ // The extended machine instruction being generated
+ ExtMachInst emi;
- ThreadContext * getTC()
- {
- return tc;
- }
+ public:
+ Predecoder(ThreadContext * _tc) : tc(_tc)
+ {}
- void setTC(ThreadContext * _tc)
- {
- tc = _tc;
- }
+ ThreadContext *
+ getTC()
+ {
+ return tc;
+ }
- void process()
- {
- }
+ void
+ setTC(ThreadContext * _tc)
+ {
+ tc = _tc;
+ }
- void reset()
- {}
+ void process() {}
+ void reset() {}
- //Use this to give data to the predecoder. This should be used
- //when there is control flow.
- void moreBytes(const PCState &pc, Addr fetchPC, MachInst inst)
- {
- emi = inst;
- //The I bit, bit 13, is used to figure out where the ASI
- //should come from. Use that in the ExtMachInst. This is
- //slightly redundant, but it removes the need to put a condition
- //into all the execute functions
- if(inst & (1 << 13))
- emi |= (static_cast<ExtMachInst>(
- tc->readMiscRegNoEffect(MISCREG_ASI))
- << (sizeof(MachInst) * 8));
- else
- emi |= (static_cast<ExtMachInst>(bits(inst, 12, 5))
- << (sizeof(MachInst) * 8));
+ // Use this to give data to the predecoder. This should be used
+ // when there is control flow.
+ void
+ moreBytes(const PCState &pc, Addr fetchPC, MachInst inst)
+ {
+ emi = inst;
+ // The I bit, bit 13, is used to figure out where the ASI
+ // should come from. Use that in the ExtMachInst. This is
+ // slightly redundant, but it removes the need to put a condition
+ // into all the execute functions
+ if (inst & (1 << 13)) {
+ emi |= (static_cast<ExtMachInst>(
+ tc->readMiscRegNoEffect(MISCREG_ASI))
+ << (sizeof(MachInst) * 8));
+ } else {
+ emi |= (static_cast<ExtMachInst>(bits(inst, 12, 5))
+ << (sizeof(MachInst) * 8));
}
+ }
- bool needMoreBytes()
- {
- return true;
- }
+ bool
+ needMoreBytes()
+ {
+ return true;
+ }
- bool extMachInstReady()
- {
- return true;
- }
+ bool
+ extMachInstReady()
+ {
+ return true;
+ }
- //This returns a constant reference to the ExtMachInst to avoid a copy
- const ExtMachInst & getExtMachInst(PCState &pcState)
- {
- return emi;
- }
- };
+ // This returns a constant reference to the ExtMachInst to avoid a copy
+ const ExtMachInst &
+ getExtMachInst(PCState &pcState)
+ {
+ return emi;
+ }
+};
};
#endif // __ARCH_SPARC_PREDECODER_HH__