gem5 v23.0.0.1
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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_GCN3_OPERAND_HH__
33#define __ARCH_GCN3_OPERAND_HH__
34
35#include <array>
36
42
43namespace gem5
44{
45
52namespace Gcn3ISA
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 GCN3 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>
266 typename std::enable_if_t<Condition, const DataType>
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>
309 typename std::enable_if_t<Condition, DataType&>
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
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 GCN3 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>
390 typename std::enable_if_t<Condition, DataType>
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>
489 typename std::enable_if_t<Condition, void>
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>
497 typename std::enable_if_t<Condition, ScalarOperand&>
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 if (NumDwords == 1) {
520 ScalarRegU32 exec_mask = _gpuDynInst->wavefront()->
521 execMask().to_ulong();
522 std::memcpy((void*)srfData.data(), (void*)&exec_mask,
523 sizeof(exec_mask));
524 DPRINTF(GPUSRF, "Read EXEC\n");
525 DPRINTF(GPUSRF, "EXEC = %#x\n", exec_mask);
526 } else {
527 assert(NumDwords == 2);
528 ScalarRegU64 exec_mask = _gpuDynInst->wavefront()->
529 execMask().to_ullong();
530 std::memcpy((void*)srfData.data(), (void*)&exec_mask,
531 sizeof(exec_mask));
532 DPRINTF(GPUSRF, "Read EXEC\n");
533 DPRINTF(GPUSRF, "EXEC = %#x\n", exec_mask);
534 }
535 }
536 break;
537 case REG_EXEC_HI:
538 {
543 assert(NumDwords == 1);
544 ScalarRegU64 exec_mask = _gpuDynInst->wavefront()
545 ->execMask().to_ullong();
546
547 ScalarRegU32 exec_mask_hi = bits(exec_mask, 63, 32);
548 std::memcpy((void*)srfData.data(), (void*)&exec_mask_hi,
549 sizeof(exec_mask_hi));
550 DPRINTF(GPUSRF, "Read EXEC_HI\n");
551 DPRINTF(GPUSRF, "EXEC_HI = %#x\n", exec_mask_hi);
552 }
553 break;
554 case REG_SRC_SWDA:
555 case REG_SRC_DPP:
556 case REG_SRC_LITERAL:
557 assert(NumDwords == 1);
558 srfData[0] = _gpuDynInst->srcLiteral();
559 break;
560 case REG_POS_HALF:
561 {
562 typename OpTraits<DataType>::FloatT pos_half = 0.5;
563 std::memcpy((void*)srfData.data(), (void*)&pos_half,
564 sizeof(pos_half));
565
566 }
567 break;
568 case REG_NEG_HALF:
569 {
570 typename OpTraits<DataType>::FloatT neg_half = -0.5;
571 std::memcpy((void*)srfData.data(), (void*)&neg_half,
572 sizeof(neg_half));
573 }
574 break;
575 case REG_POS_ONE:
576 {
577 typename OpTraits<DataType>::FloatT pos_one = 1.0;
578 std::memcpy(srfData.data(), &pos_one, sizeof(pos_one));
579 }
580 break;
581 case REG_NEG_ONE:
582 {
583 typename OpTraits<DataType>::FloatT neg_one = -1.0;
584 std::memcpy(srfData.data(), &neg_one, sizeof(neg_one));
585 }
586 break;
587 case REG_POS_TWO:
588 {
589 typename OpTraits<DataType>::FloatT pos_two = 2.0;
590 std::memcpy(srfData.data(), &pos_two, sizeof(pos_two));
591 }
592 break;
593 case REG_NEG_TWO:
594 {
595 typename OpTraits<DataType>::FloatT neg_two = -2.0;
596 std::memcpy(srfData.data(), &neg_two, sizeof(neg_two));
597 }
598 break;
599 case REG_POS_FOUR:
600 {
601 typename OpTraits<DataType>::FloatT pos_four = 4.0;
602 std::memcpy(srfData.data(), &pos_four, sizeof(pos_four));
603 }
604 break;
605 case REG_NEG_FOUR:
606 {
607 typename OpTraits<DataType>::FloatT neg_four = -4.0;
608 std::memcpy((void*)srfData.data(), (void*)&neg_four ,
609 sizeof(neg_four));
610 }
611 break;
612 case REG_PI:
613 {
614 assert(sizeof(DataType) == sizeof(ScalarRegF64)
615 || sizeof(DataType) == sizeof(ScalarRegF32));
616
617 const ScalarRegU32 pi_u32(0x3e22f983UL);
618 const ScalarRegU64 pi_u64(0x3fc45f306dc9c882ULL);
619
620 if (sizeof(DataType) == sizeof(ScalarRegF64)) {
621 std::memcpy((void*)srfData.data(),
622 (void*)&pi_u64, sizeof(pi_u64));
623 } else {
624 std::memcpy((void*)srfData.data(),
625 (void*)&pi_u32, sizeof(pi_u32));
626 }
627 }
628 break;
629 default:
630 {
631 assert(sizeof(DataType) <= sizeof(srfData));
632 DataType misc_val(0);
633 if (isConstVal(_opIdx)) {
634 misc_val = (DataType)_gpuDynInst
635 ->readConstVal<DataType>(_opIdx);
636 } else {
637 misc_val = (DataType)_gpuDynInst->readMiscReg(_opIdx);
638 }
639 std::memcpy((void*)srfData.data(), (void*)&misc_val,
640 sizeof(DataType));
641 }
642 }
643 }
644
650 int
651 regIdx(int dword) const
652 {
653 Wavefront *wf = _gpuDynInst->wavefront();
654 ComputeUnit *cu = _gpuDynInst->computeUnit();
655 int sgprIdx(-1);
656
657 if (_opIdx == REG_VCC_HI) {
658 sgprIdx = cu->registerManager
659 ->mapSgpr(wf, wf->reservedScalarRegs - 1 + dword);
660 } else if (_opIdx == REG_VCC_LO) {
661 sgprIdx = cu->registerManager
662 ->mapSgpr(wf, wf->reservedScalarRegs - 2 + dword);
663 } else if (_opIdx == REG_FLAT_SCRATCH_HI) {
664 sgprIdx = cu->registerManager
665 ->mapSgpr(wf, wf->reservedScalarRegs - 3 + dword);
666 } else if (_opIdx == REG_FLAT_SCRATCH_LO) {
667 assert(NumDwords == 1);
668 sgprIdx = cu->registerManager
669 ->mapSgpr(wf, wf->reservedScalarRegs - 4 + dword);
670 } else {
671 sgprIdx = cu->registerManager->mapSgpr(wf, _opIdx + dword);
672 }
673
674 assert(sgprIdx > -1);
675
676 return sgprIdx;
677 }
678
687 std::array<ScalarRegU32, NumDwords> srfData;
688 };
689
690 // typedefs for the various sizes/types of scalar operands
704 // non-writeable versions of scalar operands
718 // typedefs for the various sizes/types of vector operands
733 // non-writeable versions of vector operands
748}
749
750} // namespace gem5
751
752#endif // __ARCH_GCN3_OPERAND_HH__
#define DPRINTF(x,...)
Definition trace.hh:210
std::vector< ScalarRegisterFile * > srf
RegisterManager * registerManager
std::vector< VectorRegisterFile * > vrf
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 write()=0
virtual void read()=0
read from and write to the underlying register(s) that this operand is referring to.
std::enable_if_t< Condition, void > setBit(int bit, int bit_val)
bit access to scalar data.
Definition operand.hh:490
std::enable_if_t< Condition, DataType > 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 read() override
read from and write to the underlying register(s) that this operand is referring to.
Definition operand.hh:408
std::array< ScalarRegU32, NumDwords > srfData
in GCN3 each register is represented as a 32b unsigned value, however operands may require up to 16 r...
Definition operand.hh:687
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
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:651
std::enable_if_t< Condition, ScalarOperand & > operator=(DataType rhs)
Definition operand.hh:498
void readSrc()
certain vector operands can read from the vrf/srf or constants.
Definition operand.hh:130
std::enable_if_t< Condition, DataType & > operator[](size_t idx)
setter [] operator.
Definition operand.hh:310
VecOperand(GPUDynInstPtr gpuDynInst, int opIdx)
Definition operand.hh:109
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 read() override
read from the vrf.
Definition operand.hh:146
std::enable_if_t< Condition, const DataType > operator[](size_t idx) const
getter [] operator.
Definition operand.hh:267
bool absMod
absolute value and negative modifiers.
Definition operand.hh:343
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
std::array< VecRegContainerU32 *, NumDwords > vrfData
pointers to the underlyding registers (i.e., the actual registers in the register file).
Definition operand.hh:360
bool scalar
whether this operand a scalar or not.
Definition operand.hh:336
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
int mapVgpr(Wavefront *w, int vgprIndex)
int mapSgpr(Wavefront *w, int sgprIndex)
const int simdId
Definition wavefront.hh:99
VectorMask & execMask()
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:213
#define panic(...)
This implements a cprintf based panic() function.
Definition logging.hh:188
Bitfield< 7 > i
Definition misc_types.hh:67
constexpr unsigned NumVecElemPerVecReg
Definition vec.hh:61
uint64_t VecElemU64
int opSelectorToRegIdx(int opIdx, int numScalarRegs)
Definition registers.cc:125
bool isScalarReg(int opIdx)
Definition registers.cc:219
uint32_t ScalarRegU32
constexpr size_t MaxOperandDwords(16)
bool isVectorReg(int opIdx)
Definition registers.cc:232
bool isConstVal(int opIdx)
Definition registers.cc:188
uint64_t ScalarRegU64
uint32_t VecElemU32
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:48
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 Mon Jul 10 2023 15:31:56 for gem5 by doxygen 1.9.7