818f3ae22f
arch/sparc/isa/decoder.isa: Replaced register number munging with RdLow and RdHigh operands. arch/sparc/isa/formats/mem.isa: Fixed how the address calculation code is dealt with. arch/sparc/isa/operands.isa: Changed the tabbing so that the whole oeprands block was consistent, and added RdLow and RdHigh operands. These registers are used when Rd is meant to refer to a pair of registers, rather than just one. arch/sparc/isa_traits.hh: Moved some functions to the new (to SPARC) utility.hh file. Also, dummy Fpcr_DepTag and Uniq_DepTag DepTags were added to pacify Tru64. These need to be removed, and Tru64 needs to not be compiled in if it isn't appropriate. arch/sparc/regfile.hh: Changed regSpace to have the correct size. arch/sparc/utility.hh: A new file for sparc to match the one for alpha. --HG-- extra : convert_revision : ff6b529093d15f327ec11f067ad533bacdba9932
68 lines
1.9 KiB
Text
68 lines
1.9 KiB
Text
////////////////////////////////////////////////////////////////////
|
|
//
|
|
// Mem instructions
|
|
//
|
|
|
|
output header {{
|
|
/**
|
|
* Base class for integer operations.
|
|
*/
|
|
class Mem : public SparcStaticInst
|
|
{
|
|
protected:
|
|
|
|
// Constructor
|
|
Mem(const char *mnem, ExtMachInst _machInst, OpClass __opClass) :
|
|
SparcStaticInst(mnem, _machInst, __opClass)
|
|
{
|
|
}
|
|
|
|
std::string generateDisassembly(Addr pc,
|
|
const SymbolTable *symtab) const;
|
|
};
|
|
}};
|
|
|
|
output decoder {{
|
|
std::string Mem::generateDisassembly(Addr pc, const SymbolTable *symtab) const
|
|
{
|
|
return "Memory instruction\n";
|
|
}
|
|
}};
|
|
|
|
def template MemExecute {{
|
|
Fault %(class_name)s::execute(%(CPU_exec_context)s *xc,
|
|
Trace::InstRecord *traceData) const
|
|
{
|
|
Fault fault = NoFault;
|
|
Addr EA;
|
|
%(op_decl)s;
|
|
%(op_rd)s;
|
|
%(ea_code)s;
|
|
%(code)s;
|
|
|
|
if(fault == NoFault)
|
|
{
|
|
//Write the resulting state to the execution context
|
|
%(op_wb)s;
|
|
}
|
|
|
|
return fault;
|
|
}
|
|
}};
|
|
|
|
// Primary format for integer operate instructions:
|
|
def format Mem(code, *opt_flags) {{
|
|
addrCalc = 'EA = I ? (Rs1 + SIMM13) : Rs1 + Rs2;'
|
|
composite = code + '\n' + addrCalc
|
|
origCodeBlk = CodeBlock(code)
|
|
compositeBlk = CodeBlock(composite)
|
|
addrCalcBlk = CodeBlock(addrCalc)
|
|
iop = InstObjParams(name, Name, 'SparcStaticInst', compositeBlk, opt_flags)
|
|
iop.code = origCodeBlk.code
|
|
iop.orig_code = origCodeBlk.orig_code
|
|
iop.ea_code = addrCalcBlk.code
|
|
header_output = BasicDeclare.subst(iop)
|
|
decoder_output = BasicConstructor.subst(iop)
|
|
decode_block = BasicDecode.subst(iop)
|
|
exec_output = MemExecute.subst(iop)
|
|
}};
|