exec_context.hh (13500:6e0a2a7c6d8c) | exec_context.hh (13557:fc33e6048b25) |
---|---|
1/* 2 * Copyright (c) 2014, 2016 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 58 unchanged lines hidden (view full) --- 67 * @note The methods in this class typically take a raw pointer to the 68 * StaticInst is provided instead of a ref-counted StaticInstPtr to 69 * reduce overhead as an argument. This is fine as long as the 70 * implementation doesn't copy the pointer into any long-term storage 71 * (which is pretty hard to imagine they would have reason to do). 72 */ 73class ExecContext { 74 public: | 1/* 2 * Copyright (c) 2014, 2016 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 58 unchanged lines hidden (view full) --- 67 * @note The methods in this class typically take a raw pointer to the 68 * StaticInst is provided instead of a ref-counted StaticInstPtr to 69 * reduce overhead as an argument. This is fine as long as the 70 * implementation doesn't copy the pointer into any long-term storage 71 * (which is pretty hard to imagine they would have reason to do). 72 */ 73class ExecContext { 74 public: |
75 typedef TheISA::IntReg IntReg; | |
76 typedef TheISA::PCState PCState; | 75 typedef TheISA::PCState PCState; |
77 typedef TheISA::FloatReg FloatReg; 78 typedef TheISA::FloatRegBits FloatRegBits; 79 typedef TheISA::MiscReg MiscReg; | |
80 81 typedef TheISA::CCReg CCReg; 82 using VecRegContainer = TheISA::VecRegContainer; 83 using VecElem = TheISA::VecElem; 84 85 public: 86 /** 87 * @{ 88 * @name Integer Register Interfaces 89 * 90 */ 91 92 /** Reads an integer register. */ | 76 77 typedef TheISA::CCReg CCReg; 78 using VecRegContainer = TheISA::VecRegContainer; 79 using VecElem = TheISA::VecElem; 80 81 public: 82 /** 83 * @{ 84 * @name Integer Register Interfaces 85 * 86 */ 87 88 /** Reads an integer register. */ |
93 virtual IntReg readIntRegOperand(const StaticInst *si, int idx) = 0; | 89 virtual RegVal readIntRegOperand(const StaticInst *si, int idx) = 0; |
94 95 /** Sets an integer register to a value. */ 96 virtual void setIntRegOperand(const StaticInst *si, | 90 91 /** Sets an integer register to a value. */ 92 virtual void setIntRegOperand(const StaticInst *si, |
97 int idx, IntReg val) = 0; | 93 int idx, RegVal val) = 0; |
98 99 /** @} */ 100 101 102 /** 103 * @{ 104 * @name Floating Point Register Interfaces 105 */ 106 107 /** Reads a floating point register in its binary format, instead 108 * of by value. */ | 94 95 /** @} */ 96 97 98 /** 99 * @{ 100 * @name Floating Point Register Interfaces 101 */ 102 103 /** Reads a floating point register in its binary format, instead 104 * of by value. */ |
109 virtual FloatRegBits readFloatRegOperandBits(const StaticInst *si, 110 int idx) = 0; | 105 virtual RegVal readFloatRegOperandBits(const StaticInst *si, int idx) = 0; |
111 112 /** Sets the bits of a floating point register of single width 113 * to a binary value. */ 114 virtual void setFloatRegOperandBits(const StaticInst *si, | 106 107 /** Sets the bits of a floating point register of single width 108 * to a binary value. */ 109 virtual void setFloatRegOperandBits(const StaticInst *si, |
115 int idx, FloatRegBits val) = 0; | 110 int idx, RegVal val) = 0; |
116 117 /** @} */ 118 119 /** Vector Register Interfaces. */ 120 /** @{ */ 121 /** Reads source vector register operand. */ 122 virtual const VecRegContainer& 123 readVecRegOperand(const StaticInst *si, int idx) const = 0; --- 56 unchanged lines hidden (view full) --- 180 virtual CCReg readCCRegOperand(const StaticInst *si, int idx) = 0; 181 virtual void setCCRegOperand(const StaticInst *si, int idx, CCReg val) = 0; 182 /** @} */ 183 184 /** 185 * @{ 186 * @name Misc Register Interfaces 187 */ | 111 112 /** @} */ 113 114 /** Vector Register Interfaces. */ 115 /** @{ */ 116 /** Reads source vector register operand. */ 117 virtual const VecRegContainer& 118 readVecRegOperand(const StaticInst *si, int idx) const = 0; --- 56 unchanged lines hidden (view full) --- 175 virtual CCReg readCCRegOperand(const StaticInst *si, int idx) = 0; 176 virtual void setCCRegOperand(const StaticInst *si, int idx, CCReg val) = 0; 177 /** @} */ 178 179 /** 180 * @{ 181 * @name Misc Register Interfaces 182 */ |
188 virtual MiscReg readMiscRegOperand(const StaticInst *si, int idx) = 0; | 183 virtual RegVal readMiscRegOperand(const StaticInst *si, int idx) = 0; |
189 virtual void setMiscRegOperand(const StaticInst *si, | 184 virtual void setMiscRegOperand(const StaticInst *si, |
190 int idx, const MiscReg &val) = 0; | 185 int idx, const RegVal &val) = 0; |
191 192 /** 193 * Reads a miscellaneous register, handling any architectural 194 * side effects due to reading that register. 195 */ | 186 187 /** 188 * Reads a miscellaneous register, handling any architectural 189 * side effects due to reading that register. 190 */ |
196 virtual MiscReg readMiscReg(int misc_reg) = 0; | 191 virtual RegVal readMiscReg(int misc_reg) = 0; |
197 198 /** 199 * Sets a miscellaneous register, handling any architectural 200 * side effects due to writing that register. 201 */ | 192 193 /** 194 * Sets a miscellaneous register, handling any architectural 195 * side effects due to writing that register. 196 */ |
202 virtual void setMiscReg(int misc_reg, const MiscReg &val) = 0; | 197 virtual void setMiscReg(int misc_reg, const RegVal &val) = 0; |
203 204 /** @} */ 205 206 /** 207 * @{ 208 * @name PC Control 209 */ 210 virtual PCState pcState() const = 0; --- 110 unchanged lines hidden (view full) --- 321 /** @} */ 322 323 /** 324 * @{ 325 * @name MIPS-Specific Interfaces 326 */ 327 328#if THE_ISA == MIPS_ISA | 198 199 /** @} */ 200 201 /** 202 * @{ 203 * @name PC Control 204 */ 205 virtual PCState pcState() const = 0; --- 110 unchanged lines hidden (view full) --- 316 /** @} */ 317 318 /** 319 * @{ 320 * @name MIPS-Specific Interfaces 321 */ 322 323#if THE_ISA == MIPS_ISA |
329 virtual MiscReg readRegOtherThread(const RegId& reg, 330 ThreadID tid = InvalidThreadID) = 0; 331 virtual void setRegOtherThread(const RegId& reg, MiscReg val, 332 ThreadID tid = InvalidThreadID) = 0; | 324 virtual RegVal readRegOtherThread(const RegId ®, 325 ThreadID tid=InvalidThreadID) = 0; 326 virtual void setRegOtherThread(const RegId& reg, RegVal val, 327 ThreadID tid=InvalidThreadID) = 0; |
333#endif 334 335 /** @} */ 336}; 337 338#endif // __CPU_EXEC_CONTEXT_HH__ | 328#endif 329 330 /** @} */ 331}; 332 333#endif // __CPU_EXEC_CONTEXT_HH__ |