From 546dff6b6a14cb69770769732873f72e68311ab1 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Mon, 16 Oct 2006 15:52:14 -0400 Subject: [PATCH] Made sure the constructor for insts use ExtMachInst rather than MachInst, since otherwise the EXT_ASI field is lost. src/arch/sparc/isa/base.isa: src/arch/sparc/isa/formats/micro.isa: Switch MachInst to ExtMachInst so that the EXT_ASI field is available to the instructions. src/arch/sparc/utility.hh: Made sure EXT_ASI was set to the appropriate ASI value whether or not the asi register was used. --HG-- extra : convert_revision : cc4363dfe7da81969959cec9d5ad48528edeb8ce --- src/arch/sparc/isa/base.isa | 2 +- src/arch/sparc/isa/formats/micro.isa | 6 +++--- src/arch/sparc/utility.hh | 4 ++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/arch/sparc/isa/base.isa b/src/arch/sparc/isa/base.isa index b518265aa..a4c022411 100644 --- a/src/arch/sparc/isa/base.isa +++ b/src/arch/sparc/isa/base.isa @@ -77,7 +77,7 @@ output header {{ protected: // Constructor. SparcStaticInst(const char *mnem, - MachInst _machInst, OpClass __opClass) + ExtMachInst _machInst, OpClass __opClass) : StaticInst(mnem, _machInst, __opClass) { } diff --git a/src/arch/sparc/isa/formats/micro.isa b/src/arch/sparc/isa/formats/micro.isa index 320603a6a..82d7fb4cb 100644 --- a/src/arch/sparc/isa/formats/micro.isa +++ b/src/arch/sparc/isa/formats/micro.isa @@ -34,7 +34,7 @@ output header {{ const uint32_t numMicroOps; //Constructor. - SparcMacroInst(const char *mnem, MachInst _machInst, + SparcMacroInst(const char *mnem, ExtMachInst _machInst, OpClass __opClass, uint32_t _numMicroOps) : SparcStaticInst(mnem, _machInst, __opClass), numMicroOps(_numMicroOps) @@ -68,7 +68,7 @@ output header {{ protected: //Constructor. SparcMicroInst(const char *mnem, - MachInst _machInst, OpClass __opClass) + ExtMachInst _machInst, OpClass __opClass) : SparcStaticInst(mnem, _machInst, __opClass) { flags[IsMicroOp] = true; @@ -80,7 +80,7 @@ output header {{ protected: //Constructor. SparcDelayedMicroInst(const char *mnem, - MachInst _machInst, OpClass __opClass) + ExtMachInst _machInst, OpClass __opClass) : SparcMicroInst(mnem, _machInst, __opClass) { flags[IsDelayedCommit] = true; diff --git a/src/arch/sparc/utility.hh b/src/arch/sparc/utility.hh index 796b6ba4c..23fddf0e9 100644 --- a/src/arch/sparc/utility.hh +++ b/src/arch/sparc/utility.hh @@ -33,6 +33,7 @@ #include "arch/sparc/isa_traits.hh" #include "base/misc.hh" +#include "base/bitfield.hh" #include "cpu/thread_context.hh" namespace SparcISA @@ -47,6 +48,9 @@ namespace SparcISA if(inst & (1 << 13)) emi |= (static_cast(xc->readMiscReg(MISCREG_ASI)) << (sizeof(MachInst) * 8)); + else + emi |= (static_cast(bits(inst, 12, 5)) + << (sizeof(MachInst) * 8)); return emi; } -- 2.30.2