53 _srcLiteral = *
reinterpret_cast<uint32_t*
>(&iFmt[1]);
105 std::stringstream dis_stream;
110 dis_stream <<
"0x" << std::hex << std::setfill(
'0') << std::setw(8)
117 dis_stream <<
"0x" << std::hex << std::setfill(
'0') << std::setw(8)
138 _srcLiteral = *
reinterpret_cast<uint32_t*
>(&iFmt[1]);
193 if (iFmt->
OP == 0x14)
203 std::stringstream dis_stream;
209 dis_stream <<
"0x" << std::hex << std::setfill(
'0')
210 << std::setw(8) <<
extData.imm_u32 <<
", ";
215 dis_stream <<
"0x" << std::hex << std::setfill(
'0') << std::setw(4)
233 _srcLiteral = *
reinterpret_cast<uint32_t*
>(&iFmt[1]);
296 std::stringstream dis_stream;
301 dis_stream <<
"0x" << std::hex << std::setfill(
'0') << std::setw(8)
322 _srcLiteral = *
reinterpret_cast<uint32_t*
>(&iFmt[1]);
371 std::stringstream dis_stream;
375 dis_stream <<
"0x" << std::hex << std::setfill(
'0') << std::setw(8)
382 dis_stream <<
"0x" << std::hex << std::setfill(
'0') << std::setw(8)
439 std::stringstream dis_stream;
447 dis_stream <<
"label_" << std::hex << dest;
465 dis_stream <<
"vmcnt(" << vm_cnt <<
")";
468 if (lgkm_cnt != 0xf) {
472 dis_stream <<
"lgkmcnt(" << lgkm_cnt <<
")";
475 if (exp_cnt != 0x7) {
476 if (vm_cnt != 0xf || lgkm_cnt != 0xf)
479 dis_stream <<
"expcnt(" << exp_cnt <<
")";
502 _srcLiteral = *
reinterpret_cast<uint32_t*
>(&iFmt[1]);
567 std::stringstream dis_stream;
571 dis_stream <<
"s[" <<
instData.SDATA <<
":"
575 dis_stream <<
"s" <<
instData.SDATA <<
", ";
581 dis_stream <<
"s[" << (
instData.SBASE << 1) <<
":"
582 << ((
instData.SBASE << 1) + 1) <<
"], ";
587 dis_stream <<
"0x" << std::hex << std::setfill(
'0') << std::setw(2)
593 dis_stream <<
"s" <<
extData.OFFSET;
609 _srcLiteral = *
reinterpret_cast<uint32_t*
>(&iFmt[1]);
689 iFmt->
OP == 0x18 || iFmt->
OP == 0x24 || iFmt->
OP == 0x25)
698 std::stringstream dis_stream;
700 dis_stream <<
"v" <<
instData.VDST <<
", ";
703 dis_stream <<
"vcc, ";
708 dis_stream <<
"0x" << std::hex << std::setfill(
'0') << std::setw(8)
721 dis_stream <<
"0x" << std::hex << std::setfill(
'0') << std::setw(8)
725 dis_stream << std::resetiosflags(std::ios_base::basefield) <<
"v"
729 dis_stream <<
", vcc";
744 _srcLiteral = *
reinterpret_cast<uint32_t*
>(&iFmt[1]);
824 std::stringstream dis_stream;
826 dis_stream <<
"v" <<
instData.VDST <<
", ";
831 dis_stream <<
"0x" << std::hex << std::setfill(
'0') << std::setw(8)
851 _srcLiteral = *
reinterpret_cast<uint32_t*
>(&iFmt[1]);
919 std::stringstream dis_stream;
920 dis_stream <<
_opcode <<
" vcc, ";
925 dis_stream <<
"0x" << std::hex << std::setfill(
'0') << std::setw(8)
930 dis_stream <<
"v" <<
instData.VSRC1;
964 _srcLiteral = *
reinterpret_cast<uint32_t*
>(&iFmt[1]);
982 for (opNum = 0; opNum < numSrc; opNum++) {
1004 true,
false,
false);
1012 assert(
dstOps.size() == numDst);
1024 std::stringstream dis_stream;
1035 num_regs - 1 <<
"], ";
1041 dis_stream <<
instData.VDST <<
", ";
1088 _srcLiteral = *
reinterpret_cast<uint32_t*
>(&iFmt[1]);
1106 for (opNum = 0; opNum < numSrc; opNum++) {
1114 true,
false,
false);
1122 false,
true,
false);
1128 true,
false,
false);
1144 std::stringstream dis_stream;
1147 dis_stream <<
"v" <<
instData.VDST <<
", ";
1180 dis_stream <<
", vcc";
1210 for (opNum = 0; opNum < numSrc; opNum++) {
1220 false,
true,
false);
1236 std::stringstream dis_stream;
1255 dis_stream <<
" op_sel:[" <<
bits(opsel, 0, 0) <<
","
1256 <<
bits(opsel, 1, 1) <<
"," <<
bits(opsel, 2, 2) <<
"]";
1265 const std::string &
opcode)
1288 for (opNum = 0; opNum < numSrc; opNum++) {
1298 false,
true,
false);
1314 std::stringstream dis_stream;
1324 int dst_opnum =
instData.VDST + 0x100;
1348 _srcLiteral = *
reinterpret_cast<uint32_t*
>(&iFmt[1]);
1364 false,
true,
false);
1371 false,
true,
false);
1387 std::stringstream dis_stream;
1391 dis_stream <<
"v" <<
extData.VDST <<
", ";
1393 dis_stream <<
"v" <<
extData.ADDR;
1396 dis_stream <<
", v" <<
extData.DATA0;
1399 dis_stream <<
", v" <<
extData.DATA1;
1412 dis_stream <<
" offset:" <<
offset;
1426 _srcLiteral = *
reinterpret_cast<uint32_t*
>(&iFmt[1]);
1455 false,
true,
false);
1461 false,
true,
false);
1479 false,
true,
false);
1496 int srsrc_val =
extData.SRSRC * 4;
1497 std::stringstream dis_stream;
1499 dis_stream <<
"v" <<
extData.VDATA <<
", v" <<
extData.VADDR <<
", ";
1500 dis_stream <<
"s[" << srsrc_val <<
":"
1501 << srsrc_val + 3 <<
"], ";
1502 dis_stream <<
"s" <<
extData.SOFFSET;
1505 dis_stream <<
", offset:" <<
instData.OFFSET;
1519 _srcLiteral = *
reinterpret_cast<uint32_t*
>(&iFmt[1]);
1546 false,
true,
false);
1552 false,
true,
false);
1569 false,
true,
false);
1591 _srcLiteral = *
reinterpret_cast<uint32_t*
>(&iFmt[1]);
1619 false,
true,
false);
1625 false,
true,
false);
1644 false,
true,
false);
1666 _srcLiteral = *
reinterpret_cast<uint32_t*
>(&iFmt[1]);
1683 for (opNum = 0; opNum < 4; opNum++) {
1685 false,
true,
false);
1703 if (iFmt->
SEG == 0) {
1705 }
else if (iFmt->
SEG == 1) {
1706 setFlag(FlatScratch);
1707 }
else if (iFmt->
SEG == 2) {
1708 setFlag(FlatGlobal);
1710 panic(
"Unknown flat segment: %d\n", iFmt->SEG);
1717 _srcLiteral = *
reinterpret_cast<uint32_t*
>(&iFmt[1]);
1741 panic(
"Unknown flat subtype!\n");
1762 false,
true,
false);
1768 false,
true,
false);
1775 false,
true,
false);
1799 false,
true,
false);
1807 true,
false,
false);
1815 false,
true,
false);
1822 true,
false,
false);
1830 false,
true,
false);
1859 panic(
"Unknown flat subtype!\n");
1866 std::stringstream dis_stream;
1890 std::string global_opcode =
_opcode;
1892 global_opcode.replace(0, 4,
"global");
1895 global_opcode.replace(0, 4,
"scratch");
1898 std::stringstream dis_stream;
1899 dis_stream << global_opcode <<
" ";
1921 dis_stream <<
", off";
1927 dis_stream <<
" offset:" <<
instData.OFFSET;
1931 dis_stream <<
" glc";
virtual int numDstRegOperands()=0
std::vector< OperandInfo > srcOps
const std::string & opcode() const
std::vector< OperandInfo > dstOps
bool isFlatGlobal() const
virtual int getNumOperands()=0
const std::string _opcode
virtual int numSrcRegOperands()=0
bool isFlatScratch() const
void initOperandInfo() override
Inst_DS(InFmt_DS *, const std::string &opcode)
void generateDisassembly() override
int instSize() const override
Inst_EXP(InFmt_EXP *, const std::string &opcode)
void initOperandInfo() override
int instSize() const override
void generateFlatDisassembly()
void initFlatOperandInfo()
Inst_FLAT(InFmt_FLAT *, const std::string &opcode)
void generateDisassembly() override
void generateGlobalScratchDisassembly()
void initOperandInfo() override
void initGlobalScratchOperandInfo()
int instSize() const override
int instSize() const override
void initOperandInfo() override
Inst_MIMG(InFmt_MIMG *, const std::string &opcode)
int instSize() const override
void initOperandInfo() override
Inst_MTBUF(InFmt_MTBUF *, const std::string &opcode)
void initOperandInfo() override
void generateDisassembly() override
Inst_MUBUF(InFmt_MUBUF *, const std::string &opcode)
int instSize() const override
void initOperandInfo() override
Inst_SMEM(InFmt_SMEM *, const std::string &opcode)
void generateDisassembly() override
int instSize() const override
int instSize() const override
void generateDisassembly() override
void initOperandInfo() override
Inst_SOP1(InFmt_SOP1 *, const std::string &opcode)
bool hasSecondDword(InFmt_SOP1 *)
bool hasSecondDword(InFmt_SOP2 *)
void generateDisassembly() override
Inst_SOP2(InFmt_SOP2 *, const std::string &opcode)
void initOperandInfo() override
int instSize() const override
int instSize() const override
bool hasSecondDword(InFmt_SOPC *)
void generateDisassembly() override
void initOperandInfo() override
Inst_SOPC(InFmt_SOPC *, const std::string &opcode)
Inst_SOPK(InFmt_SOPK *, const std::string &opcode)
int instSize() const override
void generateDisassembly() override
bool hasSecondDword(InFmt_SOPK *)
void initOperandInfo() override
void generateDisassembly() override
void initOperandInfo() override
int instSize() const override
Inst_SOPP(InFmt_SOPP *, const std::string &opcode)
int instSize() const override
Inst_VINTRP(InFmt_VINTRP *, const std::string &opcode)
Inst_VOP1(InFmt_VOP1 *, const std::string &opcode)
void generateDisassembly() override
void initOperandInfo() override
int instSize() const override
bool hasSecondDword(InFmt_VOP1 *)
void initOperandInfo() override
int instSize() const override
bool hasSecondDword(InFmt_VOP2 *)
Inst_VOP2(InFmt_VOP2 *, const std::string &opcode)
void generateDisassembly() override
Inst_VOP3A(InFmt_VOP3A *, const std::string &opcode, bool sgpr_dst)
void generateDisassembly() override
const bool sgprDst
the v_cmp and readlane instructions in the VOP3 encoding are unique because they are the only instruc...
int instSize() const override
void initOperandInfo() override
Inst_VOP3B(InFmt_VOP3B *, const std::string &opcode)
void initOperandInfo() override
void generateDisassembly() override
int instSize() const override
void generateDisassembly() override
void initOperandInfo() override
Inst_VOP3P_MAI(InFmt_VOP3P_MAI *, const std::string &opcode)
int instSize() const override
InFmt_VOP3P_MAI_1 extData
void initOperandInfo() override
void generateDisassembly() override
int instSize() const override
Inst_VOP3P(InFmt_VOP3P *, const std::string &opcode)
bool hasSecondDword(InFmt_VOPC *)
void generateDisassembly() override
void initOperandInfo() override
int instSize() const override
Inst_VOPC(InFmt_VOPC *, const std::string &opcode)
ScalarRegU32 _srcLiteral
if the instruction has a src literal - an immediate value that is part of the instruction stream - we...
int getOperandSize(int opIdx) override
VEGAGPUStaticInst(const std::string &opcode)
This is a simple scalar statistic, like a counter.
constexpr T bits(T val, unsigned first, unsigned last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
#define panic(...)
This implements a cprintf based panic() function.
classes that represnt vector/scalar operands in VEGA ISA.
bool isVectorReg(int opIdx)
InstFormat * MachInst
used to represent the encoding of a VEGA inst.
bool isScalarReg(int opIdx)
std::string opSelectorToRegSym(int idx, int numRegs)
Copyright (c) 2024 Arm Limited All rights reserved.