@@ -157,6 +157,7 @@ class AMDGPUOperand : public MCParsedAsmOperand {
157157 ImmTyNegHi,
158158 ImmTyIndexKey8bit,
159159 ImmTyIndexKey16bit,
160+ ImmTyIndexKey32bit,
160161 ImmTyDPP8,
161162 ImmTyDppCtrl,
162163 ImmTyDppRowMask,
@@ -174,8 +175,10 @@ class AMDGPUOperand : public MCParsedAsmOperand {
174175 ImmTyWaitEXP,
175176 ImmTyWaitVAVDst,
176177 ImmTyWaitVMVSrc,
177- ImmTyByteSel,
178178 ImmTyBitOp3,
179+ ImmTyMatrixAReuse,
180+ ImmTyMatrixBReuse,
181+ ImmTyByteSel,
179182 };
180183
181184 // Immediate operand kind.
@@ -419,6 +422,9 @@ class AMDGPUOperand : public MCParsedAsmOperand {
419422 bool isCPol () const { return isImmTy (ImmTyCPol); }
420423 bool isIndexKey8bit () const { return isImmTy (ImmTyIndexKey8bit); }
421424 bool isIndexKey16bit () const { return isImmTy (ImmTyIndexKey16bit); }
425+ bool isIndexKey32bit () const { return isImmTy (ImmTyIndexKey32bit); }
426+ bool isMatrixAReuse () const { return isImmTy (ImmTyMatrixAReuse); }
427+ bool isMatrixBReuse () const { return isImmTy (ImmTyMatrixBReuse); }
422428 bool isTFE () const { return isImmTy (ImmTyTFE); }
423429 bool isFORMAT () const { return isImmTy (ImmTyFORMAT) && isUInt<7 >(getImm ()); }
424430 bool isDppFI () const { return isImmTy (ImmTyDppFI); }
@@ -747,6 +753,10 @@ class AMDGPUOperand : public MCParsedAsmOperand {
747753 return isRegOrInlineNoMods (AMDGPU::VReg_256RegClassID, MVT::f64 );
748754 }
749755
756+ bool isVISrc_512_f64 () const {
757+ return isRegOrInlineNoMods (AMDGPU::VReg_512RegClassID, MVT::f64 );
758+ }
759+
750760 bool isVISrc_128B16 () const {
751761 return isRegOrInlineNoMods (AMDGPU::VReg_128RegClassID, MVT::i16 );
752762 }
@@ -1116,6 +1126,7 @@ class AMDGPUOperand : public MCParsedAsmOperand {
11161126 case ImmTyCPol: OS << " CPol" ; break ;
11171127 case ImmTyIndexKey8bit: OS << " index_key" ; break ;
11181128 case ImmTyIndexKey16bit: OS << " index_key" ; break ;
1129+ case ImmTyIndexKey32bit: OS << " index_key" ; break ;
11191130 case ImmTyTFE: OS << " TFE" ; break ;
11201131 case ImmTyD16: OS << " D16" ; break ;
11211132 case ImmTyFORMAT: OS << " FORMAT" ; break ;
@@ -1162,8 +1173,10 @@ class AMDGPUOperand : public MCParsedAsmOperand {
11621173 case ImmTyWaitEXP: OS << " WaitEXP" ; break ;
11631174 case ImmTyWaitVAVDst: OS << " WaitVAVDst" ; break ;
11641175 case ImmTyWaitVMVSrc: OS << " WaitVMVSrc" ; break ;
1165- case ImmTyByteSel: OS << " ByteSel" ; break ;
11661176 case ImmTyBitOp3: OS << " BitOp3" ; break ;
1177+ case ImmTyMatrixAReuse: OS << " ImmTyMatrixAReuse" ; break ;
1178+ case ImmTyMatrixBReuse: OS << " ImmTyMatrixBReuse" ; break ;
1179+ case ImmTyByteSel: OS << " ByteSel" ; break ;
11671180 }
11681181 // clang-format on
11691182 }
@@ -1700,6 +1713,7 @@ class AMDGPUAsmParser : public MCTargetAsmParser {
17001713 AMDGPUOperand::ImmTy ImmTy);
17011714 ParseStatus parseIndexKey8bit (OperandVector &Operands);
17021715 ParseStatus parseIndexKey16bit (OperandVector &Operands);
1716+ ParseStatus parseIndexKey32bit (OperandVector &Operands);
17031717
17041718 ParseStatus parseDfmtNfmt (int64_t &Format);
17051719 ParseStatus parseUfmt (int64_t &Format);
@@ -7153,7 +7167,9 @@ ParseStatus AMDGPUAsmParser::tryParseIndexKey(OperandVector &Operands,
71537167 if (!Res.isSuccess ())
71547168 return Res;
71557169
7156- if (ImmTy == AMDGPUOperand::ImmTyIndexKey16bit && (ImmVal < 0 || ImmVal > 1 ))
7170+ if ((ImmTy == AMDGPUOperand::ImmTyIndexKey16bit ||
7171+ ImmTy == AMDGPUOperand::ImmTyIndexKey32bit) &&
7172+ (ImmVal < 0 || ImmVal > 1 ))
71577173 return Error (Loc, Twine (" out of range " , StringRef (Pref)));
71587174
71597175 if (ImmTy == AMDGPUOperand::ImmTyIndexKey8bit && (ImmVal < 0 || ImmVal > 3 ))
@@ -7171,6 +7187,10 @@ ParseStatus AMDGPUAsmParser::parseIndexKey16bit(OperandVector &Operands) {
71717187 return tryParseIndexKey (Operands, AMDGPUOperand::ImmTyIndexKey16bit);
71727188}
71737189
7190+ ParseStatus AMDGPUAsmParser::parseIndexKey32bit (OperandVector &Operands) {
7191+ return tryParseIndexKey (Operands, AMDGPUOperand::ImmTyIndexKey32bit);
7192+ }
7193+
71747194// dfmt and nfmt (in a tbuffer instruction) are parsed as one to allow their
71757195// values to live in a joint format operand in the MCInst encoding.
71767196ParseStatus AMDGPUAsmParser::parseDfmtNfmt (int64_t &Format) {
@@ -9272,6 +9292,14 @@ void AMDGPUAsmParser::cvtVOP3P(MCInst &Inst, const OperandVector &Operands,
92729292 DefaultVal);
92739293 }
92749294
9295+ if (AMDGPU::hasNamedOperand (Opc, AMDGPU::OpName::matrix_a_reuse))
9296+ addOptionalImmOperand (Inst, Operands, OptIdx,
9297+ AMDGPUOperand::ImmTyMatrixAReuse, 0 );
9298+
9299+ if (AMDGPU::hasNamedOperand (Opc, AMDGPU::OpName::matrix_b_reuse))
9300+ addOptionalImmOperand (Inst, Operands, OptIdx,
9301+ AMDGPUOperand::ImmTyMatrixBReuse, 0 );
9302+
92759303 int NegLoIdx = AMDGPU::getNamedOperandIdx (Opc, AMDGPU::OpName::neg_lo);
92769304 if (NegLoIdx != -1 )
92779305 addOptionalImmOperand (Inst, Operands, OptIdx, AMDGPUOperand::ImmTyNegLo);
@@ -9378,6 +9406,10 @@ void AMDGPUAsmParser::cvtSWMMAC(MCInst &Inst, const OperandVector &Operands) {
93789406 addOptionalImmOperand (Inst, Operands, OptIdx,
93799407 AMDGPUOperand::ImmTyIndexKey16bit);
93809408
9409+ if (AMDGPU::hasNamedOperand (Opc, AMDGPU::OpName::index_key_32bit))
9410+ addOptionalImmOperand (Inst, Operands, OptIdx,
9411+ AMDGPUOperand::ImmTyIndexKey32bit);
9412+
93819413 if (AMDGPU::hasNamedOperand (Opc, AMDGPU::OpName::clamp))
93829414 addOptionalImmOperand (Inst, Operands, OptIdx, AMDGPUOperand::ImmTyClamp);
93839415
0 commit comments