Lines Matching defs:AMDGPUOperand

59 class AMDGPUOperand : public MCParsedAsmOperand {
71 AMDGPUOperand(KindTy Kind_, const AMDGPUAsmParser *AsmParser_)
74 using Ptr = std::unique_ptr<AMDGPUOperand>;
109 friend raw_ostream &operator <<(raw_ostream &OS, AMDGPUOperand::Modifiers Mods);
947 auto getPredicate(std::function<bool(const AMDGPUOperand &Op)> P) const {
1154 static AMDGPUOperand::Ptr CreateImm(const AMDGPUAsmParser *AsmParser,
1158 auto Op = std::make_unique<AMDGPUOperand>(Immediate, AsmParser);
1169 static AMDGPUOperand::Ptr CreateToken(const AMDGPUAsmParser *AsmParser,
1172 auto Res = std::make_unique<AMDGPUOperand>(Token, AsmParser);
1180 static AMDGPUOperand::Ptr CreateReg(const AMDGPUAsmParser *AsmParser,
1183 auto Op = std::make_unique<AMDGPUOperand>(Register, AsmParser);
1191 static AMDGPUOperand::Ptr CreateExpr(const AMDGPUAsmParser *AsmParser,
1193 auto Op = std::make_unique<AMDGPUOperand>(Expression, AsmParser);
1201 raw_ostream &operator <<(raw_ostream &OS, AMDGPUOperand::Modifiers Mods) {
1396 using OptionalImmIndexMap = std::map<AMDGPUOperand::ImmTy, unsigned>;
1577 std::unique_ptr<AMDGPUOperand> parseRegister(bool RestoreOnFailure = false);
1604 AMDGPUOperand::ImmTy ImmTy = AMDGPUOperand::ImmTyNone,
1609 AMDGPUOperand::ImmTy ImmTy = AMDGPUOperand::ImmTyNone,
1614 AMDGPUOperand::ImmTy ImmTy = AMDGPUOperand::ImmTyNone);
1641 AMDGPUOperand::ImmTy ImmTy);
1724 SMLoc getOperandLoc(std::function<bool(const AMDGPUOperand&)> Test,
1726 SMLoc getImmLoc(AMDGPUOperand::ImmTy Type, const OperandVector &Operands) const;
1880 AMDGPUOperand::ImmTy Type);
2007 bool AMDGPUOperand::isInlinableImm(MVT type) const {
2091 bool AMDGPUOperand::isLiteralImm(MVT type) const {
2144 bool AMDGPUOperand::isRegClass(unsigned RCID) const {
2148 bool AMDGPUOperand::isVRegWithInputMods() const {
2155 template <bool IsFake16> bool AMDGPUOperand::isT16VRegWithInputMods() const {
2160 bool AMDGPUOperand::isSDWAOperand(MVT type) const {
2168 bool AMDGPUOperand::isSDWAFP16Operand() const {
2172 bool AMDGPUOperand::isSDWAFP32Operand() const {
2176 bool AMDGPUOperand::isSDWAInt16Operand() const {
2180 bool AMDGPUOperand::isSDWAInt32Operand() const {
2184 bool AMDGPUOperand::isBoolReg() const {
2190 uint64_t AMDGPUOperand::applyInputFPModifiers(uint64_t Val, unsigned Size) const
2207 void AMDGPUOperand::addImmOperands(MCInst &Inst, unsigned N, bool ApplyModifiers) const {
2225 void AMDGPUOperand::addLiteralImmOperand(MCInst &Inst, int64_t Val, bool ApplyModifiers) const {
2477 void AMDGPUOperand::addRegOperands(MCInst &Inst, unsigned N) const {
2481 bool AMDGPUOperand::isInlineValue() const {
3104 std::unique_ptr<AMDGPUOperand>
3120 return AMDGPUOperand::CreateReg(this, Reg, StartLoc, EndLoc);
3156 AMDGPUOperand::Modifiers Mods;
3175 AMDGPUOperand::CreateImm(this, RealVal.bitcastToAPInt().getZExtValue(), S,
3176 AMDGPUOperand::ImmTyNone, true));
3177 AMDGPUOperand &Op = static_cast<AMDGPUOperand &>(*Operands.back());
3204 Operands.push_back(AMDGPUOperand::CreateImm(this, IntVal, S));
3205 AMDGPUOperand &Op = static_cast<AMDGPUOperand &>(*Operands.back());
3210 Operands.push_back(AMDGPUOperand::CreateExpr(this, Expr, S));
3384 AMDGPUOperand::Modifiers Mods;
3390 AMDGPUOperand &Op = static_cast<AMDGPUOperand &>(*Operands.back());
3417 AMDGPUOperand::Modifiers Mods;
3421 AMDGPUOperand &Op = static_cast<AMDGPUOperand &>(*Operands.back());
3441 Operands.push_back(AMDGPUOperand::CreateImm(this, 0, Loc,
3442 AMDGPUOperand::ImmTyOff, false));
3449 std::unique_ptr<AMDGPUOperand> Reg = parseRegister();
3829 auto Loc = ((AMDGPUOperand &)*Operands[ParsedIdx]).getStartLoc();
4372 AMDGPUOperand &Op = ((AMDGPUOperand &)*Operands[i]);
4450 AMDGPUOperand &Op = ((AMDGPUOperand &)*Operands[i]);
4611 SMLoc S = getImmLoc(AMDGPUOperand::ImmTyDppCtrl, Operands);
4790 AMDGPUOperand &Op = ((AMDGPUOperand &)*Operands[i]);
4868 SMLoc S = getImmLoc(AMDGPUOperand::ImmTyGDS, Operands);
4919 SMLoc S = getImmLoc(AMDGPUOperand::ImmTyCPol, Operands);
4934 SMLoc S = getImmLoc(AMDGPUOperand::ImmTyCPol, Operands);
4954 SMLoc S = getImmLoc(AMDGPUOperand::ImmTyCPol, Operands);
4977 SMLoc S = getImmLoc(AMDGPUOperand::ImmTyCPol, Operands);
5042 SMLoc Loc = getImmLoc(AMDGPUOperand::ImmTyTFE, Operands);
5074 Error(getImmLoc(AMDGPUOperand::ImmTyClamp, Operands),
5079 Error(getImmLoc(AMDGPUOperand::ImmTyOpSel, Operands),
5084 Error(getImmLoc(AMDGPUOperand::ImmTyNegLo, Operands),
5089 Error(getImmLoc(AMDGPUOperand::ImmTyNegHi, Operands),
5098 Error(getImmLoc(AMDGPUOperand::ImmTyD16, Operands),
5103 Error(getImmLoc(AMDGPUOperand::ImmTyDim, Operands),
5113 Error(getImmLoc(AMDGPUOperand::ImmTyDMask, Operands),
5118 Error(getImmLoc(AMDGPUOperand::ImmTyDMask, Operands),
5250 const auto &Op = ((AMDGPUOperand &)*Operands[InvalidOprIdx]);
5252 const auto &PrevOp = ((AMDGPUOperand &)*Operands[InvalidOprIdx - 1]);
5292 StringRef Mnemo = ((AMDGPUOperand &)*Operands[0]).getToken();
5311 ErrorLoc = ((AMDGPUOperand &)*Operands[ErrorInfo]).getStartLoc();
6317 AMDGPUOperand::CreateToken(this, "[", LBraceLoc));
6318 Operands.push_back(AMDGPUOperand::CreateToken(this, "]", RBraceLoc));
6371 Operands.push_back(AMDGPUOperand::CreateToken(this, Name, NameLoc));
6412 Operands.push_back(AMDGPUOperand::CreateToken(this, Name, S));
6426 const char *Prefix, OperandVector &Operands, AMDGPUOperand::ImmTy ImmTy,
6439 Operands.push_back(AMDGPUOperand::CreateImm(this, Value, S, ImmTy));
6444 const char *Prefix, OperandVector &Operands, AMDGPUOperand::ImmTy ImmTy,
6479 Operands.push_back(AMDGPUOperand::CreateImm(this, Val, S, ImmTy));
6485 AMDGPUOperand::ImmTy ImmTy) {
6502 if (isGFX9() && ImmTy == AMDGPUOperand::ImmTyA16)
6503 ImmTy = AMDGPUOperand::ImmTyR128A16;
6505 Operands.push_back(AMDGPUOperand::CreateImm(this, Bit, S, ImmTy));
6566 Operands.push_back(AMDGPUOperand::CreateImm(this, CPolVal, StringLoc,
6567 AMDGPUOperand::ImmTyCPol));
6571 StringRef Mnemo = ((AMDGPUOperand &)*Operands[0]).getToken();
6602 AMDGPUOperand::CreateImm(this, Enabled, OpLoc, AMDGPUOperand::ImmTyCPol));
6695 AMDGPUOperand::ImmTy ImmT,
6700 ((AMDGPUOperand &)*Operands[Idx]).addImmOperands(Inst, 1);
6743 AMDGPUOperand::ImmTy ImmTy) {
6751 if (ImmTy == AMDGPUOperand::ImmTyIndexKey16bit && (ImmVal < 0 || ImmVal > 1))
6754 if (ImmTy == AMDGPUOperand::ImmTyIndexKey8bit && (ImmVal < 0 || ImmVal > 3))
6757 Operands.push_back(AMDGPUOperand::CreateImm(this, ImmVal, Loc, ImmTy));
6762 return tryParseIndexKey(Operands, AMDGPUOperand::ImmTyIndexKey8bit);
6766 return tryParseIndexKey(Operands, AMDGPUOperand::ImmTyIndexKey16bit);
6948 AMDGPUOperand::CreateImm(this, Format, Loc, AMDGPUOperand::ImmTyFORMAT));
6972 AMDGPUOperand &Op = static_cast<AMDGPUOperand &>(*Operands[Size - 2]);
6973 assert(Op.isImm() && Op.getImmTy() == AMDGPUOperand::ImmTyFORMAT);
6986 parseIntWithPrefix("offset", Operands, AMDGPUOperand::ImmTyOffset);
6989 AMDGPUOperand::ImmTyInstOffset);
6996 parseNamedBit("r128", Operands, AMDGPUOperand::ImmTyR128A16);
6998 Res = parseNamedBit("a16", Operands, AMDGPUOperand::ImmTyA16);
7004 parseIntWithPrefix("blgp", Operands, AMDGPUOperand::ImmTyBLGP);
7007 parseOperandArrayWithPrefix("neg", Operands, AMDGPUOperand::ImmTyBLGP);
7024 AMDGPUOperand &Op = ((AMDGPUOperand &)*Operands[i]);
7043 if (Op.isImm() && Op.getImmTy() == AMDGPUOperand::ImmTyExpTgt) {
7058 if (OptionalIdx.find(AMDGPUOperand::ImmTyExpCompr) != OptionalIdx.end()) {
7071 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTyExpVM);
7072 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTyExpCompr);
7166 Operands.push_back(AMDGPUOperand::CreateImm(this, Waitcnt, S));
7246 Operands.push_back(AMDGPUOperand::CreateImm(this, Delay, S));
7251 AMDGPUOperand::isSWaitCnt() const {
7255 bool AMDGPUOperand::isSDelayALU() const { return isImm(); }
7336 Operands.push_back(AMDGPUOperand::CreateImm(this, DepCtr, Loc));
7340 bool AMDGPUOperand::isDepCtr() const { return isS16Imm(); }
7425 AMDGPUOperand::CreateImm(this, ImmVal, Loc, AMDGPUOperand::ImmTyHwreg));
7429 bool AMDGPUOperand::isHwreg() const {
7546 Operands.push_back(AMDGPUOperand::CreateImm(this, ImmVal, Loc, AMDGPUOperand::ImmTySendMsg));
7550 bool AMDGPUOperand::isSendMsg() const {
7574 Operands.push_back(AMDGPUOperand::CreateImm(this, Slot, S,
7575 AMDGPUOperand::ImmTyInterpSlot));
7610 Operands.push_back(AMDGPUOperand::CreateImm(this, Attr, S,
7611 AMDGPUOperand::ImmTyInterpAttr));
7612 Operands.push_back(AMDGPUOperand::CreateImm(
7613 this, AttrChan, SChan, AMDGPUOperand::ImmTyInterpAttrChan));
7636 Operands.push_back(AMDGPUOperand::CreateImm(this, Id, S,
7637 AMDGPUOperand::ImmTyExpTgt));
7744 Operands.push_back(AMDGPUOperand::CreateImm(this, IntVal, S));
7746 Operands.push_back(AMDGPUOperand::CreateExpr(this, Expr, S));
7814 return ((AMDGPUOperand &)*Operands[0]).getStartLoc();
7818 AMDGPUAsmParser::getOperandLoc(std::function<bool(const AMDGPUOperand&)> Test,
7821 AMDGPUOperand &Op = ((AMDGPUOperand &)*Operands[i]);
7829 AMDGPUAsmParser::getImmLoc(AMDGPUOperand::ImmTy Type,
7831 auto Test = [=](const AMDGPUOperand& Op) { return Op.isImmTy(Type); };
7838 auto Test = [=](const AMDGPUOperand& Op) {
7846 auto Test = [](const AMDGPUOperand& Op) {
7856 auto Test = [](const AMDGPUOperand &Op) {
7864 auto Test = [](const AMDGPUOperand& Op) {
8158 Operands.push_back(AMDGPUOperand::CreateImm(this, Imm, S, AMDGPUOperand::ImmTySwizzle));
8166 AMDGPUOperand::isSwizzle() const {
8237 AMDGPUOperand::CreateImm(this, Imm, S, AMDGPUOperand::ImmTyGprIdxMode));
8241 bool AMDGPUOperand::isGPRIdxMode() const {
8260 AMDGPUOperand &Opr = ((AMDGPUOperand &)*Operands[Operands.size() - 1]);
8300 AMDGPUOperand &Op = ((AMDGPUOperand &)*Operands[i]);
8314 if (Op.isImm() && Op.getImmTy() == AMDGPUOperand::ImmTyNone) {
8330 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTyOffset);
8331 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTyCPol, 0);
8338 bool AMDGPUOperand::isSMRDOffset8() const {
8342 bool AMDGPUOperand::isSMEMOffset() const {
8347 bool AMDGPUOperand::isSMRDLiteralOffset() const {
8465 AMDGPUOperand::ImmTyOModSI, ConvertOmodMul);
8470 AMDGPUOperand::ImmTyOModSI, ConvertOmodDiv);
8546 ((AMDGPUOperand &)*Operands[I++]).addRegOperands(Inst, 1);
8550 AMDGPUOperand &Op = ((AMDGPUOperand &)*Operands[I]);
8565 AMDGPUOperand::ImmTyHigh);
8569 AMDGPUOperand::ImmTyClamp);
8573 AMDGPUOperand::ImmTyOModSI);
8584 ((AMDGPUOperand &)*Operands[I++]).addRegOperands(Inst, 1);
8588 AMDGPUOperand &Op = ((AMDGPUOperand &)*Operands[I]);
8598 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTyClamp);
8602 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTyOpSel);
8604 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTyWaitEXP);
8643 ((AMDGPUOperand &)*Operands[I++]).addRegOperands(Inst, 1);
8647 AMDGPUOperand &Op = ((AMDGPUOperand &)*Operands[I]);
8663 AMDGPUOperand::ImmTyByteSel);
8668 AMDGPUOperand::ImmTyClamp);
8672 AMDGPUOperand::ImmTyOModSI);
8728 addOptionalImmOperand(Inst, Operands, OptIdx, AMDGPUOperand::ImmTyOpSel);
8734 addOptionalImmOperand(Inst, Operands, OptIdx, AMDGPUOperand::ImmTyOpSelHi,
8740 addOptionalImmOperand(Inst, Operands, OptIdx, AMDGPUOperand::ImmTyNegLo);
8744 addOptionalImmOperand(Inst, Operands, OptIdx, AMDGPUOperand::ImmTyNegHi);
8816 ((AMDGPUOperand &)*Operands[i]).addRegOrImmWithFPInputModsOperands(Inst, 2);
8818 ((AMDGPUOperand &)*Operands[i]).addRegOperands(Inst, 1);
8824 ((AMDGPUOperand &)*Operands[1]).addRegOperands(Inst, 1);
8827 ((AMDGPUOperand &)*Operands[1]).addRegOperands(Inst, 1); // srcTiedDef
8828 ((AMDGPUOperand &)*Operands[4]).addRegOperands(Inst, 1); // src2
8832 AMDGPUOperand &Op = ((AMDGPUOperand &)*Operands[i]);
8838 AMDGPUOperand::ImmTyIndexKey8bit);
8842 AMDGPUOperand::ImmTyIndexKey16bit);
8845 addOptionalImmOperand(Inst, Operands, OptIdx, AMDGPUOperand::ImmTyClamp);
8862 Operands.push_back(AMDGPUOperand::CreateToken(this, "::", S));
8866 Operands.push_back(AMDGPUOperand::CreateToken(this, OpYName, OpYLoc));
8877 AMDGPUOperand &Op = ((AMDGPUOperand &)*Operands[ParsedOprIdx]);
8912 bool AMDGPUOperand::isDPP8() const {
8916 bool AMDGPUOperand::isDPPCtrl() const {
8944 bool AMDGPUOperand::isBLGP() const {
8948 bool AMDGPUOperand::isS16Imm() const {
8952 bool AMDGPUOperand::isU16Imm() const {
9003 Operands.push_back(AMDGPUOperand::CreateImm(this, Encoding, S,
9004 AMDGPUOperand::ImmTyDim));
9043 Operands.push_back(AMDGPUOperand::CreateImm(this, DPP8, S, AMDGPUOperand::ImmTyDPP8));
9181 AMDGPUOperand::CreateImm(this, Val, S, AMDGPUOperand::ImmTyDppCtrl));
9202 ((AMDGPUOperand &)*Operands[I++]).addRegOperands(Inst, 1);
9244 AMDGPUOperand &Op = ((AMDGPUOperand &)*Operands[I]);
9265 AMDGPUOperand::ImmTyByteSel);
9269 AMDGPUOperand::ImmTyClamp);
9272 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTyOModSI);
9279 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTyOpSel);
9283 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTyDPP8);
9287 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTyDppCtrl, 0xe4);
9288 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTyDppRowMask, 0xf);
9289 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTyDppBankMask, 0xf);
9290 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTyDppBoundCtrl);
9294 AMDGPUOperand::ImmTyDppFI);
9304 ((AMDGPUOperand &)*Operands[I++]).addRegOperands(Inst, 1);
9316 AMDGPUOperand &Op = ((AMDGPUOperand &)*Operands[I]);
9356 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTyDppRowMask, 0xf);
9357 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTyDppBankMask, 0xf);
9358 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTyDppBoundCtrl);
9361 AMDGPUOperand::ImmTyDppFI);
9372 AMDGPUOperand::ImmTy Type) {
9397 Operands.push_back(AMDGPUOperand::CreateImm(this, Int, S, Type));
9422 Operands.push_back(AMDGPUOperand::CreateImm(this, Int, S, AMDGPUOperand::ImmTySDWADstUnused));
9459 ((AMDGPUOperand &)*Operands[I++]).addRegOperands(Inst, 1);
9463 AMDGPUOperand &Op = ((AMDGPUOperand &)*Operands[I]);
9501 AMDGPUOperand::ImmTyClamp, 0);
9505 AMDGPUOperand::ImmTyOModSI, 0);
9509 AMDGPUOperand::ImmTySDWADstSel, SdwaSel::DWORD);
9513 AMDGPUOperand::ImmTySDWADstUnused,
9516 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTySDWASrc0Sel, SdwaSel::DWORD);
9521 AMDGPUOperand::ImmTyClamp, 0);
9524 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTyOModSI, 0);
9526 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTySDWADstSel, SdwaSel::DWORD);
9527 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTySDWADstUnused, DstUnused::UNUSED_PRESERVE);
9528 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTySDWASrc0Sel, SdwaSel::DWORD);
9529 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTySDWASrc1Sel, SdwaSel::DWORD);
9535 AMDGPUOperand::ImmTyClamp, 0);
9536 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTySDWASrc0Sel, SdwaSel::DWORD);
9537 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTySDWASrc1Sel, SdwaSel::DWORD);
9586 return parseNamedBit("gds", Operands, AMDGPUOperand::ImmTyGDS);
9588 return parseNamedBit("tfe", Operands, AMDGPUOperand::ImmTyTFE);
9601 AMDGPUOperand &Operand = (AMDGPUOperand&)Op;
9665 AMDGPUOperand::CreateImm(this, Imm, S, AMDGPUOperand::ImmTyEndpgm));
9669 bool AMDGPUOperand::isEndpgm() const { return isImmTy(ImmTyEndpgm); }
9675 bool AMDGPUOperand::isSplitBarrier() const { return isInlinableImm(MVT::i32); }