21 std::optional<unsigned int> OpIdx, int64_t Imm)
const {
23 switch (
MI.getOpcode()) {
24 case AMDGPU::S_DELAY_ALU:
26 printSDelayAluImm(Imm,
OS);
43 case AMDGPU::S_DELAY_ALU:
44 return parseSDelayAluImmMnemonic(OpIdx, Imm, Src, ErrorCallback);
51void AMDGPUMIRFormatter::printSDelayAluImm(int64_t Imm,
56 constexpr int64_t
None = 0;
57 constexpr int64_t
Same = 0;
66 OS <<
"VALU_DEP_" << Id;
68 OS <<
"TRANS32_DEP_" << Id - 4;
70 OS <<
"SALU_CYCLE_" << Id - 8;
88 OS <<
"SKIP_" << Skip - 1;
94bool AMDGPUMIRFormatter::parseSDelayAluImmMnemonic(
101 bool Expected = Src.consume_front(
".id0_");
103 return ErrorCallback(Src.begin(),
"Expected .id0_");
107 if (!Src.consumeInteger(10, Dep))
113 auto DecodeDelay = [&](
StringRef &Src) -> int64_t {
114 if (Src.consume_front(
"NONE"))
116 if (Src.consume_front(
"VALU_DEP_"))
117 return ExpectInt(Src, 0);
118 if (Src.consume_front(
"TRANS32_DEP_"))
119 return ExpectInt(Src, 4);
120 if (Src.consume_front(
"SALU_CYCLE_"))
121 return ExpectInt(Src, 8);
126 int64_t Delay0 = DecodeDelay(Src);
130 return ErrorCallback(Src.begin(),
"Could not decode delay0");
138 if (Src.begin() == Src.end())
141 Expected = Src.consume_front(
"_skip_");
143 return ErrorCallback(Src.begin(),
"Expected _skip_");
146 if (Src.consume_front(
"SAME")) {
148 }
else if (Src.consume_front(
"NEXT")) {
150 }
else if (Src.consume_front(
"SKIP_")) {
151 if (Src.consumeInteger(10, Skip)) {
152 return ErrorCallback(Src.begin(),
"Expected integer Skip value");
156 ErrorCallback(Src.begin(),
"Unexpected Skip Value");
159 Expected = Src.consume_front(
"_id1_");
161 return ErrorCallback(Src.begin(),
"Expected _id1_");
163 Delay1 = DecodeDelay(Src);
165 return ErrorCallback(Src.begin(),
"Could not decode delay1");
177 if (Src ==
"GWSResource") {
AMD GCN specific subclass of TargetSubtarget.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Tagged union holding either a T or a Error.
const LLVMTargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
Representation of each machine instruction.
Special value supplied for machine level alias analysis.
This class keeps track of the SPI_SP_INPUT_ADDR config register, which tells the hardware which inter...
const AMDGPUGWSResourcePseudoSourceValue * getGWSPSV(const AMDGPUTargetMachine &TM)
StringRef - Represent a constant reference to a string, i.e.
An efficient, type-erasing, non-owning reference to a callable.
This class implements an extremely fast bulk output stream that can only output to a stream.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This is an optimization pass for GlobalISel generic memory operations.