97429d8eee
Edit the convert_and_round function which access FloatRegFile arch/isa_parser.py: recognize when we are writing a 'uint64_t' FloatReg and set the width appropriately arch/mips/isa/decoder.isa: Send a 'float' to the convert function instead of a unsigned word. Do this so we dont have to worry about the bit manipulation ourselves. We can just concern ourselves with values. Use unsigned double to get movd... arch/mips/isa/formats/fp.isa: float debug statement arch/mips/isa_traits.cc: add different versions of convert_and_round functions arch/mips/isa_traits.hh: Use an array of uint32_t unsigned integers to represent the Floating Point Regfile configs/test/hello_mips: basic FP program cpu/simple/cpu.hh: spacing --HG-- extra : convert_revision : a6fca91ad6365c83025f1131d71fa1b8ee76d7bc
51 lines
1.6 KiB
C++
51 lines
1.6 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) {{
|
|
code = 'std::cout << "Floating Point Op" << std::endl;\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)
|
|
}};
|
|
|
|
// Primary format for float64 operate instructions:
|
|
def format Float64Op(code, *flags) {{
|
|
code = 'std::cout << "Floating Point 64" << std::endl;\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)
|
|
}};
|