From f21ae529fb56592a7557a6583e68d8aae0d64adc Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Mon, 19 Sep 2011 06:14:02 -0700 Subject: MIPS: Get rid of #if style config checks in the ISA description. --- src/arch/mips/isa/formats/unimp.isa | 67 +++++++++++++++++++------------------ 1 file changed, 34 insertions(+), 33 deletions(-) (limited to 'src/arch/mips/isa/formats/unimp.isa') diff --git a/src/arch/mips/isa/formats/unimp.isa b/src/arch/mips/isa/formats/unimp.isa index 2cee38a4b..e599510a4 100644 --- a/src/arch/mips/isa/formats/unimp.isa +++ b/src/arch/mips/isa/formats/unimp.isa @@ -193,50 +193,51 @@ output exec {{ CP0Unimplemented::execute(%(CPU_exec_context)s *xc, Trace::InstRecord *traceData) const { -#if FULL_SYSTEM - if (!isCoprocessorEnabled(xc, 0)) { - return new CoprocessorUnusableFault(0); - } - return new ReservedInstructionFault; -#else - panic("attempt to execute unimplemented instruction '%s' " - "(inst 0x%08x, opcode 0x%x, binary:%s)", mnemonic, machInst, OPCODE, - inst2string(machInst)); - return new UnimplementedOpcodeFault; -#endif + if (FULL_SYSTEM) { + if (!isCoprocessorEnabled(xc, 0)) + return new CoprocessorUnusableFault(0); + else + return new ReservedInstructionFault; + } else { + panic("attempt to execute unimplemented instruction '%s' " + "(inst %#08x, opcode %#x, binary:%s)", + mnemonic, machInst, OPCODE, inst2string(machInst)); + return new UnimplementedOpcodeFault; + } } Fault CP1Unimplemented::execute(%(CPU_exec_context)s *xc, Trace::InstRecord *traceData) const { -#if FULL_SYSTEM - if (!isCoprocessorEnabled(xc, 1)) { - return new CoprocessorUnusableFault(1); - } - return new ReservedInstructionFault; -#else - panic("attempt to execute unimplemented instruction '%s' " - "(inst 0x%08x, opcode 0x%x, binary:%s)", mnemonic, machInst, OPCODE, - inst2string(machInst)); - return new UnimplementedOpcodeFault; -#endif + if (FULL_SYSTEM) { + if (!isCoprocessorEnabled(xc, 1)) + return new CoprocessorUnusableFault(1); + else + return new ReservedInstructionFault; + } else { + panic("attempt to execute unimplemented instruction '%s' " + "(inst %#08x, opcode %#x, binary:%s)", + mnemonic, machInst, OPCODE, inst2string(machInst)); + return new UnimplementedOpcodeFault; + } } + Fault CP2Unimplemented::execute(%(CPU_exec_context)s *xc, Trace::InstRecord *traceData) const { -#if FULL_SYSTEM - if (!isCoprocessorEnabled(xc, 2)) { - return new CoprocessorUnusableFault(2); - } - return new ReservedInstructionFault; -#else - panic("attempt to execute unimplemented instruction '%s' " - "(inst 0x%08x, opcode 0x%x, binary:%s)", mnemonic, machInst, OPCODE, - inst2string(machInst)); - return new UnimplementedOpcodeFault; -#endif + if (FULL_SYSTEM) { + if (!isCoprocessorEnabled(xc, 2)) + return new CoprocessorUnusableFault(2); + else + return new ReservedInstructionFault; + } else { + panic("attempt to execute unimplemented instruction '%s' " + "(inst %#08x, opcode %#x, binary:%s)", + mnemonic, machInst, OPCODE, inst2string(machInst)); + return new UnimplementedOpcodeFault; + } } Fault -- cgit v1.2.3