From d30262d480b8a167470c17a35aecc727ea933a22 Mon Sep 17 00:00:00 2001 From: Korey Sewell Date: Tue, 7 Feb 2006 18:36:08 -0500 Subject: name changes ... minor IntOP format change arch/mips/isa/formats/int.format: Looks like Integer Ops with Immediates may not need their own separate class because all those instructions are distinct from their reg-reg counterparts --HG-- rename : arch/mips/isa/bitfields.def => arch/mips/isa/bitfields.isa rename : arch/mips/isa/decoder.def => arch/mips/isa/decoder.isa rename : arch/mips/isa/formats.def => arch/mips/isa/formats.isa rename : arch/mips/isa/includes.h => arch/mips/isa/includes.isa rename : arch/mips/isa/operands.def => arch/mips/isa/operands.isa extra : convert_revision : 8e354b4232b28c0264d98d333d55ef8b5a6589cc --- arch/mips/isa/formats/int.format | 65 ++-------------------------------------- 1 file changed, 3 insertions(+), 62 deletions(-) (limited to 'arch/mips/isa/formats') diff --git a/arch/mips/isa/formats/int.format b/arch/mips/isa/formats/int.format index 9b2d8d38e..edfdddb18 100644 --- a/arch/mips/isa/formats/int.format +++ b/arch/mips/isa/formats/int.format @@ -19,20 +19,6 @@ output header {{ std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const; }; - /** - * Derived class for integer immediate operations. - */ - class IntImm : public IntOp - { - protected: - - /// Constructor - IntegerImm(const char *mnem, MachInst _machInst, OpClass __opClass) : MipsStaticInst(mnem, _machInst, __opClass) - { - } - - std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const; - }; }}; output decoder {{ @@ -41,7 +27,7 @@ output decoder {{ return "Disassembly of integer instruction\n"; } - std::string IntImm::generateDisassembly(Addr pc, const SymbolTable *symtab) const + std::string IntImmOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const { return "Disassembly of integer immediate instruction\n"; } @@ -50,16 +36,9 @@ output decoder {{ def template IntExecute {{ Fault %(class_name)s::execute(%(CPU_exec_context)s *xc, Trace::InstRecord *traceData) const { - //These are set to constants when the execute method - //is generated - bool useCc = ; - bool checkPriv = ; - //Attempt to execute the instruction try { - checkPriv; - %(op_decl)s; %(op_rd)s; %(code)s; @@ -74,34 +53,15 @@ def template IntExecute {{ //Write the resulting state to the execution context %(op_wb)s; - if(useCc) - { - xc->regs.miscRegFile.ccrFields.iccFields.n = Rd & (1 << 63); - xc->regs.miscRegFile.ccrFields.iccFields.z = (Rd == 0); - xc->regs.miscRegFile.ccrFields.iccFields.v = ivValue; - xc->regs.miscRegFile.ccrFields.iccFields.c = icValue; - xc->regs.miscRegFile.ccrFields.xccFields.n = Rd & (1 << 31); - xc->regs.miscRegFile.ccrFields.xccFields.z = ((Rd & 0xFFFFFFFF) == 0); - xc->regs.miscRegFile.ccrFields.xccFields.v = xvValue; - xc->regs.miscRegFile.ccrFields.xccFields.c = xcValue; - } + return No_Fault; } }}; // Primary format for integer operate instructions: -def format IntegerOp(code, *opt_flags) {{ +def format IntOp(code, *opt_flags) {{ orig_code = code cblk = CodeBlock(code) - checkPriv = (code.find('checkPriv') != -1) - code.replace('checkPriv', '') - if checkPriv: - code.replace('checkPriv;', 'if(!xc->regs.miscRegFile.pstateFields.priv) throw privileged_opcode;') - else: - code.replace('checkPriv;', '') - for (marker, value) in (('ivValue', '0'), ('icValue', '0'), - ('xvValue', '0'), ('xcValue', '0')): - code.replace(marker, value) iop = InstObjParams(name, Name, 'MipsStaticInst', cblk, opt_flags) header_output = BasicDeclare.subst(iop) decoder_output = BasicConstructor.subst(iop) @@ -109,22 +69,3 @@ def format IntegerOp(code, *opt_flags) {{ exec_output = IntegerExecute.subst(iop) }}; -// Primary format for integer operate instructions: -def format IntegerOpCc(code, icValue, ivValue, xcValue, xvValue, *opt_flags) {{ - orig_code = code - cblk = CodeBlock(code) - checkPriv = (code.find('checkPriv') != -1) - code.replace('checkPriv', '') - if checkPriv: - code.replace('checkPriv;', 'if(!xc->regs.miscRegFile.pstateFields.priv) throw privileged_opcode;') - else: - code.replace('checkPriv;', '') - for (marker, value) in (('ivValue', ivValue), ('icValue', icValue), - ('xvValue', xvValue), ('xcValue', xcValue)): - code.replace(marker, value) - iop = InstObjParams(name, Name, 'MipsStaticInst', cblk, opt_flags) - header_output = BasicDeclare.subst(iop) - decoder_output = BasicConstructor.subst(iop) - decode_block = BasicDecodeWithMnemonic.subst(iop) - exec_output = IntegerExecute.subst(iop) -}}; -- cgit v1.2.3