@@ -157,6 +157,7 @@ class AMDGPUOperand : public MCParsedAsmOperand {
157
157
ImmTyNegHi,
158
158
ImmTyIndexKey8bit,
159
159
ImmTyIndexKey16bit,
160
+ ImmTyIndexKey32bit,
160
161
ImmTyDPP8,
161
162
ImmTyDppCtrl,
162
163
ImmTyDppRowMask,
@@ -174,8 +175,10 @@ class AMDGPUOperand : public MCParsedAsmOperand {
174
175
ImmTyWaitEXP,
175
176
ImmTyWaitVAVDst,
176
177
ImmTyWaitVMVSrc,
177
- ImmTyByteSel,
178
178
ImmTyBitOp3,
179
+ ImmTyMatrixAReuse,
180
+ ImmTyMatrixBReuse,
181
+ ImmTyByteSel,
179
182
};
180
183
181
184
// Immediate operand kind.
@@ -419,6 +422,9 @@ class AMDGPUOperand : public MCParsedAsmOperand {
419
422
bool isCPol () const { return isImmTy (ImmTyCPol); }
420
423
bool isIndexKey8bit () const { return isImmTy (ImmTyIndexKey8bit); }
421
424
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); }
422
428
bool isTFE () const { return isImmTy (ImmTyTFE); }
423
429
bool isFORMAT () const { return isImmTy (ImmTyFORMAT) && isUInt<7 >(getImm ()); }
424
430
bool isDppFI () const { return isImmTy (ImmTyDppFI); }
@@ -747,6 +753,10 @@ class AMDGPUOperand : public MCParsedAsmOperand {
747
753
return isRegOrInlineNoMods (AMDGPU::VReg_256RegClassID, MVT::f64 );
748
754
}
749
755
756
+ bool isVISrc_512_f64 () const {
757
+ return isRegOrInlineNoMods (AMDGPU::VReg_512RegClassID, MVT::f64 );
758
+ }
759
+
750
760
bool isVISrc_128B16 () const {
751
761
return isRegOrInlineNoMods (AMDGPU::VReg_128RegClassID, MVT::i16 );
752
762
}
@@ -1116,6 +1126,7 @@ class AMDGPUOperand : public MCParsedAsmOperand {
1116
1126
case ImmTyCPol: OS << " CPol" ; break ;
1117
1127
case ImmTyIndexKey8bit: OS << " index_key" ; break ;
1118
1128
case ImmTyIndexKey16bit: OS << " index_key" ; break ;
1129
+ case ImmTyIndexKey32bit: OS << " index_key" ; break ;
1119
1130
case ImmTyTFE: OS << " TFE" ; break ;
1120
1131
case ImmTyD16: OS << " D16" ; break ;
1121
1132
case ImmTyFORMAT: OS << " FORMAT" ; break ;
@@ -1162,8 +1173,10 @@ class AMDGPUOperand : public MCParsedAsmOperand {
1162
1173
case ImmTyWaitEXP: OS << " WaitEXP" ; break ;
1163
1174
case ImmTyWaitVAVDst: OS << " WaitVAVDst" ; break ;
1164
1175
case ImmTyWaitVMVSrc: OS << " WaitVMVSrc" ; break ;
1165
- case ImmTyByteSel: OS << " ByteSel" ; break ;
1166
1176
case ImmTyBitOp3: OS << " BitOp3" ; break ;
1177
+ case ImmTyMatrixAReuse: OS << " ImmTyMatrixAReuse" ; break ;
1178
+ case ImmTyMatrixBReuse: OS << " ImmTyMatrixBReuse" ; break ;
1179
+ case ImmTyByteSel: OS << " ByteSel" ; break ;
1167
1180
}
1168
1181
// clang-format on
1169
1182
}
@@ -1700,6 +1713,7 @@ class AMDGPUAsmParser : public MCTargetAsmParser {
1700
1713
AMDGPUOperand::ImmTy ImmTy);
1701
1714
ParseStatus parseIndexKey8bit (OperandVector &Operands);
1702
1715
ParseStatus parseIndexKey16bit (OperandVector &Operands);
1716
+ ParseStatus parseIndexKey32bit (OperandVector &Operands);
1703
1717
1704
1718
ParseStatus parseDfmtNfmt (int64_t &Format);
1705
1719
ParseStatus parseUfmt (int64_t &Format);
@@ -7153,7 +7167,9 @@ ParseStatus AMDGPUAsmParser::tryParseIndexKey(OperandVector &Operands,
7153
7167
if (!Res.isSuccess ())
7154
7168
return Res;
7155
7169
7156
- if (ImmTy == AMDGPUOperand::ImmTyIndexKey16bit && (ImmVal < 0 || ImmVal > 1 ))
7170
+ if ((ImmTy == AMDGPUOperand::ImmTyIndexKey16bit ||
7171
+ ImmTy == AMDGPUOperand::ImmTyIndexKey32bit) &&
7172
+ (ImmVal < 0 || ImmVal > 1 ))
7157
7173
return Error (Loc, Twine (" out of range " , StringRef (Pref)));
7158
7174
7159
7175
if (ImmTy == AMDGPUOperand::ImmTyIndexKey8bit && (ImmVal < 0 || ImmVal > 3 ))
@@ -7171,6 +7187,10 @@ ParseStatus AMDGPUAsmParser::parseIndexKey16bit(OperandVector &Operands) {
7171
7187
return tryParseIndexKey (Operands, AMDGPUOperand::ImmTyIndexKey16bit);
7172
7188
}
7173
7189
7190
+ ParseStatus AMDGPUAsmParser::parseIndexKey32bit (OperandVector &Operands) {
7191
+ return tryParseIndexKey (Operands, AMDGPUOperand::ImmTyIndexKey32bit);
7192
+ }
7193
+
7174
7194
// dfmt and nfmt (in a tbuffer instruction) are parsed as one to allow their
7175
7195
// values to live in a joint format operand in the MCInst encoding.
7176
7196
ParseStatus AMDGPUAsmParser::parseDfmtNfmt (int64_t &Format) {
@@ -9272,6 +9292,14 @@ void AMDGPUAsmParser::cvtVOP3P(MCInst &Inst, const OperandVector &Operands,
9272
9292
DefaultVal);
9273
9293
}
9274
9294
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
+
9275
9303
int NegLoIdx = AMDGPU::getNamedOperandIdx (Opc, AMDGPU::OpName::neg_lo);
9276
9304
if (NegLoIdx != -1 )
9277
9305
addOptionalImmOperand (Inst, Operands, OptIdx, AMDGPUOperand::ImmTyNegLo);
@@ -9378,6 +9406,10 @@ void AMDGPUAsmParser::cvtSWMMAC(MCInst &Inst, const OperandVector &Operands) {
9378
9406
addOptionalImmOperand (Inst, Operands, OptIdx,
9379
9407
AMDGPUOperand::ImmTyIndexKey16bit);
9380
9408
9409
+ if (AMDGPU::hasNamedOperand (Opc, AMDGPU::OpName::index_key_32bit))
9410
+ addOptionalImmOperand (Inst, Operands, OptIdx,
9411
+ AMDGPUOperand::ImmTyIndexKey32bit);
9412
+
9381
9413
if (AMDGPU::hasNamedOperand (Opc, AMDGPU::OpName::clamp))
9382
9414
addOptionalImmOperand (Inst, Operands, OptIdx, AMDGPUOperand::ImmTyClamp);
9383
9415
0 commit comments