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);
965 auto getPredicate(std::function<bool(const AMDGPUOperand &Op)> P) const {
1174 static AMDGPUOperand::Ptr CreateImm(const AMDGPUAsmParser *AsmParser,
1178 auto Op = std::make_unique<AMDGPUOperand>(Immediate, AsmParser);
1189 static AMDGPUOperand::Ptr CreateToken(const AMDGPUAsmParser *AsmParser,
1192 auto Res = std::make_unique<AMDGPUOperand>(Token, AsmParser);
1200 static AMDGPUOperand::Ptr CreateReg(const AMDGPUAsmParser *AsmParser,
1202 auto Op = std::make_unique<AMDGPUOperand>(Register, AsmParser);
1210 static AMDGPUOperand::Ptr CreateExpr(const AMDGPUAsmParser *AsmParser,
1212 auto Op = std::make_unique<AMDGPUOperand>(Expression, AsmParser);
1220 raw_ostream &operator <<(raw_ostream &OS, AMDGPUOperand::Modifiers Mods) {
1416 using OptionalImmIndexMap = std::map<AMDGPUOperand::ImmTy, unsigned>;
1597 std::unique_ptr<AMDGPUOperand> parseRegister(bool RestoreOnFailure = false);
1624 AMDGPUOperand::ImmTy ImmTy = AMDGPUOperand::ImmTyNone,
1629 AMDGPUOperand::ImmTy ImmTy = AMDGPUOperand::ImmTyNone,
1634 AMDGPUOperand::ImmTy ImmTy = AMDGPUOperand::ImmTyNone);
1648 AMDGPUOperand::ImmTy Type);
1669 AMDGPUOperand::ImmTy ImmTy);
1752 SMLoc getOperandLoc(std::function<bool(const AMDGPUOperand&)> Test,
1754 SMLoc getImmLoc(AMDGPUOperand::ImmTy Type, const OperandVector &Operands) const;
1908 AMDGPUOperand::ImmTy Type);
2035 bool AMDGPUOperand::isInlinableImm(MVT type) const {
2119 bool AMDGPUOperand::isLiteralImm(MVT type) const {
2172 bool AMDGPUOperand::isRegClass(unsigned RCID) const {
2176 bool AMDGPUOperand::isVRegWithInputMods() const {
2184 bool AMDGPUOperand::isT16_Lo128VRegWithInputMods() const {
2189 template <bool IsFake16> bool AMDGPUOperand::isT16VRegWithInputMods() const {
2194 bool AMDGPUOperand::isSDWAOperand(MVT type) const {
2202 bool AMDGPUOperand::isSDWAFP16Operand() const {
2206 bool AMDGPUOperand::isSDWAFP32Operand() const {
2210 bool AMDGPUOperand::isSDWAInt16Operand() const {
2214 bool AMDGPUOperand::isSDWAInt32Operand() const {
2218 bool AMDGPUOperand::isBoolReg() const {
2224 uint64_t AMDGPUOperand::applyInputFPModifiers(uint64_t Val, unsigned Size) const
2241 void AMDGPUOperand::addImmOperands(MCInst &Inst, unsigned N, bool ApplyModifiers) const {
2259 void AMDGPUOperand::addLiteralImmOperand(MCInst &Inst, int64_t Val, bool ApplyModifiers) const {
2511 void AMDGPUOperand::addRegOperands(MCInst &Inst, unsigned N) const {
2515 bool AMDGPUOperand::isInlineValue() const {
3140 std::unique_ptr<AMDGPUOperand>
3157 return AMDGPUOperand::CreateReg(this, Reg, StartLoc, EndLoc);
3193 AMDGPUOperand::Modifiers Mods;
3212 AMDGPUOperand::CreateImm(this, RealVal.bitcastToAPInt().getZExtValue(), S,
3213 AMDGPUOperand::ImmTyNone, true));
3214 AMDGPUOperand &Op = static_cast<AMDGPUOperand &>(*Operands.back());
3241 Operands.push_back(AMDGPUOperand::CreateImm(this, IntVal, S));
3242 AMDGPUOperand &Op = static_cast<AMDGPUOperand &>(*Operands.back());
3247 Operands.push_back(AMDGPUOperand::CreateExpr(this, Expr, S));
3421 AMDGPUOperand::Modifiers Mods;
3427 AMDGPUOperand &Op = static_cast<AMDGPUOperand &>(*Operands.back());
3454 AMDGPUOperand::Modifiers Mods;
3458 AMDGPUOperand &Op = static_cast<AMDGPUOperand &>(*Operands.back());
3478 Operands.push_back(AMDGPUOperand::CreateImm(this, 0, Loc,
3479 AMDGPUOperand::ImmTyOff, false));
3486 std::unique_ptr<AMDGPUOperand> Reg = parseRegister();
3866 auto Loc = ((AMDGPUOperand &)*Operands[ParsedIdx]).getStartLoc();
4067 AMDGPUOperand &Op = ((AMDGPUOperand &)*Operands[i]);
4464 AMDGPUOperand &Op = ((AMDGPUOperand &)*Operands[i]);
4542 AMDGPUOperand &Op = ((AMDGPUOperand &)*Operands[i]);
4703 SMLoc S = getImmLoc(AMDGPUOperand::ImmTyDppCtrl, Operands);
4882 AMDGPUOperand &Op = ((AMDGPUOperand &)*Operands[i]);
4960 SMLoc S = getImmLoc(AMDGPUOperand::ImmTyGDS, Operands);
5011 SMLoc S = getImmLoc(AMDGPUOperand::ImmTyCPol, Operands);
5026 SMLoc S = getImmLoc(AMDGPUOperand::ImmTyCPol, Operands);
5046 SMLoc S = getImmLoc(AMDGPUOperand::ImmTyCPol, Operands);
5069 SMLoc S = getImmLoc(AMDGPUOperand::ImmTyCPol, Operands);
5118 SMLoc Loc = getImmLoc(AMDGPUOperand::ImmTyTFE, Operands);
5150 Error(getImmLoc(AMDGPUOperand::ImmTyClamp, Operands),
5155 Error(getImmLoc(AMDGPUOperand::ImmTyOpSel, Operands),
5160 Error(getImmLoc(AMDGPUOperand::ImmTyNegLo, Operands),
5165 Error(getImmLoc(AMDGPUOperand::ImmTyNegHi, Operands),
5174 Error(getImmLoc(AMDGPUOperand::ImmTyD16, Operands),
5183 Error(getImmLoc(AMDGPUOperand::ImmTyDim, Operands),
5193 Error(getImmLoc(AMDGPUOperand::ImmTyDMask, Operands),
5198 Error(getImmLoc(AMDGPUOperand::ImmTyDMask, Operands),
5327 const auto &Op = ((AMDGPUOperand &)*Operands[InvalidOprIdx]);
5329 const auto &PrevOp = ((AMDGPUOperand &)*Operands[InvalidOprIdx - 1]);
5369 StringRef Mnemo = ((AMDGPUOperand &)*Operands[0]).getToken();
5388 ErrorLoc = ((AMDGPUOperand &)*Operands[ErrorInfo]).getStartLoc();
6403 AMDGPUOperand::CreateToken(this, "[", LBraceLoc));
6404 Operands.push_back(AMDGPUOperand::CreateToken(this, "]", RBraceLoc));
6457 Operands.push_back(AMDGPUOperand::CreateToken(this, Name, NameLoc));
6498 Operands.push_back(AMDGPUOperand::CreateToken(this, Name, S));
6512 const char *Prefix, OperandVector &Operands, AMDGPUOperand::ImmTy ImmTy,
6525 Operands.push_back(AMDGPUOperand::CreateImm(this, Value, S, ImmTy));
6530 const char *Prefix, OperandVector &Operands, AMDGPUOperand::ImmTy ImmTy,
6565 Operands.push_back(AMDGPUOperand::CreateImm(this, Val, S, ImmTy));
6571 AMDGPUOperand::ImmTy ImmTy) {
6588 if (isGFX9() && ImmTy == AMDGPUOperand::ImmTyA16)
6589 ImmTy = AMDGPUOperand::ImmTyR128A16;
6591 Operands.push_back(AMDGPUOperand::CreateImm(this, Bit, S, ImmTy));
6652 Operands.push_back(AMDGPUOperand::CreateImm(this, CPolVal, StringLoc,
6653 AMDGPUOperand::ImmTyCPol));
6657 StringRef Mnemo = ((AMDGPUOperand &)*Operands[0]).getToken();
6688 AMDGPUOperand::CreateImm(this, Enabled, OpLoc, AMDGPUOperand::ImmTyCPol));
6771 AMDGPUOperand::ImmTy ImmT,
6776 ((AMDGPUOperand &)*Operands[Idx]).addImmOperands(Inst, 1);
6820 AMDGPUOperand::ImmTy Type) {
6826 Operands.push_back(AMDGPUOperand::CreateImm(this, IntVal, S, Type));
6857 AMDGPUOperand::ImmTy ImmTy) {
6865 if (ImmTy == AMDGPUOperand::ImmTyIndexKey16bit && (ImmVal < 0 || ImmVal > 1))
6868 if (ImmTy == AMDGPUOperand::ImmTyIndexKey8bit && (ImmVal < 0 || ImmVal > 3))
6871 Operands.push_back(AMDGPUOperand::CreateImm(this, ImmVal, Loc, ImmTy));
6876 return tryParseIndexKey(Operands, AMDGPUOperand::ImmTyIndexKey8bit);
6880 return tryParseIndexKey(Operands, AMDGPUOperand::ImmTyIndexKey16bit);
7062 AMDGPUOperand::CreateImm(this, Format, Loc, AMDGPUOperand::ImmTyFORMAT));
7086 AMDGPUOperand &Op = static_cast<AMDGPUOperand &>(*Operands[Size - 2]);
7087 assert(Op.isImm() && Op.getImmTy() == AMDGPUOperand::ImmTyFORMAT);
7100 parseIntWithPrefix("offset", Operands, AMDGPUOperand::ImmTyOffset);
7103 AMDGPUOperand::ImmTyInstOffset);
7110 parseNamedBit("r128", Operands, AMDGPUOperand::ImmTyR128A16);
7112 Res = parseNamedBit("a16", Operands, AMDGPUOperand::ImmTyA16);
7118 parseIntWithPrefix("blgp", Operands, AMDGPUOperand::ImmTyBLGP);
7121 parseOperandArrayWithPrefix("neg", Operands, AMDGPUOperand::ImmTyBLGP);
7138 AMDGPUOperand &Op = ((AMDGPUOperand &)*Operands[i]);
7157 if (Op.isImm() && Op.getImmTy() == AMDGPUOperand::ImmTyExpTgt) {
7172 if (OptionalIdx.find(AMDGPUOperand::ImmTyExpCompr) != OptionalIdx.end()) {
7185 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTyExpVM);
7186 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTyExpCompr);
7280 Operands.push_back(AMDGPUOperand::CreateImm(this, Waitcnt, S));
7360 Operands.push_back(AMDGPUOperand::CreateImm(this, Delay, S));
7365 AMDGPUOperand::isSWaitCnt() const {
7369 bool AMDGPUOperand::isSDelayALU() const { return isImm(); }
7450 Operands.push_back(AMDGPUOperand::CreateImm(this, DepCtr, Loc));
7454 bool AMDGPUOperand::isDepCtr() const { return isS16Imm(); }
7539 AMDGPUOperand::CreateImm(this, ImmVal, Loc, AMDGPUOperand::ImmTyHwreg));
7543 bool AMDGPUOperand::isHwreg() const {
7660 Operands.push_back(AMDGPUOperand::CreateImm(this, ImmVal, Loc, AMDGPUOperand::ImmTySendMsg));
7664 bool AMDGPUOperand::isSendMsg() const {
7688 Operands.push_back(AMDGPUOperand::CreateImm(this, Slot, S,
7689 AMDGPUOperand::ImmTyInterpSlot));
7724 Operands.push_back(AMDGPUOperand::CreateImm(this, Attr, S,
7725 AMDGPUOperand::ImmTyInterpAttr));
7726 Operands.push_back(AMDGPUOperand::CreateImm(
7727 this, AttrChan, SChan, AMDGPUOperand::ImmTyInterpAttrChan));
7750 Operands.push_back(AMDGPUOperand::CreateImm(this, Id, S,
7751 AMDGPUOperand::ImmTyExpTgt));
7858 Operands.push_back(AMDGPUOperand::CreateImm(this, IntVal, S));
7860 Operands.push_back(AMDGPUOperand::CreateExpr(this, Expr, S));
7928 return ((AMDGPUOperand &)*Operands[0]).getStartLoc();
7932 AMDGPUAsmParser::getOperandLoc(std::function<bool(const AMDGPUOperand&)> Test,
7935 AMDGPUOperand &Op = ((AMDGPUOperand &)*Operands[i]);
7943 AMDGPUAsmParser::getImmLoc(AMDGPUOperand::ImmTy Type,
7945 auto Test = [=](const AMDGPUOperand& Op) { return Op.isImmTy(Type); };
7951 auto Test = [=](const AMDGPUOperand& Op) {
7959 auto Test = [](const AMDGPUOperand& Op) {
7969 auto Test = [](const AMDGPUOperand &Op) {
7977 auto Test = [](const AMDGPUOperand& Op) {
8320 Operands.push_back(AMDGPUOperand::CreateImm(this, Imm, S, AMDGPUOperand::ImmTySwizzle));
8328 AMDGPUOperand::isSwizzle() const {
8399 AMDGPUOperand::CreateImm(this, Imm, S, AMDGPUOperand::ImmTyGprIdxMode));
8403 bool AMDGPUOperand::isGPRIdxMode() const {
8422 AMDGPUOperand &Opr = ((AMDGPUOperand &)*Operands[Operands.size() - 1]);
8462 AMDGPUOperand &Op = ((AMDGPUOperand &)*Operands[i]);
8476 if (Op.isImm() && Op.getImmTy() == AMDGPUOperand::ImmTyNone) {
8492 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTyOffset);
8493 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTyCPol, 0);
8500 bool AMDGPUOperand::isSMRDOffset8() const {
8504 bool AMDGPUOperand::isSMEMOffset() const {
8509 bool AMDGPUOperand::isSMRDLiteralOffset() const {
8627 AMDGPUOperand::ImmTyOModSI, ConvertOmodMul);
8632 AMDGPUOperand::ImmTyOModSI, ConvertOmodDiv);
8708 ((AMDGPUOperand &)*Operands[I++]).addRegOperands(Inst, 1);
8712 AMDGPUOperand &Op = ((AMDGPUOperand &)*Operands[I]);
8727 AMDGPUOperand::ImmTyHigh);
8731 AMDGPUOperand::ImmTyClamp);
8735 AMDGPUOperand::ImmTyOModSI);
8746 ((AMDGPUOperand &)*Operands[I++]).addRegOperands(Inst, 1);
8750 AMDGPUOperand &Op = ((AMDGPUOperand &)*Operands[I]);
8760 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTyClamp);
8764 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTyOpSel);
8766 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTyWaitEXP);
8805 ((AMDGPUOperand &)*Operands[I++]).addRegOperands(Inst, 1);
8809 AMDGPUOperand &Op = ((AMDGPUOperand &)*Operands[I]);
8823 AMDGPUOperand::ImmTyByteSel);
8828 AMDGPUOperand::ImmTyClamp);
8832 AMDGPUOperand::ImmTyOModSI);
8886 addOptionalImmOperand(Inst, Operands, OptIdx, AMDGPUOperand::ImmTyBitOp3);
8894 addOptionalImmOperand(Inst, Operands, OptIdx, AMDGPUOperand::ImmTyOpSel);
8900 addOptionalImmOperand(Inst, Operands, OptIdx, AMDGPUOperand::ImmTyOpSelHi,
8906 addOptionalImmOperand(Inst, Operands, OptIdx, AMDGPUOperand::ImmTyNegLo);
8910 addOptionalImmOperand(Inst, Operands, OptIdx, AMDGPUOperand::ImmTyNegHi);
8982 ((AMDGPUOperand &)*Operands[i]).addRegOrImmWithFPInputModsOperands(Inst, 2);
8984 ((AMDGPUOperand &)*Operands[i]).addRegOperands(Inst, 1);
8990 ((AMDGPUOperand &)*Operands[1]).addRegOperands(Inst, 1);
8993 ((AMDGPUOperand &)*Operands[1]).addRegOperands(Inst, 1); // srcTiedDef
8994 ((AMDGPUOperand &)*Operands[4]).addRegOperands(Inst, 1); // src2
8998 AMDGPUOperand &Op = ((AMDGPUOperand &)*Operands[i]);
9004 AMDGPUOperand::ImmTyIndexKey8bit);
9008 AMDGPUOperand::ImmTyIndexKey16bit);
9011 addOptionalImmOperand(Inst, Operands, OptIdx, AMDGPUOperand::ImmTyClamp);
9028 Operands.push_back(AMDGPUOperand::CreateToken(this, "::", S));
9032 Operands.push_back(AMDGPUOperand::CreateToken(this, OpYName, OpYLoc));
9043 AMDGPUOperand &Op = ((AMDGPUOperand &)*Operands[ParsedOprIdx]);
9078 bool AMDGPUOperand::isDPP8() const {
9082 bool AMDGPUOperand::isDPPCtrl() const {
9110 bool AMDGPUOperand::isBLGP() const {
9114 bool AMDGPUOperand::isS16Imm() const {
9118 bool AMDGPUOperand::isU16Imm() const {
9169 Operands.push_back(AMDGPUOperand::CreateImm(this, Encoding, S,
9170 AMDGPUOperand::ImmTyDim));
9209 Operands.push_back(AMDGPUOperand::CreateImm(this, DPP8, S, AMDGPUOperand::ImmTyDPP8));
9347 AMDGPUOperand::CreateImm(this, Val, S, AMDGPUOperand::ImmTyDppCtrl));
9368 ((AMDGPUOperand &)*Operands[I++]).addRegOperands(Inst, 1);
9410 AMDGPUOperand &Op = ((AMDGPUOperand &)*Operands[I]);
9431 AMDGPUOperand::ImmTyByteSel);
9435 AMDGPUOperand::ImmTyClamp);
9438 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTyOModSI);
9445 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTyOpSel);
9449 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTyDPP8);
9453 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTyDppCtrl, 0xe4);
9454 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTyDppRowMask, 0xf);
9455 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTyDppBankMask, 0xf);
9456 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTyDppBoundCtrl);
9460 AMDGPUOperand::ImmTyDppFI);
9470 ((AMDGPUOperand &)*Operands[I++]).addRegOperands(Inst, 1);
9482 AMDGPUOperand &Op = ((AMDGPUOperand &)*Operands[I]);
9522 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTyDppRowMask, 0xf);
9523 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTyDppBankMask, 0xf);
9524 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTyDppBoundCtrl);
9527 AMDGPUOperand::ImmTyDppFI);
9538 AMDGPUOperand::ImmTy Type) {
9548 AMDGPUOperand::ImmTySDWADstUnused);
9584 ((AMDGPUOperand &)*Operands[I++]).addRegOperands(Inst, 1);
9588 AMDGPUOperand &Op = ((AMDGPUOperand &)*Operands[I]);
9626 AMDGPUOperand::ImmTyClamp, 0);
9630 AMDGPUOperand::ImmTyOModSI, 0);
9634 AMDGPUOperand::ImmTySDWADstSel, SdwaSel::DWORD);
9638 AMDGPUOperand::ImmTySDWADstUnused,
9641 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTySDWASrc0Sel, SdwaSel::DWORD);
9646 AMDGPUOperand::ImmTyClamp, 0);
9649 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTyOModSI, 0);
9651 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTySDWADstSel, SdwaSel::DWORD);
9652 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTySDWADstUnused, DstUnused::UNUSED_PRESERVE);
9653 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTySDWASrc0Sel, SdwaSel::DWORD);
9654 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTySDWASrc1Sel, SdwaSel::DWORD);
9660 AMDGPUOperand::ImmTyClamp, 0);
9661 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTySDWASrc0Sel, SdwaSel::DWORD);
9662 addOptionalImmOperand(Inst, Operands, OptionalIdx, AMDGPUOperand::ImmTySDWASrc1Sel, SdwaSel::DWORD);
9711 return parseNamedBit("gds", Operands, AMDGPUOperand::ImmTyGDS);
9713 return parseNamedBit("tfe", Operands, AMDGPUOperand::ImmTyTFE);
9726 AMDGPUOperand &Operand = (AMDGPUOperand&)Op;
9794 AMDGPUOperand::CreateImm(this, Imm, S, AMDGPUOperand::ImmTyEndpgm));
9798 bool AMDGPUOperand::isEndpgm() const { return isImmTy(ImmTyEndpgm); }
9804 bool AMDGPUOperand::isSplitBarrier() const { return isInlinableImm(MVT::i32); }