gem5  v22.1.0.0
operand.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017-2021 Advanced Micro Devices, Inc.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright notice,
9  * this list of conditions and the following disclaimer.
10  *
11  * 2. Redistributions in binary form must reproduce the above copyright notice,
12  * this list of conditions and the following disclaimer in the documentation
13  * and/or other materials provided with the distribution.
14  *
15  * 3. Neither the name of the copyright holder nor the names of its
16  * contributors may be used to endorse or promote products derived from this
17  * software without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29  * POSSIBILITY OF SUCH DAMAGE.
30  */
31 
32 #ifndef __ARCH_VEGA_OPERAND_HH__
33 #define __ARCH_VEGA_OPERAND_HH__
34 
35 #include <array>
36 
38 #include "arch/generic/vec_reg.hh"
41 #include "gpu-compute/wavefront.hh"
42 
43 namespace gem5
44 {
45 
52 namespace VegaISA
53 {
59  template<typename T> struct OpTraits { typedef float FloatT; };
60  template<> struct OpTraits<ScalarRegF64> { typedef double FloatT; };
61  template<> struct OpTraits<ScalarRegU64> { typedef double FloatT; };
62 
63  class Operand
64  {
65  public:
66  Operand() = delete;
67 
68  Operand(GPUDynInstPtr gpuDynInst, int opIdx)
69  : _gpuDynInst(gpuDynInst), _opIdx(opIdx)
70  {
71  assert(_gpuDynInst);
72  assert(_opIdx >= 0);
73  }
74 
79  virtual void read() = 0;
80  virtual void write() = 0;
81 
82  protected:
93  int _opIdx;
94  };
95 
96  template<typename DataType, bool Const, size_t NumDwords>
97  class ScalarOperand;
98 
99  template<typename DataType, bool Const,
100  size_t NumDwords = sizeof(DataType) / sizeof(VecElemU32)>
101  class VecOperand final : public Operand
102  {
103  static_assert(NumDwords >= 1 && NumDwords <= MaxOperandDwords,
104  "Incorrect number of DWORDS for VEGA operand.");
105 
106  public:
107  VecOperand() = delete;
108 
109  VecOperand(GPUDynInstPtr gpuDynInst, int opIdx)
110  : Operand(gpuDynInst, opIdx), scalar(false), absMod(false),
111  negMod(false), scRegData(gpuDynInst, _opIdx),
112  vrfData{{ nullptr }}
113  {
114  vecReg.zero();
115  }
116 
118  {
119  }
120 
129  void
131  {
132  if (isVectorReg(_opIdx)) {
133  _opIdx = opSelectorToRegIdx(_opIdx, _gpuDynInst->wavefront()
134  ->reservedScalarRegs);
135  read();
136  } else {
137  readScalar();
138  }
139  }
140 
145  void
146  read() override
147  {
148  assert(_gpuDynInst);
149  assert(_gpuDynInst->wavefront());
150  assert(_gpuDynInst->computeUnit());
151  Wavefront *wf = _gpuDynInst->wavefront();
152  ComputeUnit *cu = _gpuDynInst->computeUnit();
153 
154  for (auto i = 0; i < NumDwords; ++i) {
155  int vgprIdx = cu->registerManager->mapVgpr(wf, _opIdx + i);
156  vrfData[i] = &cu->vrf[wf->simdId]->readWriteable(vgprIdx);
157 
158  DPRINTF(GPUVRF, "Read v[%d]\n", vgprIdx);
159  cu->vrf[wf->simdId]->printReg(wf, vgprIdx);
160  }
161 
162  if (NumDwords == 1) {
163  assert(vrfData[0]);
164  auto vgpr = vecReg.template as<DataType>();
165  auto reg_file_vgpr = vrfData[0]->template as<VecElemU32>();
166  for (int lane = 0; lane < NumVecElemPerVecReg; ++lane) {
167  std::memcpy((void*)&vgpr[lane],
168  (void*)&reg_file_vgpr[lane], sizeof(DataType));
169  }
170  } else if (NumDwords == 2) {
171  assert(vrfData[0]);
172  assert(vrfData[1]);
173  auto vgpr = vecReg.template as<VecElemU64>();
174  auto reg_file_vgpr0 = vrfData[0]->template as<VecElemU32>();
175  auto reg_file_vgpr1 = vrfData[1]->template as<VecElemU32>();
176 
177  for (int lane = 0; lane < NumVecElemPerVecReg; ++lane) {
178  VecElemU64 tmp_val(0);
179  ((VecElemU32*)&tmp_val)[0] = reg_file_vgpr0[lane];
180  ((VecElemU32*)&tmp_val)[1] = reg_file_vgpr1[lane];
181  vgpr[lane] = tmp_val;
182  }
183  }
184  }
185 
197  void
198  write() override
199  {
200  assert(_gpuDynInst);
201  assert(_gpuDynInst->wavefront());
202  assert(_gpuDynInst->computeUnit());
203  Wavefront *wf = _gpuDynInst->wavefront();
204  ComputeUnit *cu = _gpuDynInst->computeUnit();
205  VectorMask &exec_mask = _gpuDynInst->isLoad()
206  ? _gpuDynInst->exec_mask : wf->execMask();
207 
208  if (NumDwords == 1) {
209  int vgprIdx = cu->registerManager->mapVgpr(wf, _opIdx);
210  vrfData[0] = &cu->vrf[wf->simdId]->readWriteable(vgprIdx);
211  assert(vrfData[0]);
212  auto reg_file_vgpr = vrfData[0]->template as<VecElemU32>();
213  auto vgpr = vecReg.template as<DataType>();
214 
215  for (int lane = 0; lane < NumVecElemPerVecReg; ++lane) {
216  if (exec_mask[lane] || _gpuDynInst->ignoreExec()) {
217  std::memcpy((void*)&reg_file_vgpr[lane],
218  (void*)&vgpr[lane], sizeof(DataType));
219  }
220  }
221 
222  DPRINTF(GPUVRF, "Write v[%d]\n", vgprIdx);
223  cu->vrf[wf->simdId]->printReg(wf, vgprIdx);
224  } else if (NumDwords == 2) {
225  int vgprIdx0 = cu->registerManager->mapVgpr(wf, _opIdx);
226  int vgprIdx1 = cu->registerManager->mapVgpr(wf, _opIdx + 1);
227  vrfData[0] = &cu->vrf[wf->simdId]->readWriteable(vgprIdx0);
228  vrfData[1] = &cu->vrf[wf->simdId]->readWriteable(vgprIdx1);
229  assert(vrfData[0]);
230  assert(vrfData[1]);
231  auto reg_file_vgpr0 = vrfData[0]->template as<VecElemU32>();
232  auto reg_file_vgpr1 = vrfData[1]->template as<VecElemU32>();
233  auto vgpr = vecReg.template as<VecElemU64>();
234 
235  for (int lane = 0; lane < NumVecElemPerVecReg; ++lane) {
236  if (exec_mask[lane] || _gpuDynInst->ignoreExec()) {
237  reg_file_vgpr0[lane] = ((VecElemU32*)&vgpr[lane])[0];
238  reg_file_vgpr1[lane] = ((VecElemU32*)&vgpr[lane])[1];
239  }
240  }
241 
242  DPRINTF(GPUVRF, "Write v[%d:%d]\n", vgprIdx0, vgprIdx1);
243  cu->vrf[wf->simdId]->printReg(wf, vgprIdx0);
244  cu->vrf[wf->simdId]->printReg(wf, vgprIdx1);
245  }
246  }
247 
248  void
250  {
251  negMod = true;
252  }
253 
254  void
256  {
257  absMod = true;
258  }
259 
265  template<bool Condition = (NumDwords == 1 || NumDwords == 2) && Const>
267  operator[](size_t idx) const
268  {
269  assert(idx < NumVecElemPerVecReg);
270 
271  if (scalar) {
272  DataType ret_val = scRegData.rawData();
273 
274  if (absMod) {
275  assert(std::is_floating_point_v<DataType>);
276  ret_val = std::fabs(ret_val);
277  }
278 
279  if (negMod) {
280  assert(std::is_floating_point_v<DataType>);
281  ret_val = -ret_val;
282  }
283 
284  return ret_val;
285  } else {
286  auto vgpr = vecReg.template as<DataType>();
287  DataType ret_val = vgpr[idx];
288 
289  if (absMod) {
290  assert(std::is_floating_point_v<DataType>);
291  ret_val = std::fabs(ret_val);
292  }
293 
294  if (negMod) {
295  assert(std::is_floating_point_v<DataType>);
296  ret_val = -ret_val;
297  }
298 
299  return ret_val;
300  }
301  }
302 
308  template<bool Condition = (NumDwords == 1 || NumDwords == 2) && !Const>
310  operator[](size_t idx)
311  {
312  assert(!scalar);
313  assert(idx < NumVecElemPerVecReg);
314 
315  return vecReg.template as<DataType>()[idx];
316  }
317 
318  private:
323  void
325  {
326  scalar = true;
327  scRegData.read();
328  }
329 
330  using VecRegCont =
331  VecRegContainer<sizeof(DataType) * NumVecElemPerVecReg>;
332 
336  bool scalar;
343  bool absMod;
344  bool negMod;
360  std::array<VecRegContainerU32*, NumDwords> vrfData;
361  };
362 
363  template<typename DataType, bool Const,
364  size_t NumDwords = sizeof(DataType) / sizeof(ScalarRegU32)>
365  class ScalarOperand final : public Operand
366  {
367  static_assert(NumDwords >= 1 && NumDwords <= MaxOperandDwords,
368  "Incorrect number of DWORDS for VEGA operand.");
369  public:
370  ScalarOperand() = delete;
371 
372  ScalarOperand(GPUDynInstPtr gpuDynInst, int opIdx)
373  : Operand(gpuDynInst, opIdx)
374  {
375  std::memset(srfData.data(), 0, NumDwords * sizeof(ScalarRegU32));
376  }
377 
379  {
380  }
381 
389  template<bool Condition = NumDwords == 1 || NumDwords == 2>
391  rawData() const
392  {
393  assert(sizeof(DataType) <= sizeof(srfData));
394  DataType raw_data((DataType)0);
395  std::memcpy((void*)&raw_data, (void*)srfData.data(),
396  sizeof(DataType));
397 
398  return raw_data;
399  }
400 
401  void*
403  {
404  return (void*)srfData.data();
405  }
406 
407  void
408  read() override
409  {
410  Wavefront *wf = _gpuDynInst->wavefront();
411  ComputeUnit *cu = _gpuDynInst->computeUnit();
412 
413  if (!isScalarReg(_opIdx)) {
414  readSpecialVal();
415  } else {
416  for (auto i = 0; i < NumDwords; ++i) {
417  int sgprIdx = regIdx(i);
418  srfData[i] = cu->srf[wf->simdId]->read(sgprIdx);
419  DPRINTF(GPUSRF, "Read s[%d]\n", sgprIdx);
420  cu->srf[wf->simdId]->printReg(wf, sgprIdx);
421  }
422  }
423  }
424 
425  void
426  write() override
427  {
428  Wavefront *wf = _gpuDynInst->wavefront();
429  ComputeUnit *cu = _gpuDynInst->computeUnit();
430 
431  if (!isScalarReg(_opIdx)) {
432  if (_opIdx == REG_EXEC_LO) {
433  ScalarRegU64 new_exec_mask_val
434  = wf->execMask().to_ullong();
435  if (NumDwords == 1) {
436  std::memcpy((void*)&new_exec_mask_val,
437  (void*)srfData.data(), sizeof(VecElemU32));
438  } else if (NumDwords == 2) {
439  std::memcpy((void*)&new_exec_mask_val,
440  (void*)srfData.data(), sizeof(VecElemU64));
441  } else {
442  panic("Trying to write more than 2 DWORDS to EXEC\n");
443  }
444  VectorMask new_exec_mask(new_exec_mask_val);
445  wf->execMask() = new_exec_mask;
446  DPRINTF(GPUSRF, "Write EXEC\n");
447  DPRINTF(GPUSRF, "EXEC = %#x\n", new_exec_mask_val);
448  } else if (_opIdx == REG_EXEC_HI) {
453  assert(NumDwords == 1);
454  ScalarRegU32 new_exec_mask_hi_val(0);
455  ScalarRegU64 new_exec_mask_val
456  = wf->execMask().to_ullong();
457  std::memcpy((void*)&new_exec_mask_hi_val,
458  (void*)srfData.data(), sizeof(new_exec_mask_hi_val));
459  replaceBits(new_exec_mask_val, 63, 32,
460  new_exec_mask_hi_val);
461  VectorMask new_exec_mask(new_exec_mask_val);
462  wf->execMask() = new_exec_mask;
463  DPRINTF(GPUSRF, "Write EXEC\n");
464  DPRINTF(GPUSRF, "EXEC = %#x\n", new_exec_mask_val);
465  } else {
466  _gpuDynInst->writeMiscReg(_opIdx, srfData[0]);
467  }
468  } else {
469  for (auto i = 0; i < NumDwords; ++i) {
470  int sgprIdx = regIdx(i);
471  auto &sgpr = cu->srf[wf->simdId]->readWriteable(sgprIdx);
472  if (_gpuDynInst->isLoad()) {
473  assert(sizeof(DataType) <= sizeof(ScalarRegU64));
474  sgpr = reinterpret_cast<ScalarRegU32*>(
475  _gpuDynInst->scalar_data)[i];
476  } else {
477  sgpr = srfData[i];
478  }
479  DPRINTF(GPUSRF, "Write s[%d]\n", sgprIdx);
480  cu->srf[wf->simdId]->printReg(wf, sgprIdx);
481  }
482  }
483  }
484 
488  template<bool Condition = NumDwords == 1 || NumDwords == 2>
490  setBit(int bit, int bit_val)
491  {
492  DataType &sgpr = *((DataType*)srfData.data());
493  replaceBits(sgpr, bit, bit_val);
494  }
495 
496  template<bool Condition = (NumDwords == 1 || NumDwords == 2) && !Const>
498  operator=(DataType rhs)
499  {
500  std::memcpy((void*)srfData.data(), (void*)&rhs, sizeof(DataType));
501  return *this;
502  }
503 
504  private:
511  void
513  {
514  assert(NumDwords == 1 || NumDwords == 2);
515 
516  switch(_opIdx) {
517  case REG_EXEC_LO:
518  {
519  ScalarRegU64 exec_mask = _gpuDynInst->wavefront()->
520  execMask().to_ullong();
521  std::memcpy((void*)srfData.data(), (void*)&exec_mask,
522  sizeof(exec_mask));
523  DPRINTF(GPUSRF, "Read EXEC\n");
524  DPRINTF(GPUSRF, "EXEC = %#x\n", exec_mask);
525  }
526  break;
527  case REG_EXEC_HI:
528  {
533  assert(NumDwords == 1);
534  ScalarRegU64 exec_mask = _gpuDynInst->wavefront()
535  ->execMask().to_ullong();
536 
537  ScalarRegU32 exec_mask_hi = bits(exec_mask, 63, 32);
538  std::memcpy((void*)srfData.data(), (void*)&exec_mask_hi,
539  sizeof(exec_mask_hi));
540  DPRINTF(GPUSRF, "Read EXEC_HI\n");
541  DPRINTF(GPUSRF, "EXEC_HI = %#x\n", exec_mask_hi);
542  }
543  break;
544  case REG_SRC_SWDA:
545  case REG_SRC_DPP:
546  case REG_SRC_LITERAL:
547  assert(NumDwords == 1);
548  srfData[0] = _gpuDynInst->srcLiteral();
549  break;
550  case REG_POS_HALF:
551  {
552  typename OpTraits<DataType>::FloatT pos_half = 0.5;
553  std::memcpy((void*)srfData.data(), (void*)&pos_half,
554  sizeof(pos_half));
555 
556  }
557  break;
558  case REG_NEG_HALF:
559  {
560  typename OpTraits<DataType>::FloatT neg_half = -0.5;
561  std::memcpy((void*)srfData.data(), (void*)&neg_half,
562  sizeof(neg_half));
563  }
564  break;
565  case REG_POS_ONE:
566  {
567  typename OpTraits<DataType>::FloatT pos_one = 1.0;
568  std::memcpy(srfData.data(), &pos_one, sizeof(pos_one));
569  }
570  break;
571  case REG_NEG_ONE:
572  {
573  typename OpTraits<DataType>::FloatT neg_one = -1.0;
574  std::memcpy(srfData.data(), &neg_one, sizeof(neg_one));
575  }
576  break;
577  case REG_POS_TWO:
578  {
579  typename OpTraits<DataType>::FloatT pos_two = 2.0;
580  std::memcpy(srfData.data(), &pos_two, sizeof(pos_two));
581  }
582  break;
583  case REG_NEG_TWO:
584  {
585  typename OpTraits<DataType>::FloatT neg_two = -2.0;
586  std::memcpy(srfData.data(), &neg_two, sizeof(neg_two));
587  }
588  break;
589  case REG_POS_FOUR:
590  {
591  typename OpTraits<DataType>::FloatT pos_four = 4.0;
592  std::memcpy(srfData.data(), &pos_four, sizeof(pos_four));
593  }
594  break;
595  case REG_NEG_FOUR:
596  {
597  typename OpTraits<DataType>::FloatT neg_four = -4.0;
598  std::memcpy((void*)srfData.data(), (void*)&neg_four ,
599  sizeof(neg_four));
600  }
601  break;
602  case REG_PI:
603  {
604  assert(sizeof(DataType) == sizeof(ScalarRegF64)
605  || sizeof(DataType) == sizeof(ScalarRegF32));
606 
607  const ScalarRegU32 pi_u32(0x3e22f983UL);
608  const ScalarRegU64 pi_u64(0x3fc45f306dc9c882ULL);
609 
610  if (sizeof(DataType) == sizeof(ScalarRegF64)) {
611  std::memcpy((void*)srfData.data(),
612  (void*)&pi_u64, sizeof(pi_u64));
613  } else {
614  std::memcpy((void*)srfData.data(),
615  (void*)&pi_u32, sizeof(pi_u32));
616  }
617  }
618  break;
619  default:
620  {
621  assert(sizeof(DataType) <= sizeof(srfData));
622  DataType misc_val(0);
623  if (isConstVal(_opIdx)) {
624  misc_val = (DataType)_gpuDynInst
625  ->readConstVal<DataType>(_opIdx);
626  } else {
627  misc_val = (DataType)_gpuDynInst->readMiscReg(_opIdx);
628  }
629  std::memcpy((void*)srfData.data(), (void*)&misc_val,
630  sizeof(DataType));
631  }
632  }
633  }
634 
640  int
641  regIdx(int dword) const
642  {
643  Wavefront *wf = _gpuDynInst->wavefront();
644  ComputeUnit *cu = _gpuDynInst->computeUnit();
645  int sgprIdx(-1);
646 
647  if (_opIdx == REG_VCC_HI) {
648  sgprIdx = cu->registerManager
649  ->mapSgpr(wf, wf->reservedScalarRegs - 1 + dword);
650  } else if (_opIdx == REG_VCC_LO) {
651  sgprIdx = cu->registerManager
652  ->mapSgpr(wf, wf->reservedScalarRegs - 2 + dword);
653  } else if (_opIdx == REG_FLAT_SCRATCH_HI) {
654  sgprIdx = cu->registerManager
655  ->mapSgpr(wf, wf->reservedScalarRegs - 3 + dword);
656  } else if (_opIdx == REG_FLAT_SCRATCH_LO) {
657  assert(NumDwords == 1);
658  sgprIdx = cu->registerManager
659  ->mapSgpr(wf, wf->reservedScalarRegs - 4 + dword);
660  } else {
661  sgprIdx = cu->registerManager->mapSgpr(wf, _opIdx + dword);
662  }
663 
664  assert(sgprIdx > -1);
665 
666  return sgprIdx;
667  }
668 
677  std::array<ScalarRegU32, NumDwords> srfData;
678  };
679 
680  // typedefs for the various sizes/types of scalar operands
694  // non-writeable versions of scalar operands
708  // typedefs for the various sizes/types of vector operands
723  // non-writeable versions of vector operands
738 }
739 
740 } // namespace gem5
741 
742 #endif // __ARCH_VEGA_OPERAND_HH__
#define DPRINTF(x,...)
Definition: trace.hh:186
std::vector< ScalarRegisterFile * > srf
RegisterManager * registerManager
std::vector< VectorRegisterFile * > vrf
int mapVgpr(Wavefront *w, int vgprIndex)
int mapSgpr(Wavefront *w, int sgprIndex)
virtual void write()=0
Operand(GPUDynInstPtr gpuDynInst, int opIdx)
Definition: operand.hh:68
GPUDynInstPtr _gpuDynInst
instruction object that owns this operand
Definition: operand.hh:86
int _opIdx
op selector value for this operand.
Definition: operand.hh:93
virtual void read()=0
read from and write to the underlying register(s) that this operand is referring to.
std::array< ScalarRegU32, NumDwords > srfData
in VEGA each register is represented as a 32b unsigned value, however operands may require up to 16 r...
Definition: operand.hh:677
std::enable_if< Condition, void >::type setBit(int bit, int bit_val)
bit access to scalar data.
Definition: operand.hh:490
std::enable_if< Condition, DataType >::type rawData() const
we store scalar data in a std::array, however if we need the full operand data we use this method to ...
Definition: operand.hh:391
void write() override
Definition: operand.hh:426
std::enable_if< Condition, ScalarOperand & >::type operator=(DataType rhs)
Definition: operand.hh:498
int regIdx(int dword) const
for scalars we need to do some extra work to figure out how to map the op selector to the sgpr idx be...
Definition: operand.hh:641
void read() override
read from and write to the underlying register(s) that this operand is referring to.
Definition: operand.hh:408
void readSpecialVal()
we have determined that we are not reading our scalar operand data from the register file,...
Definition: operand.hh:512
ScalarOperand(GPUDynInstPtr gpuDynInst, int opIdx)
Definition: operand.hh:372
VecRegCont vecReg
this holds all the operand data in a single vector register object (i.e., if an operand is 64b,...
Definition: operand.hh:350
bool scalar
whether this operand a scalar or not.
Definition: operand.hh:336
void read() override
read from the vrf.
Definition: operand.hh:146
void readSrc()
certain vector operands can read from the vrf/srf or constants.
Definition: operand.hh:130
std::array< VecRegContainerU32 *, NumDwords > vrfData
pointers to the underlyding registers (i.e., the actual registers in the register file).
Definition: operand.hh:360
std::enable_if< Condition, DataType & >::type operator[](size_t idx)
setter [] operator.
Definition: operand.hh:310
std::enable_if< Condition, const DataType >::type operator[](size_t idx) const
getter [] operator.
Definition: operand.hh:267
bool absMod
absolute value and negative modifiers.
Definition: operand.hh:343
void write() override
write to the vrf.
Definition: operand.hh:198
ScalarOperand< DataType, Const, NumDwords > scRegData
for src operands that read scalars (i.e., scalar regs or a scalar constant).
Definition: operand.hh:355
void readScalar()
if we determine that this operand is a scalar (reg or constant) then we read the scalar data into the...
Definition: operand.hh:324
VecOperand(GPUDynInstPtr gpuDynInst, int opIdx)
Definition: operand.hh:109
int reservedScalarRegs
Definition: wavefront.hh:196
const int simdId
Definition: wavefront.hh:99
VectorMask & execMask()
Definition: wavefront.cc:1399
constexpr T bits(T val, unsigned first, unsigned last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
Definition: bitfield.hh:76
constexpr void replaceBits(T &val, unsigned first, unsigned last, B bit_val)
A convenience function to replace bits first to last of val with bit_val in place.
Definition: bitfield.hh:197
#define panic(...)
This implements a cprintf based panic() function.
Definition: logging.hh:178
Bitfield< 7 > i
Definition: misc_types.hh:67
bool isScalarReg(int opIdx)
Definition: registers.cc:219
constexpr size_t MaxOperandDwords(16)
bool isConstVal(int opIdx)
Definition: registers.cc:188
bool isVectorReg(int opIdx)
Definition: registers.cc:241
uint64_t ScalarRegU64
int opSelectorToRegIdx(int opIdx, int numScalarRegs)
Definition: registers.cc:125
uint32_t VecElemU32
const int NumVecElemPerVecReg(64)
uint64_t VecElemU64
constexpr size_t MaxOperandDwords(16)
uint32_t ScalarRegU32
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
std::shared_ptr< GPUDynInst > GPUDynInstPtr
Definition: misc.hh:49
std::bitset< std::numeric_limits< unsigned long long >::digits > VectorMask
Definition: misc.hh:45
convenience traits so we can automatically infer the correct FP type without looking at the number of...
Definition: operand.hh:59
Vector Registers layout specification.

Generated on Wed Dec 21 2022 10:22:23 for gem5 by doxygen 1.9.1