36 #ifndef __ARCH_HSAIL_INSTS_MEM_HH__
37 #define __ARCH_HSAIL_INSTS_MEM_HH__
39 #include <type_traits>
55 if (m_type == Enums::M_U64 ||
56 m_type == Enums::M_S64 ||
57 m_type == Enums::M_F64) {
59 }
else if (m_type == Enums::M_U32 ||
60 m_type == Enums::M_S32 ||
61 m_type == Enums::M_F32) {
63 }
else if (m_type == Enums::M_U16 ||
64 m_type == Enums::M_S16 ||
65 m_type == Enums::M_F16) {
89 template<
typename DestOperandType,
typename AddrOperandType>
93 typename DestOperandType::DestOperand
dest;
100 using namespace Brig;
105 dest.init(op_offs, obj);
107 addr.init(op_offs, obj);
111 {
return(this->
addr.isVectorRegister()); }
113 {
return dest.isVectorRegister(); }
117 return((operandIndex == 0) ?
dest.isVectorRegister() :
118 this->
addr.isVectorRegister());
123 return((operandIndex == 0) ?
dest.isCondRegister() :
124 this->
addr.isCondRegister());
129 return((operandIndex == 0) ?
dest.isScalarRegister() :
130 this->
addr.isScalarRegister());
135 if (operandIndex > 0)
136 return(this->
addr.isVectorRegister());
141 return(operandIndex == 0);
146 return((operandIndex == 0) ?
dest.opSize() :
147 this->
addr.opSize());
153 return((operandIndex == 0) ?
dest.regIndex() :
154 this->
addr.regIndex());
158 if (this->
addr.isVectorRegister())
164 template<
typename DestDataType,
typename AddrOperandType>
166 public LdaInstBase<typename DestDataType::OperandType, AddrOperandType>,
175 AddrOperandType>(ib, obj, _opcode)
177 init_addr(&this->
addr);
183 template<
typename DataType>
200 fatal(
"Bad ldas register operand type %d\n", regDataType.
type);
203 fatal(
"Bad ldas register operand kind %d\n", regDataType.
kind);
207 template<
typename MemOperandType,
typename DestOperandType,
208 typename AddrOperandType>
213 typename DestOperandType::DestOperand
dest;
225 using namespace Brig;
242 dest.init(op_offs, obj);
245 addr.init(op_offs, obj);
259 dest.init(op_offs, obj);
262 addr.init(op_offs, obj);
265 switch (memoryOrder) {
282 fatal(
"LdInst has bad memory order type\n");
285 switch (memoryScope) {
302 fatal(
"LdInst has bad memory scope type\n");
331 panic(
"Ld: segment %d not supported\n", segment);
336 {
return(this->
addr.isVectorRegister()); }
340 if (this->
addr.isVectorRegister())
348 return((operandIndex == 0) ?
dest.isVectorRegister() :
349 this->
addr.isVectorRegister());
354 return((operandIndex == 0) ?
dest.isCondRegister() :
355 this->
addr.isCondRegister());
360 return((operandIndex == 0) ?
dest.isScalarRegister() :
361 this->
addr.isScalarRegister());
366 if (operandIndex > 0)
367 return(this->
addr.isVectorRegister());
373 return(operandIndex == 0);
378 return((operandIndex == 0) ?
dest.opSize() :
379 this->
addr.opSize());
385 return((operandIndex == 0) ?
dest.regIndex() :
386 this->
addr.regIndex());
390 template<
typename MemDataType,
typename DestDataType,
391 typename AddrOperandType>
393 public LdInstBase<typename MemDataType::CType,
394 typename DestDataType::OperandType, AddrOperandType>,
397 typename DestDataType::OperandType::DestOperand dest_vect[4];
405 typename DestDataType::OperandType,
406 AddrOperandType>(ib, obj, _opcode),
409 init_addr(&this->
addr);
421 assert(num_dest_operands <= 4);
423 num_dest_operands = 1;
426 if (num_dest_operands > 1) {
429 for (
int i = 0;
i < num_dest_operands; ++
i) {
430 dest_vect[
i].init_from_vect(op_offs, obj,
i);
438 typedef typename MemDataType::CType c0;
440 gpuDynInst->statusBitVector = gpuDynInst->exec_mask;
442 if (num_dest_operands > 1) {
443 for (
int i = 0;
i < gpuDynInst->computeUnit()->wfSize(); ++
i)
444 if (gpuDynInst->exec_mask[
i])
445 gpuDynInst->statusVector.push_back(num_dest_operands);
447 gpuDynInst->statusVector.push_back(0);
450 for (
int k = 0;
k < num_dest_operands; ++
k) {
452 c0 *
d = &((c0*)gpuDynInst->d_data)
453 [
k * gpuDynInst->computeUnit()->wfSize()];
455 for (
int i = 0;
i < gpuDynInst->computeUnit()->wfSize(); ++
i) {
456 if (gpuDynInst->exec_mask[
i]) {
461 *d = gpuDynInst->wavefront()->ldsChunk->
465 gpuDynInst->computeUnit()->masterId(),
466 0, gpuDynInst->wfDynId);
468 gpuDynInst->setRequestFlags(req);
472 if (gpuDynInst->computeUnit()->shader->
473 separate_acquire_release &&
474 gpuDynInst->isAcquire()) {
478 gpuDynInst->execContinuation =
481 gpuDynInst->useContinuation =
true;
485 gpuDynInst->useContinuation =
false;
488 gpuDynInst->computeUnit()->sendRequest(gpuDynInst,
496 gpuDynInst->updateStats();
502 typedef typename MemDataType::CType c1;
504 constexpr
bool is_vt_32 = DestDataType::vgprType ==
VT_32;
517 typedef typename std::conditional<is_vt_32,
518 typename std::conditional<std::is_floating_point<c1>::value,
519 float,
typename std::conditional<std::is_signed<c1>::value,
521 typename std::conditional<std::is_floating_point<c1>::value,
522 double,
typename std::conditional<std::is_signed<c1>::value,
523 int64_t, uint64_t>::type>::type>::type c0;
531 for (
int k = 0;
k < num_dest_operands; ++
k) {
532 assert((
sizeof(c1) * num_dest_operands)
535 int dst = this->
dest.regIndex() +
k;
537 dst = dest_vect[
k].regIndex();
539 int physVgpr = w->
remap(dst,
sizeof(c0), 1);
541 regVec.push_back(physVgpr);
547 if (gpuDynInst->exec_mask[
i]) {
548 DPRINTF(GPUReg,
"CU%d, WF[%d][%d], lane %d: "
549 "$%s%d <- %d global ld done (src = wavefront "
551 w->
wfSlotId,
i,
sizeof(c0) == 4 ?
"s" :
"d",
565 int loadVrfBankConflictCycles = gpuDynInst->computeUnit()->
566 vrf[w->
simdId]->exec(gpuDynInst->seqNum(),
w, regVec,
567 sizeof(c0), gpuDynInst->time);
570 gpuDynInst->computeUnit()->globalMemoryPipe
571 .incLoadVRFBankConflictCycles(loadVrfBankConflictCycles);
574 gpuDynInst->computeUnit()->localMemoryPipe
575 .incLoadVRFBankConflictCycles(loadVrfBankConflictCycles);
586 if (gpuDynInst->computeUnit()->shader->separate_acquire_release
587 && gpuDynInst->isAcquire()) {
589 gpuDynInst->useContinuation =
false;
592 gpuDynInst->computeUnit()->masterId(),
593 0, gpuDynInst->wfDynId);
595 gpuDynInst->computeUnit()->injectGlobalMemFence(gpuDynInst,
false, req);
606 return(this->
addr.isVectorRegister());
607 if (num_dest_operands > 1) {
608 return dest_vect[operandIndex].isVectorRegister();
610 else if (num_dest_operands == 1) {
611 return LdInstBase<
typename MemDataType::CType,
612 typename DestDataType::OperandType,
613 AddrOperandType>
::dest.isVectorRegister();
622 return(this->
addr.isCondRegister());
623 if (num_dest_operands > 1)
624 return dest_vect[operandIndex].isCondRegister();
625 else if (num_dest_operands == 1)
626 return LdInstBase<
typename MemDataType::CType,
627 typename DestDataType::OperandType,
628 AddrOperandType>
::dest.isCondRegister();
636 return(this->
addr.isScalarRegister());
637 if (num_dest_operands > 1)
638 return dest_vect[operandIndex].isScalarRegister();
639 else if (num_dest_operands == 1)
640 return LdInstBase<
typename MemDataType::CType,
641 typename DestDataType::OperandType,
642 AddrOperandType>
::dest.isScalarRegister();
650 return(this->
addr.isVectorRegister());
666 return(this->
addr.opSize());
667 if (num_dest_operands > 1)
668 return(dest_vect[operandIndex].opSize());
669 else if (num_dest_operands == 1)
670 return(
LdInstBase<
typename MemDataType::CType,
671 typename DestDataType::OperandType,
672 AddrOperandType>::
dest.opSize());
681 return(this->
addr.regIndex());
682 if (num_dest_operands > 1)
683 return(dest_vect[operandIndex].regIndex());
684 else if (num_dest_operands == 1)
685 return(
LdInstBase<
typename MemDataType::CType,
686 typename DestDataType::OperandType,
687 AddrOperandType>::
dest.regIndex());
692 if (this->
addr.isVectorRegister() || this->
addr.isScalarRegister())
693 return(num_dest_operands+1);
695 return(num_dest_operands);
700 template<
typename MemDT,
typename DestDT>
713 return new LdInst<MemDT, DestDT,
716 return new LdInst<MemDT, DestDT,
719 fatal(
"Bad ld register operand type %d\n", tmp.
regKind);
722 fatal(
"Bad ld register operand kind %d\n", tmp.
kind);
726 template<
typename MemDT>
741 return decodeLd2<MemDT, B32>(ib, obj);
745 return decodeLd2<MemDT, U32>(ib, obj);
749 return decodeLd2<MemDT, S32>(ib, obj);
752 return decodeLd2<MemDT, U32>(ib, obj);
754 fatal(
"Bad ld register operand type %d, %d\n",
760 return decodeLd2<MemDT, B64>(ib, obj);
762 return decodeLd2<MemDT, U64>(ib, obj);
764 return decodeLd2<MemDT, S64>(ib, obj);
766 return decodeLd2<MemDT, U64>(ib, obj);
768 fatal(
"Bad ld register operand type %d, %d\n",
772 fatal(
"Bad ld register operand type %d, %d\n", dest.
regKind,
777 template<
typename MemDataType,
typename SrcOperandType,
778 typename AddrOperandType>
782 typename SrcOperandType::SrcOperand
src;
794 using namespace Brig;
812 src.init(op_offs, obj);
816 addr.init(op_offs, obj);
826 addr.init(op_offs, obj);
829 src.init(op_offs, obj);
832 switch (memoryOrder) {
849 fatal(
"StInst has bad memory order type\n");
852 switch (memoryScope) {
869 fatal(
"StInst has bad memory scope type\n");
895 panic(
"St: segment %d not supported\n", segment);
902 return src.isVectorRegister() + this->
addr.isVectorRegister();
906 if (this->
addr.isVectorRegister() || this->
addr.isScalarRegister())
914 return !operandIndex ? src.isVectorRegister() :
915 this->
addr.isVectorRegister();
920 return !operandIndex ? src.isCondRegister() :
921 this->
addr.isCondRegister();
926 return !operandIndex ? src.isScalarRegister() :
927 this->
addr.isScalarRegister();
938 return !operandIndex ? src.opSize() : this->
addr.opSize();
944 return !operandIndex ? src.regIndex() : this->
addr.regIndex();
949 template<
typename MemDataType,
typename SrcDataType,
950 typename AddrOperandType>
952 public StInstBase<MemDataType, typename SrcDataType::OperandType,
957 typename SrcDataType::OperandType::SrcOperand src_vect[4];
962 const char *_opcode,
int srcIdx)
963 :
StInstBase<MemDataType, typename SrcDataType::OperandType,
964 AddrOperandType>(ib, obj, _opcode),
967 init_addr(&this->
addr);
990 assert(num_src_operands <= 4);
992 num_src_operands = 1;
995 if (num_src_operands > 1) {
998 for (
int i = 0;
i < num_src_operands; ++
i) {
999 src_vect[
i].init_from_vect(op_offs, obj,
i);
1010 if (gpuDynInst->computeUnit()->shader->separate_acquire_release
1011 && gpuDynInst->isRelease()) {
1015 gpuDynInst->useContinuation =
true;
1018 gpuDynInst->computeUnit()->masterId(),
1019 0, gpuDynInst->wfDynId);
1021 gpuDynInst->computeUnit()->injectGlobalMemFence(gpuDynInst,
false, req);
1043 typedef typename MemDataType::CType c0;
1045 gpuDynInst->statusBitVector = gpuDynInst->exec_mask;
1047 if (num_src_operands > 1) {
1048 for (
int i = 0;
i < gpuDynInst->computeUnit()->wfSize(); ++
i)
1049 if (gpuDynInst->exec_mask[
i])
1050 gpuDynInst->statusVector.push_back(num_src_operands);
1052 gpuDynInst->statusVector.push_back(0);
1055 for (
int k = 0;
k < num_src_operands; ++
k) {
1056 c0 *
d = &((c0*)gpuDynInst->d_data)
1057 [
k * gpuDynInst->computeUnit()->wfSize()];
1059 for (
int i = 0;
i < gpuDynInst->computeUnit()->wfSize(); ++
i) {
1060 if (gpuDynInst->exec_mask[
i]) {
1061 Addr vaddr = gpuDynInst->addr[
i] +
k *
sizeof(c0);
1065 gpuDynInst->wavefront()->ldsChunk->write<c0>(
vaddr,
1069 new Request(0, vaddr,
sizeof(c0), 0,
1070 gpuDynInst->computeUnit()->masterId(),
1071 0, gpuDynInst->wfDynId);
1073 gpuDynInst->setRequestFlags(req);
1079 gpuDynInst->useContinuation =
false;
1080 gpuDynInst->computeUnit()->sendRequest(gpuDynInst,
1089 gpuDynInst->updateStats();
1095 assert((operandIndex >= 0) && (operandIndex <
getNumOperands()));
1096 if (operandIndex == num_src_operands)
1097 return this->
addr.isVectorRegister();
1098 if (num_src_operands > 1)
1099 return src_vect[operandIndex].isVectorRegister();
1100 else if (num_src_operands == 1)
1102 typename SrcDataType::OperandType,
1108 assert((operandIndex >= 0) && (operandIndex <
getNumOperands()));
1109 if (operandIndex == num_src_operands)
1110 return this->
addr.isCondRegister();
1111 if (num_src_operands > 1)
1112 return src_vect[operandIndex].isCondRegister();
1113 else if (num_src_operands == 1)
1115 typename SrcDataType::OperandType,
1121 assert((operandIndex >= 0) && (operandIndex <
getNumOperands()));
1122 if (operandIndex == num_src_operands)
1123 return this->
addr.isScalarRegister();
1124 if (num_src_operands > 1)
1125 return src_vect[operandIndex].isScalarRegister();
1126 else if (num_src_operands == 1)
1128 typename SrcDataType::OperandType,
1134 assert((operandIndex >= 0) && (operandIndex <
getNumOperands()));
1140 assert((operandIndex >= 0) && (operandIndex <
getNumOperands()));
1141 if (operandIndex == num_src_operands)
1142 return this->
addr.opSize();
1143 if (num_src_operands > 1)
1144 return src_vect[operandIndex].opSize();
1145 else if (num_src_operands == 1)
1147 typename SrcDataType::OperandType,
1148 AddrOperandType>::src.opSize();
1154 assert((operandIndex >= 0) && (operandIndex <
getNumOperands()));
1155 if (operandIndex == num_src_operands)
1156 return this->
addr.regIndex();
1157 if (num_src_operands > 1)
1158 return src_vect[operandIndex].regIndex();
1159 else if (num_src_operands == 1)
1161 typename SrcDataType::OperandType,
1162 AddrOperandType>::src.regIndex();
1167 if (this->
addr.isVectorRegister() || this->
addr.isScalarRegister())
1168 return num_src_operands + 1;
1170 return num_src_operands;
1175 template<
typename DataType,
typename SrcDataType>
1191 return new StInst<DataType, SrcDataType,
1197 return new StInst<DataType, SrcDataType,
1200 return new StInst<DataType, SrcDataType,
1203 fatal(
"Bad st register operand type %d\n", tmp.
type);
1206 fatal(
"Bad st register operand kind %d\n", tmp.
kind);
1210 template<
typename OperandType,
typename AddrOperandType,
int NumSrcOperands,
1215 typename OperandType::DestOperand
dest;
1216 typename OperandType::SrcOperand src[NumSrcOperands];
1226 const char *_opcode)
1229 using namespace Brig;
1250 switch (memoryOrder) {
1267 fatal(
"AtomicInst has bad memory order type\n");
1270 switch (memoryScope) {
1287 fatal(
"AtomicInst has bad memory scope type\n");
1290 switch (atomicOperation) {
1325 fatal(
"Bad BrigAtomicOperation code %d\n", atomicOperation);
1339 panic(
"Atomic: segment %d not supported\n", segment);
1344 dest.init(op_offs, obj);
1347 addr.init(op_offs, obj);
1349 for (
int i = 0;
i < NumSrcOperands; ++
i) {
1351 src[
i].init(op_offs, obj);
1356 addr.init(op_offs, obj);
1358 for (
int i = 0;
i < NumSrcOperands; ++
i) {
1360 src[
i].init(op_offs, obj);
1368 for (
int i = 0;
i < NumSrcOperands;
i++) {
1373 if (
addr.isVectorRegister())
1380 if (
addr.isVectorRegister())
1381 return(NumSrcOperands + 2);
1382 return(NumSrcOperands + 1);
1386 assert((operandIndex >= 0) && (operandIndex <
getNumOperands()));
1387 if (operandIndex < NumSrcOperands)
1388 return src[operandIndex].isVectorRegister();
1389 else if (operandIndex == NumSrcOperands)
1390 return(
addr.isVectorRegister());
1392 return dest.isVectorRegister();
1396 assert((operandIndex >= 0) && (operandIndex <
getNumOperands()));
1397 if (operandIndex < NumSrcOperands)
1398 return src[operandIndex].isCondRegister();
1399 else if (operandIndex == NumSrcOperands)
1400 return(
addr.isCondRegister());
1402 return dest.isCondRegister();
1406 assert((operandIndex >= 0) && (operandIndex <
getNumOperands()));
1407 if (operandIndex < NumSrcOperands)
1408 return src[operandIndex].isScalarRegister();
1409 else if (operandIndex == NumSrcOperands)
1410 return(
addr.isScalarRegister());
1412 return dest.isScalarRegister();
1416 assert((operandIndex >= 0) && (operandIndex <
getNumOperands()));
1417 if (operandIndex < NumSrcOperands)
1419 else if (operandIndex == NumSrcOperands)
1420 return(
addr.isVectorRegister());
1426 if (operandIndex <= NumSrcOperands)
1433 assert((operandIndex >= 0) && (operandIndex <
getNumOperands()));
1434 if (operandIndex < NumSrcOperands)
1435 return(src[operandIndex].opSize());
1436 else if (operandIndex == NumSrcOperands)
1437 return(
addr.opSize());
1439 return(
dest.opSize());
1444 assert((operandIndex >= 0) && (operandIndex <
getNumOperands()));
1445 if (operandIndex < NumSrcOperands)
1446 return(src[operandIndex].regIndex());
1447 else if (operandIndex == NumSrcOperands)
1448 return(
addr.regIndex());
1450 return(
dest.regIndex());
1455 template<
typename MemDataType,
typename AddrOperandType,
int NumSrcOperands,
1459 AddrOperandType, NumSrcOperands, HasDst>,
1466 const char *_opcode)
1467 :
AtomicInstBase<typename MemDataType::OperandType, AddrOperandType,
1468 NumSrcOperands, HasDst>
1472 init_addr(&this->
addr);
1481 if (gpuDynInst->computeUnit()->shader->separate_acquire_release
1482 && (gpuDynInst->isRelease()
1483 || gpuDynInst->isAcquireRelease())) {
1488 gpuDynInst->useContinuation =
true;
1492 gpuDynInst->computeUnit()->masterId(),
1493 0, gpuDynInst->wfDynId);
1495 gpuDynInst->computeUnit()->injectGlobalMemFence(gpuDynInst,
false, req);
1516 typedef typename MemDataType::CType CType;
1519 int dst = this->
dest.regIndex();
1522 int physVgpr = w->
remap(dst,
sizeof(CType), 1);
1523 regVec.push_back(physVgpr);
1524 CType *p1 = &((CType*)gpuDynInst->d_data)[0];
1527 if (gpuDynInst->exec_mask[
i]) {
1528 DPRINTF(GPUReg,
"CU%d, WF[%d][%d], lane %d: "
1529 "$%s%d <- %d global ld done (src = wavefront "
1531 w->
wfSlotId,
i,
sizeof(CType) == 4 ?
"s" :
"d",
1543 int loadVrfBankConflictCycles = gpuDynInst->computeUnit()->
1544 vrf[w->
simdId]->exec(gpuDynInst->seqNum(),
w, regVec,
1545 sizeof(CType), gpuDynInst->time);
1548 gpuDynInst->computeUnit()->globalMemoryPipe
1549 .incLoadVRFBankConflictCycles(loadVrfBankConflictCycles);
1552 gpuDynInst->computeUnit()->localMemoryPipe
1553 .incLoadVRFBankConflictCycles(loadVrfBankConflictCycles);
1567 gpuDynInst->statusBitVector = gpuDynInst->exec_mask;
1569 typedef typename MemDataType::CType c0;
1571 c0 *
d = &((c0*) gpuDynInst->d_data)[0];
1572 c0 *
e = &((c0*) gpuDynInst->a_data)[0];
1573 c0 *
f = &((c0*) gpuDynInst->x_data)[0];
1575 for (
int i = 0;
i < gpuDynInst->computeUnit()->wfSize(); ++
i) {
1576 if (gpuDynInst->exec_mask[
i]) {
1580 Wavefront *wavefront = gpuDynInst->wavefront();
1619 fatal(
"Unrecognized or invalid HSAIL atomic op "
1624 new Request(0, vaddr,
sizeof(c0), 0,
1625 gpuDynInst->computeUnit()->masterId(),
1626 0, gpuDynInst->wfDynId,
1627 gpuDynInst->makeAtomicOpFunctor<c0>(
e,
1630 gpuDynInst->setRequestFlags(req);
1634 if (gpuDynInst->computeUnit()->shader->
1635 separate_acquire_release &&
1636 (gpuDynInst->isAcquire())) {
1640 gpuDynInst->execContinuation =
1643 gpuDynInst->useContinuation =
true;
1646 gpuDynInst->useContinuation =
false;
1649 gpuDynInst->computeUnit()->sendRequest(gpuDynInst,
i,
1659 gpuDynInst->updateStats();
1670 if (gpuDynInst->computeUnit()->shader->separate_acquire_release
1671 && gpuDynInst->isAcquire()) {
1676 gpuDynInst->useContinuation =
false;
1679 gpuDynInst->computeUnit()->masterId(),
1680 0, gpuDynInst->wfDynId);
1682 gpuDynInst->computeUnit()->injectGlobalMemFence(gpuDynInst,
false, req);
1688 template<
typename DataType,
typename AddrOperandType,
int NumSrcOperands>
1695 return decodeLd<DataType>(ib, obj);
1699 return decodeSt<S8,S8>(ib, obj);
1701 return decodeSt<S16,S16>(ib, obj);
1703 return decodeSt<S32,S32>(ib, obj);
1705 return decodeSt<S64,S64>(ib, obj);
1706 default:
fatal(
"AtomicSt: Operand type mismatch %d\n", ib->type);
1710 return new AtomicInst<DataType, AddrOperandType,
1711 NumSrcOperands,
false>(ib, obj,
"atomicnoret");
1713 return new AtomicInst<DataType, AddrOperandType,
1714 NumSrcOperands,
true>(ib, obj,
"atomic");
1718 template<
typename DataType,
int NumSrcOperands>
1731 NumSrcOperands>(ib, obj);
1737 NumSrcOperands>(ib, obj);
1740 NumSrcOperands>(ib, obj);
1742 fatal(
"Bad atomic register operand type %d\n", tmp.
type);
1745 fatal(
"Bad atomic register operand kind %d\n", tmp.
kind);
1750 template<
typename DataType>
1757 return decodeAtomicHelper<DataType, 2>(ib, obj);
1759 return decodeAtomicHelper<DataType, 1>(ib, obj);
1763 template<
typename DataType>
1769 return decodeAtomicHelper<DataType, 2>(ib, obj);
1771 return decodeAtomicHelper<DataType, 1>(ib, obj);
1776 #endif // __ARCH_HSAIL_INSTS_MEM_HH__
Brig::BrigMemoryOrder memoryOrder
Brig::BrigMemoryOrder memoryOrder
bool isVectorRegister(int operandIndex) override
int getNumOperands() override
int getRegisterIndex(int operandIndex, GPUDynInstPtr gpuDynInst)
const Brig::BrigOperand * getOperand(int offs) const
Defines classes encapsulating HSAIL instruction operands.
bool isDstOperand(int operandIndex) override
BrigDataOffsetOperandList32_t operands
bool isDstOperand(int operandIndex)
bool isScalarRegister(int operandIndex) override
int getOperandSize(int operandIndex) override
void execSt(GPUDynInstPtr gpuDynInst) override
void completeAcc(GPUDynInstPtr gpuDynInst) override
void completeAcc(GPUDynInstPtr gpuDynInst) override
void generateDisassembly() override
static const int MAX_REGS_FOR_NON_VEC_MEM_INST
bool isVectorRegister(int operandIndex) override
static const int MAX_WIDTH_FOR_MEM_INST
bool isVectorRegister(int operandIndex) override
bool isSrcOperand(int operandIndex) override
int getRegisterIndex(int operandIndex, GPUDynInstPtr gpuDynInst) override
BrigMemoryOrder8_t memoryOrder
bool isVectorRegister(int operandIndex) override
StInstBase(const Brig::BrigInstBase *ib, const BrigObject *obj, const char *_opcode)
void initiateAcc(GPUDynInstPtr gpuDynInst) override
void execAtomic(GPUDynInstPtr gpuDynInst) override
int getOperandSize(int operandIndex) override
RegAddrOperand< SRegOperand > SRegAddrOperand
virtual void execLdAcq(GPUDynInstPtr gpuDynInst)
std::bitset< std::numeric_limits< unsigned long long >::digits > VectorMask
bool isSrcOperand(int operandIndex) override
int getNumOperands() override
The request should be marked with ACQUIRE.
bool isSrcOperand(int operandIndex)
virtual void execAtomicAcq(GPUDynInstPtr gpuDynInst)
bool isDstOperand(int operandIndex) override
AtomicInst(const Brig::BrigInstBase *ib, const BrigObject *obj, const char *_opcode)
int numDstRegOperands() override
bool isCondRegister(int operandIndex)
DestOperandType::DestOperand dest
MemInst(Enums::MemType m_type)
Brig::BrigMemoryScope memoryScope
void dataStatic(T *p)
Set the data pointer to the following value that should not be freed.
bool isScalarRegister(int operandIndex) override
const uint8_t * getData(int offs) const
virtual void execSt(GPUDynInstPtr gpuDynInst)
int getRegisterIndex(int operandIndex, GPUDynInstPtr gpuDynInst) override
std::shared_ptr< GPUDynInst > GPUDynInstPtr
uint16_t num_src_operands
virtual void execAtomic(GPUDynInstPtr gpuDynInst)
void execLdAcq(GPUDynInstPtr gpuDynInst) override
bool isCondRegister(int operandIndex) override
int getRegisterIndex(int operandIndex, GPUDynInstPtr gpuDynInst) override
bool isDstOperand(int operandIndex) override
BrigMemoryScope8_t memoryScope
int numSrcRegOperands() override
DestOperandType::DestOperand dest
Brig::BrigAtomicOperation atomicOperation
bool isCondRegister(int operandIndex) override
AddrOperandBase * getAddressOperand()
GPUStaticInst * decodeLd(const Brig::BrigInstBase *ib, const BrigObject *obj)
LdaInst(const Brig::BrigInstBase *ib, const BrigObject *obj, const char *_opcode)
GPUStaticInst * decodeAtomic(const Brig::BrigInstBase *ib, const BrigObject *obj)
ComputeUnit * computeUnit
Brig::BrigSegment segment
Brig::BrigSegment segment
Brig::BrigSegment segment
AddrOperandBase * addr_operand
int getOperandSize(int operandIndex)
Brig::BrigMemoryScope memoryScope
void initiateAcc(GPUDynInstPtr gpuDynInst) override
void execAtomicAcq(GPUDynInstPtr gpuDynInst) override
LdInstBase(const Brig::BrigInstBase *ib, const BrigObject *obj, const char *_opcode)
bool isScalarRegister(int operandIndex) override
T read(const uint32_t index)
a read operation
bool isCondRegister(int operandIndex) override
BrigAtomicOperation8_t atomicOperation
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
OperandType::DestOperand dest
int numDstRegOperands() override
bool isCondRegister(int operandIndex) override
bool isVectorRegister(int operandIndex) override
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
void initiateAcc(GPUDynInstPtr gpuDynInst) override
bool isDstOperand(int operandIndex) override
int numSrcRegOperands() override
AtomicInstBase(const Brig::BrigInstBase *ib, const BrigObject *obj, const char *_opcode)
bool isCondRegister(int operandIndex) override
RegAddrOperand< DRegOperand > DRegAddrOperand
bool isScalarRegister(int operandIndex)
uint16_t num_dest_operands
unsigned getOperandPtr(int offs, int index) const
void completeAcc(GPUDynInstPtr gpuDynInst) override
int getNumOperands() override
int numSrcRegOperands() override
int numDstRegOperands() override
void init_addr(AddrOperandBase *_addr_operand)
bool isSrcOperand(int operandIndex) override
SrcOperandType::SrcOperand src
std::vector< VectorRegisterFile * > vrf
BrigDataOffsetOperandList32_t elements
The request should be marked with RELEASE.
bool isAtomicExch() const
GPUStaticInst * constructAtomic(const Brig::BrigInstBase *ib, const BrigObject *obj)
GPUStaticInst * decodeAtomicHelper(const Brig::BrigInstBase *ib, const BrigObject *obj)
Brig::BrigRegisterKind regKind
int getOperandSize(int operandIndex) override
GPUStaticInst * decodeAtomicNoRet(const Brig::BrigInstBase *ib, const BrigObject *obj)
LdInst(const Brig::BrigInstBase *ib, const BrigObject *obj, const char *_opcode)
void write(const uint32_t index, const T value)
a write operation
int getRegisterIndex(int operandIndex, GPUDynInstPtr gpuDynInst) override
virtual void execute(GPUDynInstPtr gpuDynInst)=0
BrigRegOperandInfo findRegDataType(unsigned opOffset, const BrigObject *obj)
int getNumOperands() override
GPUStaticInst * decodeLd2(const Brig::BrigInstBase *ib, const BrigObject *obj)
bool isSrcOperand(int operandIndex) override
uint32_t remap(uint32_t vgprIndex, uint32_t size, uint8_t mode=0)
Brig::BrigMemoryOrder memoryOrder
int getOperandSize(int operandIndex) override
LdaInstBase(const Brig::BrigInstBase *ib, const BrigObject *obj, const char *_opcode)
GPUStaticInst * decodeLda(const Brig::BrigInstBase *ib, const BrigObject *obj)
int getNumOperands() override
GPUStaticInst * decodeSt(const Brig::BrigInstBase *ib, const BrigObject *obj)
bool isDstOperand(int operandIndex) override
Brig::BrigMemoryScope memoryScope
void setFlags(Flags flags)
Note that unlike other accessors, this function sets specific flags (ORs them in); it does not assign...
bool isSrcOperand(int operandIndex) override
int getRegisterIndex(int operandIndex, GPUDynInstPtr gpuDynInst) override
bool isVectorRegister(int operandIndex)
bool isScalarRegister(int operandIndex) override
bool isScalarRegister(int operandIndex) override
int getOperandSize(int operandIndex) override
StInst(const Brig::BrigInstBase *ib, const BrigObject *obj, const char *_opcode, int srcIdx)
ProbePointArg< PacketInfo > Packet
Packet probe point.