c552b06a8c
Auxiliary Functions and Formats for FP in general arch/mips/isa/decoder.isa: ISA Parser doesnt accept operands of different types in one instruction so fix this for unorderedFP functions... Add basic support for Paired Singled (PS) FP ops which happen to be part of the MIPS 32-ASE but turned out to be included in the MIPS32ISA manual... The PS instructions allow SIMD in a pipeline... arch/mips/isa/formats/fp.isa: Add some more Formats for FP operation. I will add some auxiliary code through these formats to alleviate code redundancy in the decoder.isa arch/mips/isa/operands.isa: Add operands for Paired Singles Ops arch/mips/isa_traits.cc: removed convert&round function and replace with fpConvert. The whole "rounding mode" stuff is something that should be considered for full-system mode... Also added skeletons for the unorderedFP,truncFP,and condition code funcs. arch/mips/isa_traits.hh: declare some Functions arch/mips/types.hh: add new conversion types --HG-- extra : convert_revision : 79251d590a27b74a3d6a62a2fbb937df3e59963f
83 lines
2.8 KiB
C++
83 lines
2.8 KiB
C++
// -*- mode:c++ -*-
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
//
|
|
// Floating Point operate instructions
|
|
//
|
|
|
|
output header {{
|
|
/**
|
|
* Base class for FP operations.
|
|
*/
|
|
class FPOp : public MipsStaticInst
|
|
{
|
|
protected:
|
|
|
|
/// Constructor
|
|
FPOp(const char *mnem, MachInst _machInst, OpClass __opClass) : MipsStaticInst(mnem, _machInst, __opClass)
|
|
{
|
|
}
|
|
|
|
std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
|
|
};
|
|
}};
|
|
|
|
output decoder {{
|
|
std::string FPOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
|
|
{
|
|
return "Disassembly of integer instruction\n";
|
|
}
|
|
}};
|
|
|
|
|
|
// Primary format for float operate instructions:
|
|
def format FloatOp(code, *flags) {{
|
|
iop = InstObjParams(name, Name, 'MipsStaticInst', CodeBlock(code), flags)
|
|
header_output = BasicDeclare.subst(iop)
|
|
decoder_output = BasicConstructor.subst(iop)
|
|
decode_block = BasicDecode.subst(iop)
|
|
exec_output = BasicExecute.subst(iop)
|
|
}};
|
|
|
|
def format FloatCompareOp(code, *flags) {{
|
|
code = 'bool cond;\n' + code
|
|
iop = InstObjParams(name, Name, 'MipsStaticInst', CodeBlock(code), flags)
|
|
header_output = BasicDeclare.subst(iop)
|
|
decoder_output = BasicConstructor.subst(iop)
|
|
decode_block = BasicDecode.subst(iop)
|
|
exec_output = BasicExecute.subst(iop)
|
|
}};
|
|
|
|
def format FloatCompareWithXcptOp(code, *flags) {{
|
|
code = 'bool cond;\n' + code
|
|
iop = InstObjParams(name, Name, 'MipsStaticInst', CodeBlock(code), flags)
|
|
header_output = BasicDeclare.subst(iop)
|
|
decoder_output = BasicConstructor.subst(iop)
|
|
decode_block = BasicDecode.subst(iop)
|
|
exec_output = BasicExecute.subst(iop)
|
|
}};
|
|
|
|
def format FloatConvertOp(code, *flags) {{
|
|
iop = InstObjParams(name, Name, 'MipsStaticInst', CodeBlock(code), flags)
|
|
header_output = BasicDeclare.subst(iop)
|
|
decoder_output = BasicConstructor.subst(iop)
|
|
decode_block = BasicDecode.subst(iop)
|
|
exec_output = BasicExecute.subst(iop)
|
|
}};
|
|
|
|
// Primary format for float64 operate instructions:
|
|
def format Float64Op(code, *flags) {{
|
|
iop = InstObjParams(name, Name, 'MipsStaticInst', CodeBlock(code), flags)
|
|
header_output = BasicDeclare.subst(iop)
|
|
decoder_output = BasicConstructor.subst(iop)
|
|
decode_block = BasicDecode.subst(iop)
|
|
exec_output = BasicExecute.subst(iop)
|
|
}};
|
|
|
|
def format Float64ConvertOp(code, *flags) {{
|
|
iop = InstObjParams(name, Name, 'MipsStaticInst', CodeBlock(code), flags)
|
|
header_output = BasicDeclare.subst(iop)
|
|
decoder_output = BasicConstructor.subst(iop)
|
|
decode_block = BasicDecode.subst(iop)
|
|
exec_output = BasicExecute.subst(iop)
|
|
}};
|