fp.isa revision 2608
1// -*- mode:c++ -*- 2 3//////////////////////////////////////////////////////////////////// 4// 5// Floating Point operate instructions 6// 7 8output header {{ 9 /** 10 * Base class for FP operations. 11 */ 12 class FPOp : public MipsStaticInst 13 { 14 protected: 15 16 /// Constructor 17 FPOp(const char *mnem, MachInst _machInst, OpClass __opClass) : MipsStaticInst(mnem, _machInst, __opClass) 18 { 19 } 20 21 std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const; 22 }; 23}}; 24 25output decoder {{ 26 std::string FPOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const 27 { 28 return "Disassembly of integer instruction\n"; 29 } 30}}; 31 32 33// Primary format for float operate instructions: 34def format FloatOp(code, *flags) {{ 35 iop = InstObjParams(name, Name, 'MipsStaticInst', CodeBlock(code), flags) 36 header_output = BasicDeclare.subst(iop) 37 decoder_output = BasicConstructor.subst(iop) 38 decode_block = BasicDecode.subst(iop) 39 exec_output = BasicExecute.subst(iop) 40}}; 41 42def format FloatCompareOp(code, *flags) {{ 43 code = 'bool cond;\n' + code 44 iop = InstObjParams(name, Name, 'MipsStaticInst', CodeBlock(code), flags) 45 header_output = BasicDeclare.subst(iop) 46 decoder_output = BasicConstructor.subst(iop) 47 decode_block = BasicDecode.subst(iop) 48 exec_output = BasicExecute.subst(iop) 49}}; 50 51def format FloatCompareWithXcptOp(code, *flags) {{ 52 code = 'bool cond;\n' + code 53 iop = InstObjParams(name, Name, 'MipsStaticInst', CodeBlock(code), flags) 54 header_output = BasicDeclare.subst(iop) 55 decoder_output = BasicConstructor.subst(iop) 56 decode_block = BasicDecode.subst(iop) 57 exec_output = BasicExecute.subst(iop) 58}}; 59 60def format FloatConvertOp(code, *flags) {{ 61 iop = InstObjParams(name, Name, 'MipsStaticInst', CodeBlock(code), flags) 62 header_output = BasicDeclare.subst(iop) 63 decoder_output = BasicConstructor.subst(iop) 64 decode_block = BasicDecode.subst(iop) 65 exec_output = BasicExecute.subst(iop) 66}}; 67 68// Primary format for float64 operate instructions: 69def format Float64Op(code, *flags) {{ 70 iop = InstObjParams(name, Name, 'MipsStaticInst', CodeBlock(code), flags) 71 header_output = BasicDeclare.subst(iop) 72 decoder_output = BasicConstructor.subst(iop) 73 decode_block = BasicDecode.subst(iop) 74 exec_output = BasicExecute.subst(iop) 75}}; 76 77def format Float64ConvertOp(code, *flags) {{ 78 iop = InstObjParams(name, Name, 'MipsStaticInst', CodeBlock(code), flags) 79 header_output = BasicDeclare.subst(iop) 80 decoder_output = BasicConstructor.subst(iop) 81 decode_block = BasicDecode.subst(iop) 82 exec_output = BasicExecute.subst(iop) 83}}; 84 85def format FloatPSCompareOp(code, *flags) {{ 86 code = 'bool cond1;\nbool cond2;\n' + code 87 iop = InstObjParams(name, Name, 'MipsStaticInst', CodeBlock(code), flags) 88 header_output = BasicDeclare.subst(iop) 89 decoder_output = BasicConstructor.subst(iop) 90 decode_block = BasicDecode.subst(iop) 91 exec_output = BasicExecute.subst(iop) 92}}; 93 94def format FloatPSCompareWithXcptOp(code, *flags) {{ 95 code = 'bool cond1;\nbool cond2;\n' + code 96 iop = InstObjParams(name, Name, 'MipsStaticInst', CodeBlock(code), flags) 97 header_output = BasicDeclare.subst(iop) 98 decoder_output = BasicConstructor.subst(iop) 99 decode_block = BasicDecode.subst(iop) 100 exec_output = BasicExecute.subst(iop) 101}}; 102