summaryrefslogtreecommitdiff
path: root/src/arch/sparc/isa/base.isa
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2007-01-30 16:12:38 -0500
committerGabe Black <gblack@eecs.umich.edu>2007-01-30 16:12:38 -0500
commitefb14c585ba1c82c759fccf772368d519d4c02f8 (patch)
treed103157d3c60029e394f16080dcaed4747dad52d /src/arch/sparc/isa/base.isa
parent0cdcd207ac7e3636ee84b506afc6929417e52202 (diff)
downloadgem5-efb14c585ba1c82c759fccf772368d519d4c02f8.tar.xz
Implemented fbfss and fbpfcc instructions, and cleaned up branch code a little.
src/arch/sparc/isa/base.isa: Added passesFpCondition function to help with fbfcc and fbpfcc instructions. src/arch/sparc/isa/decoder.isa: Added fbfcc and fbpfcc instructions, and cleaned up branch code slightly. src/arch/sparc/isa/formats/branch.isa: Minor cleanup. --HG-- extra : convert_revision : 6586b46418f1f70bace41407f267fee30c657714
Diffstat (limited to 'src/arch/sparc/isa/base.isa')
-rw-r--r--src/arch/sparc/isa/base.isa67
1 files changed, 67 insertions, 0 deletions
diff --git a/src/arch/sparc/isa/base.isa b/src/arch/sparc/isa/base.isa
index 58a17f23e..693cc6876 100644
--- a/src/arch/sparc/isa/base.isa
+++ b/src/arch/sparc/isa/base.isa
@@ -67,6 +67,26 @@ output header {{
OverflowSet=0x7
};
+ enum FpCondTest
+ {
+ FAlways=0x8,
+ FNever=0x0,
+ FUnordered=0x7,
+ FGreater=0x6,
+ FUnorderedOrGreater=0x5,
+ FLess=0x4,
+ FUnorderedOrLess=0x3,
+ FLessOrGreater=0x2,
+ FNotEqual=0x1,
+ FEqual=0x9,
+ FUnorderedOrEqual=0xA,
+ FGreaterOrEqual=0xB,
+ FUnorderedOrGreaterOrEqual=0xC,
+ FLessOrEqual=0xD,
+ FUnorderedOrLessOrEqual=0xE,
+ FOrdered=0xF
+ };
+
extern char * CondTestAbbrev[];
/**
@@ -93,6 +113,8 @@ output header {{
const RegIndex indexArray[], int num) const;
};
+ bool passesFpCondition(uint32_t fcc, uint32_t condition);
+
bool passesCondition(uint32_t codes, uint32_t condition);
inline int64_t sign_ext(uint64_t data, int origWidth)
@@ -367,6 +389,51 @@ output decoder {{
return ss.str();
}
+ bool passesFpCondition(uint32_t fcc, uint32_t condition)
+ {
+ bool u = (fcc == 3);
+ bool g = (fcc == 2);
+ bool l = (fcc == 1);
+ bool e = (fcc == 0);
+ switch(condition)
+ {
+ case FAlways:
+ return 1;
+ case FNever:
+ return 0;
+ case FUnordered:
+ return u;
+ case FGreater:
+ return g;
+ case FUnorderedOrGreater:
+ return u || g;
+ case FLess:
+ return l;
+ case FUnorderedOrLess:
+ return u || l;
+ case FLessOrGreater:
+ return l || g;
+ case FNotEqual:
+ return l || g || u;
+ case FEqual:
+ return e;
+ case FUnorderedOrEqual:
+ return u || e;
+ case FGreaterOrEqual:
+ return g || e;
+ case FUnorderedOrGreaterOrEqual:
+ return u || g || e;
+ case FLessOrEqual:
+ return l || e;
+ case FUnorderedOrLessOrEqual:
+ return u || l || e;
+ case FOrdered:
+ return e || l || g;
+ }
+ panic("Tried testing condition nonexistant "
+ "condition code %d", condition);
+ }
+
bool passesCondition(uint32_t codes, uint32_t condition)
{
CondCodes condCodes;