summaryrefslogtreecommitdiff
path: root/arch/mips/isa/base.isa
diff options
context:
space:
mode:
authorKorey Sewell <ksewell@umich.edu>2006-02-16 02:39:46 -0500
committerKorey Sewell <ksewell@umich.edu>2006-02-16 02:39:46 -0500
commit7c9ea671aff141bc0a3e7acc892794e7e8181cf3 (patch)
tree79be1628eb0faede506c52dcbf787886292150c0 /arch/mips/isa/base.isa
parenta0cdf213ab534838d9757a59639c371e9d2c9809 (diff)
downloadgem5-7c9ea671aff141bc0a3e7acc892794e7e8181cf3.tar.xz
file name changes ... minor ISA changes
arch/mips/isa/base.isa: restoring base.isa file ... arch/mips/isa/formats/basic.isa: add c++ emacs header arch/mips/isa/formats/branch.isa: added branch likely format arch/mips/isa/formats/int.isa: small change to python code --HG-- extra : convert_revision : defd592abb1a724f5f88b19c197b858420e92d17
Diffstat (limited to 'arch/mips/isa/base.isa')
-rw-r--r--arch/mips/isa/base.isa35
1 files changed, 8 insertions, 27 deletions
diff --git a/arch/mips/isa/base.isa b/arch/mips/isa/base.isa
index b504f1906..99fa302c0 100644
--- a/arch/mips/isa/base.isa
+++ b/arch/mips/isa/base.isa
@@ -1,18 +1,21 @@
+// -*- mode:c++ -*-
+
////////////////////////////////////////////////////////////////////
//
-// Base class for sparc instructions, and some support functions
+// Base class for MIPS instructions, and some support functions
//
+//Outputs to decoder.hh
output header {{
/**
* Base class for all SPARC static instructions.
*/
- class SparcStaticInst : public StaticInst<SPARCISA>
+ class MipsStaticInst : public StaticInst<MIPSISA>
{
protected:
// Constructor.
- SparcStaticInst(const char *mnem, MachInst _machInst, OpClass __opClass)
+ MipsStaticInst(const char *mnem, MachInst _machInst, OpClass __opClass)
: StaticInst<SPARCISA>(mnem, _machInst, __opClass)
{
}
@@ -20,12 +23,12 @@ output header {{
std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
};
- bool passesCondition(struct {uint8_t c:1; uint8_t v:1; uint8_t z:1; uint8_t n:1} codes, uint8_t condition);
}};
+//Ouputs to decoder.cc
output decoder {{
- std::string SparcStaticInst::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+ std::string MipsStaticInst::generateDisassembly(Addr pc, const SymbolTable *symtab) const
{
std::stringstream ss;
@@ -56,27 +59,5 @@ output decoder {{
return ss.str();
}
- bool passesCondition(struct {uint8_t c:1; uint8_t v:1; uint8_t z:1; uint8_t n:1} codes, uint8_t condition)
- {
- switch(condition)
- {
- case 0b1000: return true;
- case 0b0000: return false;
- case 0b1001: return !codes.z;
- case 0b0001: return codes.z;
- case 0b1010: return !(codes.z | (codes.n ^ codes.v));
- case 0b0010: return codes.z | (codes.n ^ codes.v);
- case 0b1011: return !(codes.n ^ codes.v);
- case 0b0011: return (codes.n ^ codes.v);
- case 0b1100: return !(codes.c | codes.z);
- case 0b0100: return (codes.c | codes.z);
- case 0b1101: return !codes.c;
- case 0b0101: return codes.c;
- case 0b1110: return !codes.n;
- case 0b0110: return codes.n;
- case 0b1111: return !codes.v;
- case 0b0111: return codes.v;
- }
- }
}};