dyn_inst.hh revision 13582:989577bf6abc
1955SN/A/* 2955SN/A * Copyright (c) 2010, 2016 ARM Limited 312230Sgiacomo.travaglini@arm.com * Copyright (c) 2013 Advanced Micro Devices, Inc. 49812Sandreas.hansson@arm.com * All rights reserved 59812Sandreas.hansson@arm.com * 69812Sandreas.hansson@arm.com * The license below extends only to copyright in the software and shall 79812Sandreas.hansson@arm.com * not be construed as granting a license to any other intellectual 89812Sandreas.hansson@arm.com * property including but not limited to intellectual property relating 99812Sandreas.hansson@arm.com * to a hardware implementation of the functionality of the software 109812Sandreas.hansson@arm.com * licensed hereunder. You may use the software subject to the license 119812Sandreas.hansson@arm.com * terms below provided that you ensure that this notice is replicated 129812Sandreas.hansson@arm.com * unmodified and in its entirety in all distributions of the software, 139812Sandreas.hansson@arm.com * modified or unmodified, in source code or in binary form. 149812Sandreas.hansson@arm.com * 157816Ssteve.reinhardt@amd.com * Copyright (c) 2004-2006 The Regents of The University of Michigan 165871Snate@binkert.org * All rights reserved. 171762SN/A * 18955SN/A * Redistribution and use in source and binary forms, with or without 19955SN/A * modification, are permitted provided that the following conditions are 20955SN/A * met: redistributions of source code must retain the above copyright 21955SN/A * notice, this list of conditions and the following disclaimer; 22955SN/A * redistributions in binary form must reproduce the above copyright 23955SN/A * notice, this list of conditions and the following disclaimer in the 24955SN/A * documentation and/or other materials provided with the distribution; 25955SN/A * neither the name of the copyright holders nor the names of its 26955SN/A * contributors may be used to endorse or promote products derived from 27955SN/A * this software without specific prior written permission. 28955SN/A * 29955SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 30955SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 31955SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 32955SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 33955SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 34955SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 35955SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 36955SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 37955SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 38955SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 39955SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 40955SN/A * 41955SN/A * Authors: Kevin Lim 422665Ssaidi@eecs.umich.edu */ 432665Ssaidi@eecs.umich.edu 445863Snate@binkert.org#ifndef __CPU_O3_DYN_INST_HH__ 45955SN/A#define __CPU_O3_DYN_INST_HH__ 46955SN/A 47955SN/A#include <array> 48955SN/A 49955SN/A#include "arch/isa_traits.hh" 508878Ssteve.reinhardt@amd.com#include "config/the_isa.hh" 512632Sstever@eecs.umich.edu#include "cpu/o3/cpu.hh" 528878Ssteve.reinhardt@amd.com#include "cpu/o3/isa_specific.hh" 532632Sstever@eecs.umich.edu#include "cpu/base_dyn_inst.hh" 54955SN/A#include "cpu/inst_seq.hh" 558878Ssteve.reinhardt@amd.com#include "cpu/reg_class.hh" 562632Sstever@eecs.umich.edu 572761Sstever@eecs.umich.educlass Packet; 582632Sstever@eecs.umich.edu 592632Sstever@eecs.umich.edutemplate <class Impl> 602632Sstever@eecs.umich.educlass BaseO3DynInst : public BaseDynInst<Impl> 612761Sstever@eecs.umich.edu{ 622761Sstever@eecs.umich.edu public: 632761Sstever@eecs.umich.edu /** Typedef for the CPU. */ 648878Ssteve.reinhardt@amd.com typedef typename Impl::O3CPU O3CPU; 658878Ssteve.reinhardt@amd.com 662761Sstever@eecs.umich.edu /** Binary machine instruction type. */ 672761Sstever@eecs.umich.edu typedef TheISA::MachInst MachInst; 682761Sstever@eecs.umich.edu /** Register types. */ 692761Sstever@eecs.umich.edu typedef TheISA::CCReg CCReg; 702761Sstever@eecs.umich.edu using VecRegContainer = TheISA::VecRegContainer; 718878Ssteve.reinhardt@amd.com using VecElem = TheISA::VecElem; 728878Ssteve.reinhardt@amd.com static constexpr auto NumVecElemPerVecReg = TheISA::NumVecElemPerVecReg; 732632Sstever@eecs.umich.edu 742632Sstever@eecs.umich.edu enum { 758878Ssteve.reinhardt@amd.com MaxInstSrcRegs = TheISA::MaxInstSrcRegs, //< Max source regs 768878Ssteve.reinhardt@amd.com MaxInstDestRegs = TheISA::MaxInstDestRegs //< Max dest regs 772632Sstever@eecs.umich.edu }; 78955SN/A 79955SN/A public: 80955SN/A /** BaseDynInst constructor given a binary instruction. */ 8112563Sgabeblack@google.com BaseO3DynInst(const StaticInstPtr &staticInst, const StaticInstPtr 8212563Sgabeblack@google.com ¯oop, TheISA::PCState pc, TheISA::PCState predPC, 836654Snate@binkert.org InstSeqNum seq_num, O3CPU *cpu); 8410196SCurtis.Dunham@arm.com 85955SN/A /** BaseDynInst constructor given a static inst pointer. */ 865396Ssaidi@eecs.umich.edu BaseO3DynInst(const StaticInstPtr &_staticInst, 8711401Sandreas.sandberg@arm.com const StaticInstPtr &_macroop); 885863Snate@binkert.org 895863Snate@binkert.org ~BaseO3DynInst(); 904202Sbinkertn@umich.edu 915863Snate@binkert.org /** Executes the instruction.*/ 925863Snate@binkert.org Fault execute(); 935863Snate@binkert.org 945863Snate@binkert.org /** Initiates the access. Only valid for memory operations. */ 9513541Sandrea.mondelli@ucf.edu Fault initiateAcc(); 96955SN/A 976654Snate@binkert.org /** Completes the access. Only valid for memory operations. */ 985273Sstever@gmail.com Fault completeAcc(PacketPtr pkt); 995871Snate@binkert.org 10013758Sgabeblack@google.com private: 1015273Sstever@gmail.com /** Initializes variables. */ 1026654Snate@binkert.org void initVars(); 1035396Ssaidi@eecs.umich.edu 1048120Sgblack@eecs.umich.edu protected: 1058120Sgblack@eecs.umich.edu /** Explicitation of dependent names. */ 1068120Sgblack@eecs.umich.edu using BaseDynInst<Impl>::cpu; 1078120Sgblack@eecs.umich.edu using BaseDynInst<Impl>::_srcRegIdx; 1088120Sgblack@eecs.umich.edu using BaseDynInst<Impl>::_destRegIdx; 1098120Sgblack@eecs.umich.edu 1108120Sgblack@eecs.umich.edu /** Values to be written to the destination misc. registers. */ 1118120Sgblack@eecs.umich.edu std::array<RegVal, TheISA::MaxMiscDestRegs> _destMiscRegVal; 1128879Ssteve.reinhardt@amd.com 1138879Ssteve.reinhardt@amd.com /** Indexes of the destination misc. registers. They are needed to defer 1148879Ssteve.reinhardt@amd.com * the write accesses to the misc. registers until the commit stage, when 1158879Ssteve.reinhardt@amd.com * the instruction is out of its speculative state. 1168879Ssteve.reinhardt@amd.com */ 1178879Ssteve.reinhardt@amd.com std::array<short, TheISA::MaxMiscDestRegs> _destMiscRegIdx; 1188879Ssteve.reinhardt@amd.com 1198879Ssteve.reinhardt@amd.com /** Number of destination misc. registers. */ 1208879Ssteve.reinhardt@amd.com uint8_t _numDestMiscRegs; 1218879Ssteve.reinhardt@amd.com 1228879Ssteve.reinhardt@amd.com 1238879Ssteve.reinhardt@amd.com public: 1248879Ssteve.reinhardt@amd.com#if TRACING_ON 1258120Sgblack@eecs.umich.edu /** Tick records used for the pipeline activity viewer. */ 1268120Sgblack@eecs.umich.edu Tick fetchTick; // instruction fetch is completed. 1278120Sgblack@eecs.umich.edu int32_t decodeTick; // instruction enters decode phase 1288120Sgblack@eecs.umich.edu int32_t renameTick; // instruction enters rename phase 1298120Sgblack@eecs.umich.edu int32_t dispatchTick; 1308120Sgblack@eecs.umich.edu int32_t issueTick; 1318120Sgblack@eecs.umich.edu int32_t completeTick; 1328120Sgblack@eecs.umich.edu int32_t commitTick; 1338120Sgblack@eecs.umich.edu int32_t storeTick; 1348120Sgblack@eecs.umich.edu#endif 1358120Sgblack@eecs.umich.edu 1368120Sgblack@eecs.umich.edu /** Reads a misc. register, including any side-effects the read 1378120Sgblack@eecs.umich.edu * might have as defined by the architecture. 1388120Sgblack@eecs.umich.edu */ 1398879Ssteve.reinhardt@amd.com RegVal 1408879Ssteve.reinhardt@amd.com readMiscReg(int misc_reg) 1418879Ssteve.reinhardt@amd.com { 1428879Ssteve.reinhardt@amd.com return this->cpu->readMiscReg(misc_reg, this->threadNumber); 14310458Sandreas.hansson@arm.com } 14410458Sandreas.hansson@arm.com 14510458Sandreas.hansson@arm.com /** Sets a misc. register, including any side-effects the write 1468879Ssteve.reinhardt@amd.com * might have as defined by the architecture. 1478879Ssteve.reinhardt@amd.com */ 1488879Ssteve.reinhardt@amd.com void 1498879Ssteve.reinhardt@amd.com setMiscReg(int misc_reg, RegVal val) 15013421Sciro.santilli@arm.com { 15113421Sciro.santilli@arm.com /** Writes to misc. registers are recorded and deferred until the 1529227Sandreas.hansson@arm.com * commit stage, when updateMiscRegs() is called. First, check if 1539227Sandreas.hansson@arm.com * the misc reg has been written before and update its value to be 15412063Sgabeblack@google.com * committed instead of making a new entry. If not, make a new 15512063Sgabeblack@google.com * entry and record the write. 15612063Sgabeblack@google.com */ 1578879Ssteve.reinhardt@amd.com for (int idx = 0; idx < _numDestMiscRegs; idx++) { 1588879Ssteve.reinhardt@amd.com if (_destMiscRegIdx[idx] == misc_reg) { 1598879Ssteve.reinhardt@amd.com _destMiscRegVal[idx] = val; 1608879Ssteve.reinhardt@amd.com return; 16110453SAndrew.Bardsley@arm.com } 16210453SAndrew.Bardsley@arm.com } 16310453SAndrew.Bardsley@arm.com 16410456SCurtis.Dunham@arm.com assert(_numDestMiscRegs < TheISA::MaxMiscDestRegs); 16510456SCurtis.Dunham@arm.com _destMiscRegIdx[_numDestMiscRegs] = misc_reg; 16610456SCurtis.Dunham@arm.com _destMiscRegVal[_numDestMiscRegs] = val; 16710457Sandreas.hansson@arm.com _numDestMiscRegs++; 16810457Sandreas.hansson@arm.com } 16911342Sandreas.hansson@arm.com 17011342Sandreas.hansson@arm.com /** Reads a misc. register, including any side-effects the read 1718120Sgblack@eecs.umich.edu * might have as defined by the architecture. 17212063Sgabeblack@google.com */ 17312563Sgabeblack@google.com RegVal 17412063Sgabeblack@google.com readMiscRegOperand(const StaticInst *si, int idx) 17512063Sgabeblack@google.com { 1765871Snate@binkert.org const RegId& reg = si->srcRegIdx(idx); 1775871Snate@binkert.org assert(reg.isMiscReg()); 1786121Snate@binkert.org return this->cpu->readMiscReg(reg.index(), this->threadNumber); 1795871Snate@binkert.org } 1805871Snate@binkert.org 1819926Sstan.czerniawski@arm.com /** Sets a misc. register, including any side-effects the write 18212243Sgabeblack@google.com * might have as defined by the architecture. 1831533SN/A */ 18412246Sgabeblack@google.com void 18512246Sgabeblack@google.com setMiscRegOperand(const StaticInst *si, int idx, RegVal val) 18612246Sgabeblack@google.com { 18712246Sgabeblack@google.com const RegId& reg = si->destRegIdx(idx); 1889239Sandreas.hansson@arm.com assert(reg.isMiscReg()); 1899239Sandreas.hansson@arm.com setMiscReg(reg.index(), val); 1909239Sandreas.hansson@arm.com } 1919239Sandreas.hansson@arm.com 19212563Sgabeblack@google.com /** Called at the commit stage to update the misc. registers. */ 1939239Sandreas.hansson@arm.com void 1949239Sandreas.hansson@arm.com updateMiscRegs() 195955SN/A { 196955SN/A // @todo: Pretty convoluted way to avoid squashing from happening when 1972632Sstever@eecs.umich.edu // using the TC during an instruction's execution (specifically for 1982632Sstever@eecs.umich.edu // instructions that have side-effects that use the TC). Fix this. 199955SN/A // See cpu/o3/dyn_inst_impl.hh. 200955SN/A bool no_squash_from_TC = this->thread->noSquashFromTC; 201955SN/A this->thread->noSquashFromTC = true; 202955SN/A 2038878Ssteve.reinhardt@amd.com for (int i = 0; i < _numDestMiscRegs; i++) 204955SN/A this->cpu->setMiscReg( 2052632Sstever@eecs.umich.edu _destMiscRegIdx[i], _destMiscRegVal[i], this->threadNumber); 2062632Sstever@eecs.umich.edu 2072632Sstever@eecs.umich.edu this->thread->noSquashFromTC = no_squash_from_TC; 2082632Sstever@eecs.umich.edu } 2092632Sstever@eecs.umich.edu 2102632Sstever@eecs.umich.edu void forwardOldRegs() 2112632Sstever@eecs.umich.edu { 2128268Ssteve.reinhardt@amd.com 2138268Ssteve.reinhardt@amd.com for (int idx = 0; idx < this->numDestRegs(); idx++) { 2148268Ssteve.reinhardt@amd.com PhysRegIdPtr prev_phys_reg = this->prevDestRegIdx(idx); 2158268Ssteve.reinhardt@amd.com const RegId& original_dest_reg = 2168268Ssteve.reinhardt@amd.com this->staticInst->destRegIdx(idx); 2178268Ssteve.reinhardt@amd.com switch (original_dest_reg.classValue()) { 2188268Ssteve.reinhardt@amd.com case IntRegClass: 21913715Sandreas.sandberg@arm.com this->setIntRegOperand(this->staticInst.get(), idx, 22013715Sandreas.sandberg@arm.com this->cpu->readIntReg(prev_phys_reg)); 22113715Sandreas.sandberg@arm.com break; 22213715Sandreas.sandberg@arm.com case FloatRegClass: 22313715Sandreas.sandberg@arm.com this->setFloatRegOperandBits(this->staticInst.get(), idx, 22413715Sandreas.sandberg@arm.com this->cpu->readFloatRegBits(prev_phys_reg)); 22513715Sandreas.sandberg@arm.com break; 22613715Sandreas.sandberg@arm.com case VecRegClass: 22713715Sandreas.sandberg@arm.com this->setVecRegOperand(this->staticInst.get(), idx, 22813715Sandreas.sandberg@arm.com this->cpu->readVecReg(prev_phys_reg)); 22913715Sandreas.sandberg@arm.com break; 23013715Sandreas.sandberg@arm.com case VecElemClass: 23113715Sandreas.sandberg@arm.com this->setVecElemOperand(this->staticInst.get(), idx, 2322632Sstever@eecs.umich.edu this->cpu->readVecElem(prev_phys_reg)); 2332632Sstever@eecs.umich.edu break; 2342632Sstever@eecs.umich.edu case CCRegClass: 2352632Sstever@eecs.umich.edu this->setCCRegOperand(this->staticInst.get(), idx, 2368268Ssteve.reinhardt@amd.com this->cpu->readCCReg(prev_phys_reg)); 2372632Sstever@eecs.umich.edu break; 2388268Ssteve.reinhardt@amd.com case MiscRegClass: 2398268Ssteve.reinhardt@amd.com // no need to forward misc reg values 2408268Ssteve.reinhardt@amd.com break; 2418268Ssteve.reinhardt@amd.com default: 2423718Sstever@eecs.umich.edu panic("Unknown register class: %d", 2432634Sstever@eecs.umich.edu (int)original_dest_reg.classValue()); 2442634Sstever@eecs.umich.edu } 2455863Snate@binkert.org } 2462638Sstever@eecs.umich.edu } 2478268Ssteve.reinhardt@amd.com /** Calls hardware return from error interrupt. */ 2482632Sstever@eecs.umich.edu Fault hwrei(); 2492632Sstever@eecs.umich.edu /** Traps to handle specified fault. */ 2502632Sstever@eecs.umich.edu void trap(const Fault &fault); 2512632Sstever@eecs.umich.edu bool simPalCheck(int palFunc); 25212563Sgabeblack@google.com 2531858SN/A /** Emulates a syscall. */ 2543716Sstever@eecs.umich.edu void syscall(int64_t callnum, Fault *fault); 2552638Sstever@eecs.umich.edu 2562638Sstever@eecs.umich.edu public: 2572638Sstever@eecs.umich.edu 2582638Sstever@eecs.umich.edu // The register accessor methods provide the index of the 25912563Sgabeblack@google.com // instruction's operand (e.g., 0 or 1), not the architectural 26012563Sgabeblack@google.com // register index, to simplify the implementation of register 2612638Sstever@eecs.umich.edu // renaming. We find the architectural register index by indexing 2625863Snate@binkert.org // into the instruction's own operand index table. Note that a 2635863Snate@binkert.org // raw pointer to the StaticInst is provided instead of a 2645863Snate@binkert.org // ref-counted StaticInstPtr to redice overhead. This is fine as 265955SN/A // long as these methods don't copy the pointer into any long-term 2665341Sstever@gmail.com // storage (which is pretty hard to imagine they would have reason 2675341Sstever@gmail.com // to do). 2685863Snate@binkert.org 2697756SAli.Saidi@ARM.com RegVal 2705341Sstever@gmail.com readIntRegOperand(const StaticInst *si, int idx) 2716121Snate@binkert.org { 2724494Ssaidi@eecs.umich.edu return this->cpu->readIntReg(this->_srcRegIdx[idx]); 2736121Snate@binkert.org } 2741105SN/A 2752667Sstever@eecs.umich.edu RegVal 2762667Sstever@eecs.umich.edu readFloatRegOperandBits(const StaticInst *si, int idx) 2772667Sstever@eecs.umich.edu { 2782667Sstever@eecs.umich.edu return this->cpu->readFloatRegBits(this->_srcRegIdx[idx]); 2796121Snate@binkert.org } 2802667Sstever@eecs.umich.edu 2815341Sstever@gmail.com const VecRegContainer& 2825863Snate@binkert.org readVecRegOperand(const StaticInst *si, int idx) const 2835341Sstever@gmail.com { 2845341Sstever@gmail.com return this->cpu->readVecReg(this->_srcRegIdx[idx]); 2855341Sstever@gmail.com } 2868120Sgblack@eecs.umich.edu 2875341Sstever@gmail.com /** 2888120Sgblack@eecs.umich.edu * Read destination vector register operand for modification. 2895341Sstever@gmail.com */ 2908120Sgblack@eecs.umich.edu VecRegContainer& 2916121Snate@binkert.org getWritableVecRegOperand(const StaticInst *si, int idx) 2926121Snate@binkert.org { 29313715Sandreas.sandberg@arm.com return this->cpu->getWritableVecReg(this->_destRegIdx[idx]); 29413715Sandreas.sandberg@arm.com } 2959396Sandreas.hansson@arm.com 2965397Ssaidi@eecs.umich.edu /** Vector Register Lane Interfaces. */ 2975397Ssaidi@eecs.umich.edu /** @{ */ 2987727SAli.Saidi@ARM.com /** Reads source vector 8bit operand. */ 2998268Ssteve.reinhardt@amd.com ConstVecLane8 3006168Snate@binkert.org readVec8BitLaneOperand(const StaticInst *si, int idx) const 3015341Sstever@gmail.com { 3028120Sgblack@eecs.umich.edu return cpu->template readVecLane<uint8_t>(_srcRegIdx[idx]); 3038120Sgblack@eecs.umich.edu } 3048120Sgblack@eecs.umich.edu 3056814Sgblack@eecs.umich.edu /** Reads source vector 16bit operand. */ 3065863Snate@binkert.org ConstVecLane16 3078120Sgblack@eecs.umich.edu readVec16BitLaneOperand(const StaticInst *si, int idx) const 3085341Sstever@gmail.com { 3095863Snate@binkert.org return cpu->template readVecLane<uint16_t>(_srcRegIdx[idx]); 3108268Ssteve.reinhardt@amd.com } 3116121Snate@binkert.org 3126121Snate@binkert.org /** Reads source vector 32bit operand. */ 3138268Ssteve.reinhardt@amd.com ConstVecLane32 3145742Snate@binkert.org readVec32BitLaneOperand(const StaticInst *si, int idx) const 3155742Snate@binkert.org { 3165341Sstever@gmail.com return cpu->template readVecLane<uint32_t>(_srcRegIdx[idx]); 3175742Snate@binkert.org } 3185742Snate@binkert.org 3195341Sstever@gmail.com /** Reads source vector 64bit operand. */ 3206017Snate@binkert.org ConstVecLane64 3216121Snate@binkert.org readVec64BitLaneOperand(const StaticInst *si, int idx) const 3226017Snate@binkert.org { 32312158Sandreas.sandberg@arm.com return cpu->template readVecLane<uint64_t>(_srcRegIdx[idx]); 32412158Sandreas.sandberg@arm.com } 32512158Sandreas.sandberg@arm.com 3268120Sgblack@eecs.umich.edu /** Write a lane of the destination vector operand. */ 3277756SAli.Saidi@ARM.com template <typename LD> 3287756SAli.Saidi@ARM.com void 3297756SAli.Saidi@ARM.com setVecLaneOperandT(const StaticInst *si, int idx, const LD& val) 3307756SAli.Saidi@ARM.com { 3317816Ssteve.reinhardt@amd.com return cpu->template setVecLane(_destRegIdx[idx], val); 3327816Ssteve.reinhardt@amd.com } 3337816Ssteve.reinhardt@amd.com virtual void 3347816Ssteve.reinhardt@amd.com setVecLaneOperand(const StaticInst *si, int idx, 3357816Ssteve.reinhardt@amd.com const LaneData<LaneSize::Byte>& val) 33611979Sgabeblack@google.com { 3377816Ssteve.reinhardt@amd.com return setVecLaneOperandT(si, idx, val); 3387816Ssteve.reinhardt@amd.com } 3397816Ssteve.reinhardt@amd.com virtual void 3407816Ssteve.reinhardt@amd.com setVecLaneOperand(const StaticInst *si, int idx, 3417756SAli.Saidi@ARM.com const LaneData<LaneSize::TwoByte>& val) 3427756SAli.Saidi@ARM.com { 3439227Sandreas.hansson@arm.com return setVecLaneOperandT(si, idx, val); 3449227Sandreas.hansson@arm.com } 3459227Sandreas.hansson@arm.com virtual void 3469227Sandreas.hansson@arm.com setVecLaneOperand(const StaticInst *si, int idx, 3479590Sandreas@sandberg.pp.se const LaneData<LaneSize::FourByte>& val) 3489590Sandreas@sandberg.pp.se { 3499590Sandreas@sandberg.pp.se return setVecLaneOperandT(si, idx, val); 3509590Sandreas@sandberg.pp.se } 3519590Sandreas@sandberg.pp.se virtual void 3529590Sandreas@sandberg.pp.se setVecLaneOperand(const StaticInst *si, int idx, 3536654Snate@binkert.org const LaneData<LaneSize::EightByte>& val) 3546654Snate@binkert.org { 3555871Snate@binkert.org return setVecLaneOperandT(si, idx, val); 3566121Snate@binkert.org } 3578946Sandreas.hansson@arm.com /** @} */ 3589419Sandreas.hansson@arm.com 35912563Sgabeblack@google.com VecElem readVecElemOperand(const StaticInst *si, int idx) const 3603918Ssaidi@eecs.umich.edu { 3613918Ssaidi@eecs.umich.edu return this->cpu->readVecElem(this->_srcRegIdx[idx]); 3621858SN/A } 3639556Sandreas.hansson@arm.com 3649556Sandreas.hansson@arm.com CCReg readCCRegOperand(const StaticInst *si, int idx) 3659556Sandreas.hansson@arm.com { 3669556Sandreas.hansson@arm.com return this->cpu->readCCReg(this->_srcRegIdx[idx]); 36711294Sandreas.hansson@arm.com } 36811294Sandreas.hansson@arm.com 36911294Sandreas.hansson@arm.com /** @todo: Make results into arrays so they can handle multiple dest 37011294Sandreas.hansson@arm.com * registers. 37110878Sandreas.hansson@arm.com */ 37210878Sandreas.hansson@arm.com void 37311811Sbaz21@cam.ac.uk setIntRegOperand(const StaticInst *si, int idx, RegVal val) 37411811Sbaz21@cam.ac.uk { 37511811Sbaz21@cam.ac.uk this->cpu->setIntReg(this->_destRegIdx[idx], val); 37611982Sgabeblack@google.com BaseDynInst<Impl>::setIntRegOperand(si, idx, val); 37711982Sgabeblack@google.com } 37811982Sgabeblack@google.com 37913421Sciro.santilli@arm.com void 38013421Sciro.santilli@arm.com setFloatRegOperandBits(const StaticInst *si, int idx, RegVal val) 38111982Sgabeblack@google.com { 38211992Sgabeblack@google.com this->cpu->setFloatRegBits(this->_destRegIdx[idx], val); 38311982Sgabeblack@google.com BaseDynInst<Impl>::setFloatRegOperandBits(si, idx, val); 38411982Sgabeblack@google.com } 38512305Sgabeblack@google.com 38612305Sgabeblack@google.com void 38712305Sgabeblack@google.com setVecRegOperand(const StaticInst *si, int idx, 38812305Sgabeblack@google.com const VecRegContainer& val) 38912305Sgabeblack@google.com { 39012305Sgabeblack@google.com this->cpu->setVecReg(this->_destRegIdx[idx], val); 39112305Sgabeblack@google.com BaseDynInst<Impl>::setVecRegOperand(si, idx, val); 3929556Sandreas.hansson@arm.com } 39312563Sgabeblack@google.com 39412563Sgabeblack@google.com void setVecElemOperand(const StaticInst *si, int idx, 39512563Sgabeblack@google.com const VecElem val) 39612563Sgabeblack@google.com { 3979556Sandreas.hansson@arm.com int reg_idx = idx; 39812563Sgabeblack@google.com this->cpu->setVecElem(this->_destRegIdx[reg_idx], val); 39912563Sgabeblack@google.com BaseDynInst<Impl>::setVecElemOperand(si, idx, val); 4009556Sandreas.hansson@arm.com } 40112563Sgabeblack@google.com 40212563Sgabeblack@google.com void setCCRegOperand(const StaticInst *si, int idx, CCReg val) 40312563Sgabeblack@google.com { 40412563Sgabeblack@google.com this->cpu->setCCReg(this->_destRegIdx[idx], val); 40512563Sgabeblack@google.com BaseDynInst<Impl>::setCCRegOperand(si, idx, val); 40612563Sgabeblack@google.com } 40712563Sgabeblack@google.com 40812563Sgabeblack@google.com#if THE_ISA == MIPS_ISA 4099556Sandreas.hansson@arm.com RegVal 4109556Sandreas.hansson@arm.com readRegOtherThread(const RegId& misc_reg, ThreadID tid) 4116121Snate@binkert.org { 41211500Sandreas.hansson@arm.com panic("MIPS MT not defined for O3 CPU.\n"); 41310238Sandreas.hansson@arm.com return 0; 41410878Sandreas.hansson@arm.com } 4159420Sandreas.hansson@arm.com 41611500Sandreas.hansson@arm.com void 41712563Sgabeblack@google.com setRegOtherThread(const RegId& misc_reg, RegVal val, ThreadID tid) 41812563Sgabeblack@google.com { 4199420Sandreas.hansson@arm.com panic("MIPS MT not defined for O3 CPU.\n"); 4209420Sandreas.hansson@arm.com } 4219420Sandreas.hansson@arm.com#endif 4229420Sandreas.hansson@arm.com}; 42312063Sgabeblack@google.com 42412063Sgabeblack@google.com#endif // __CPU_O3_ALPHA_DYN_INST_HH__ 42512063Sgabeblack@google.com 42612063Sgabeblack@google.com