return ss.str();
}
+string
+RfeOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+{
+ stringstream ss;
+ switch (mode) {
+ case DecrementAfter:
+ printMnemonic(ss, "da");
+ break;
+ case DecrementBefore:
+ printMnemonic(ss, "db");
+ break;
+ case IncrementAfter:
+ printMnemonic(ss, "ia");
+ break;
+ case IncrementBefore:
+ printMnemonic(ss, "ib");
+ break;
+ }
+ printReg(ss, base);
+ if (wb) {
+ ss << "!";
+ }
+ return ss.str();
+}
+
void
Memory::printInst(std::ostream &os, AddrMode addrMode) const
{
std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
};
+// The address is a base register plus an immediate.
+class RfeOp : public PredOp
+{
+ public:
+ enum AddrMode {
+ DecrementAfter,
+ DecrementBefore,
+ IncrementAfter,
+ IncrementBefore
+ };
+ protected:
+ IntRegIndex base;
+ AddrMode mode;
+ bool wb;
+
+ RfeOp(const char *mnem, ExtMachInst _machInst, OpClass __opClass,
+ IntRegIndex _base, AddrMode _mode, bool _wb)
+ : PredOp(mnem, _machInst, __opClass),
+ base(_base), mode(_mode), wb(_wb)
+ {}
+
+ std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+};
+
class Memory : public PredOp
{
public:
}
}};
+def template RfeDeclare {{
+ /**
+ * Static instruction class for "%(mnemonic)s".
+ */
+ class %(class_name)s : public %(base_class)s
+ {
+ public:
+
+ /// Constructor.
+ %(class_name)s(ExtMachInst machInst,
+ uint32_t _base, int _mode, bool _wb);
+
+ %(BasicExecDeclare)s
+
+ %(InitiateAccDeclare)s
+
+ %(CompleteAccDeclare)s
+ };
+}};
+
def template SwapDeclare {{
/**
* Static instruction class for "%(mnemonic)s".
Fault completeAcc(PacketPtr, %(CPU_exec_context)s *, Trace::InstRecord *) const;
}};
+def template RfeConstructor {{
+ inline %(class_name)s::%(class_name)s(ExtMachInst machInst,
+ uint32_t _base, int _mode, bool _wb)
+ : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s,
+ (IntRegIndex)_base, (AddrMode)_mode, _wb)
+ {
+ %(constructor)s;
+ }
+}};
+
def template SwapConstructor {{
inline %(class_name)s::%(class_name)s(ExtMachInst machInst,
uint32_t _dest, uint32_t _op1, uint32_t _base)