@@ -1110,168 +1110,87 @@ class RegOrImmOperand <string RegisterClassName, string OperandTypeName,
11101110 let DecoderMethod = "decodeOperand_" # RegisterClassName # decoderImmSize;
11111111}
11121112
1113- class RegOrB16 <string RegisterClass, string OperandTypePrefix>
1114- : RegOrImmOperand <RegisterClass, OperandTypePrefix # "_INT16",
1115- "_Imm16">;
1116-
1117- class RegOrF16 <string RegisterClass, string OperandTypePrefix>
1118- : RegOrImmOperand <RegisterClass, OperandTypePrefix # "_FP16",
1119- "_Imm16">;
1120-
1121- class RegOrB16T <string RegisterClass, string OperandTypePrefix>
1122- : RegOrImmOperand <RegisterClass, OperandTypePrefix # "_INT16",
1123- "_Imm16"> {
1124- let EncoderMethod = "getMachineOpValueT16";
1125- }
1126-
1127- class RegOrF16T <string RegisterClass, string OperandTypePrefix>
1128- : RegOrImmOperand <RegisterClass, OperandTypePrefix # "_FP16",
1129- "_Imm16"> {
1130- let EncoderMethod = "getMachineOpValueT16";
1131- }
1132-
1133- class RegOrB16_Lo128T <string RegisterClass, string OperandTypePrefix>
1134- : RegOrImmOperand <RegisterClass, OperandTypePrefix # "_INT16",
1135- "_Imm16"> {
1136- let EncoderMethod = "getMachineOpValueT16Lo128";
1137- }
1138-
1139- class RegOrF16_Lo128T <string RegisterClass, string OperandTypePrefix>
1140- : RegOrImmOperand <RegisterClass, OperandTypePrefix # "_FP16",
1141- "_Imm16"> {
1142- let EncoderMethod = "getMachineOpValueT16Lo128";
1143- }
1144-
1145- class RegOrB32 <string RegisterClass, string OperandTypePrefix>
1146- : RegOrImmOperand <RegisterClass, OperandTypePrefix # "_INT32",
1147- "_Imm32">;
1148-
1149- class RegOrF32 <string RegisterClass, string OperandTypePrefix>
1150- : RegOrImmOperand <RegisterClass, OperandTypePrefix # "_FP32",
1151- "_Imm32">;
1152-
1153- class RegOrV2B16 <string RegisterClass, string OperandTypePrefix>
1154- : RegOrImmOperand <RegisterClass, OperandTypePrefix # "_V2INT16",
1155- "_ImmV2I16">;
1156-
1157- class RegOrV2F16 <string RegisterClass, string OperandTypePrefix>
1158- : RegOrImmOperand <RegisterClass, OperandTypePrefix # "_V2FP16",
1159- "_ImmV2F16">;
1160-
1161- class RegOrF64 <string RegisterClass, string OperandTypePrefix>
1162- : RegOrImmOperand <RegisterClass, OperandTypePrefix # "_FP64",
1163- "_Imm64">;
1164-
1165- class RegOrB64 <string RegisterClass, string OperandTypePrefix>
1166- : RegOrImmOperand <RegisterClass, OperandTypePrefix # "_INT64",
1167- "_Imm64">;
1168-
1169- class RegOrV2F32 <string RegisterClass, string OperandTypePrefix>
1170- : RegOrImmOperand <RegisterClass, OperandTypePrefix # "_V2FP32",
1171- "_Imm32">;
1172-
1173- class RegOrV2B32 <string RegisterClass, string OperandTypePrefix>
1174- : RegOrImmOperand <RegisterClass, OperandTypePrefix # "_V2INT32",
1175- "_Imm32">;
1176-
1177- // For VOP1,2,C True16 instructions. _Lo128 use first 128 32-bit VGPRs only.
1178- class RegOrB16_Lo128 <string RegisterClass, string OperandTypePrefix>
1179- : RegOrImmOperand <RegisterClass, OperandTypePrefix # "_INT16",
1180- "_Imm16">;
1181-
1182- class RegOrF16_Lo128 <string RegisterClass, string OperandTypePrefix>
1183- : RegOrImmOperand <RegisterClass, OperandTypePrefix # "_FP16",
1184- "_Imm16">;
1185-
1186- // Deferred operands
1187- class RegOrF16_Deferred <string RegisterClass, string OperandTypePrefix>
1188- : RegOrImmOperand <RegisterClass, OperandTypePrefix # "_FP16_DEFERRED",
1189- "_Deferred_Imm16">;
1190-
1191- class RegOrF32_Deferred <string RegisterClass, string OperandTypePrefix>
1192- : RegOrImmOperand <RegisterClass, OperandTypePrefix # "_FP32_DEFERRED",
1193- "_Deferred_Imm32">;
1194-
1195- class RegOrF16_Lo128_Deferred <string RegisterClass,
1196- string OperandTypePrefix>
1197- : RegOrImmOperand <RegisterClass, OperandTypePrefix # "_FP16_DEFERRED",
1198- "_Deferred_Imm16">;
1199-
12001113//===----------------------------------------------------------------------===//
12011114// SSrc_* Operands with an SGPR or a 32-bit immediate
12021115//===----------------------------------------------------------------------===//
12031116
1204- def SSrc_b16 : RegOrB16 <"SReg_32", "OPERAND_REG_IMM ">;
1205- def SSrc_f16 : RegOrF16 <"SReg_32", "OPERAND_REG_IMM ">;
1206- def SSrc_b32 : RegOrB32 <"SReg_32", "OPERAND_REG_IMM ">;
1207- def SSrc_f32 : RegOrF32 <"SReg_32", "OPERAND_REG_IMM ">;
1208- def SSrc_b64 : RegOrB64 <"SReg_64", "OPERAND_REG_IMM ">;
1117+ def SSrc_b16 : RegOrImmOperand <"SReg_32", "OPERAND_REG_IMM_INT16", "_Imm16 ">;
1118+ def SSrc_f16 : RegOrImmOperand <"SReg_32", "OPERAND_REG_IMM_FP16", "_Imm16 ">;
1119+ def SSrc_b32 : RegOrImmOperand <"SReg_32", "OPERAND_REG_IMM_INT32", "_Imm32 ">;
1120+ def SSrc_f32 : RegOrImmOperand <"SReg_32", "OPERAND_REG_IMM_FP32", "_Imm32 ">;
1121+ def SSrc_b64 : RegOrImmOperand <"SReg_64", "OPERAND_REG_IMM_INT64", "_Imm64 ">;
12091122
1210- def SSrcOrLds_b32 : RegOrB32 <"SRegOrLds_32", "OPERAND_REG_IMM ">;
1123+ def SSrcOrLds_b32 : RegOrImmOperand <"SRegOrLds_32", "OPERAND_REG_IMM_INT32", "_Imm32 ">;
12111124
12121125//===----------------------------------------------------------------------===//
12131126// SSrc_32_Deferred Operands with an SGPR or a 32-bit immediate for use with
12141127// FMAMK/FMAAK
12151128//===----------------------------------------------------------------------===//
12161129
1217- def SSrc_f32_Deferred : RegOrF32_Deferred <"SReg_32", "OPERAND_REG_IMM ">;
1130+ def SSrc_f32_Deferred : RegOrImmOperand <"SReg_32", "OPERAND_REG_IMM_FP32_DEFERRED", "_Deferred_Imm32 ">;
12181131
12191132//===----------------------------------------------------------------------===//
12201133// SCSrc_* Operands with an SGPR or a inline constant
12211134//===----------------------------------------------------------------------===//
12221135
1223- def SCSrc_b32 : RegOrB32 <"SReg_32", "OPERAND_REG_INLINE_C ">;
1224- def SCSrc_b64 : RegOrB64 <"SReg_64", "OPERAND_REG_INLINE_C ">;
1136+ def SCSrc_b32 : RegOrImmOperand <"SReg_32", "OPERAND_REG_INLINE_C_INT32", "_Imm32 ">;
1137+ def SCSrc_b64 : RegOrImmOperand <"SReg_64", "OPERAND_REG_INLINE_C_INT64", "_Imm64 ">;
12251138
12261139//===----------------------------------------------------------------------===//
12271140// VSrc_* Operands with an SGPR, VGPR or a 32-bit immediate
12281141//===----------------------------------------------------------------------===//
12291142
12301143// The current and temporary future default used case for VOP3.
1231- def VSrc_b16 : RegOrB16 <"VS_32", "OPERAND_REG_IMM ">;
1232- def VSrc_f16 : RegOrF16 <"VS_32", "OPERAND_REG_IMM ">;
1144+ def VSrc_b16 : RegOrImmOperand <"VS_32", "OPERAND_REG_IMM_INT16", "_Imm16 ">;
1145+ def VSrc_f16 : RegOrImmOperand <"VS_32", "OPERAND_REG_IMM_FP16", "_Imm16 ">;
12331146
12341147// True16 VOP3 operands.
1235- def VSrcT_b16 : RegOrB16T <"VS_16", "OPERAND_REG_IMM"> {
1148+ def VSrcT_b16 : RegOrImmOperand <"VS_16", "OPERAND_REG_IMM_INT16", "_Imm16"> {
1149+ let EncoderMethod = "getMachineOpValueT16";
12361150 let DecoderMethod = "decodeOperand_VSrcT16";
12371151}
1238- def VSrcT_f16 : RegOrF16T <"VS_16", "OPERAND_REG_IMM"> {
1152+ def VSrcT_f16 : RegOrImmOperand <"VS_16", "OPERAND_REG_IMM_FP16", "_Imm16"> {
1153+ let EncoderMethod = "getMachineOpValueT16";
12391154 let DecoderMethod = "decodeOperand_VSrcT16";
12401155}
12411156
12421157// True16 VOP1/2/C operands.
1243- def VSrcT_b16_Lo128 : RegOrB16_Lo128T <"VS_16_Lo128", "OPERAND_REG_IMM"> {
1158+ def VSrcT_b16_Lo128 : RegOrImmOperand <"VS_16_Lo128", "OPERAND_REG_IMM_INT16", "_Imm16"> {
1159+ let EncoderMethod = "getMachineOpValueT16Lo128";
12441160 let DecoderMethod = "decodeOperand_VSrcT16_Lo128";
12451161}
1246- def VSrcT_f16_Lo128 : RegOrF16_Lo128T <"VS_16_Lo128", "OPERAND_REG_IMM"> {
1162+ def VSrcT_f16_Lo128 : RegOrImmOperand <"VS_16_Lo128", "OPERAND_REG_IMM_FP16", "_Imm16"> {
1163+ let EncoderMethod = "getMachineOpValueT16Lo128";
12471164 let DecoderMethod = "decodeOperand_VSrcT16_Lo128";
12481165}
12491166
12501167// The current and temporary future default used case for fake VOP1/2/C.
1251- def VSrcFake16_b16_Lo128 : RegOrB16_Lo128 <"VS_32_Lo128", "OPERAND_REG_IMM">;
1252- def VSrcFake16_f16_Lo128 : RegOrF16_Lo128 <"VS_32_Lo128", "OPERAND_REG_IMM">;
1253-
1254- def VSrc_b32 : RegOrB32 <"VS_32", "OPERAND_REG_IMM">;
1255- def VSrc_f32 : RegOrF32 <"VS_32", "OPERAND_REG_IMM">;
1256- def VSrc_v2b16 : RegOrV2B16 <"VS_32", "OPERAND_REG_IMM">;
1257- def VSrc_v2f16 : RegOrV2F16 <"VS_32", "OPERAND_REG_IMM">;
1258- def VSrc_b64 : RegOrB64 <"VS_64", "OPERAND_REG_IMM">;
1259- def VSrc_f64 : RegOrF64 <"VS_64", "OPERAND_REG_IMM"> {
1168+ // For VOP1,2,C True16 instructions. _Lo128 use first 128 32-bit VGPRs only.
1169+ def VSrcFake16_b16_Lo128 : RegOrImmOperand <"VS_32_Lo128", "OPERAND_REG_IMM_INT16", "_Imm16">;
1170+ def VSrcFake16_f16_Lo128 : RegOrImmOperand <"VS_32_Lo128", "OPERAND_REG_IMM_FP16", "_Imm16">;
1171+
1172+ def VSrc_b32 : RegOrImmOperand <"VS_32", "OPERAND_REG_IMM_INT32", "_Imm32">;
1173+ def VSrc_f32 : RegOrImmOperand <"VS_32", "OPERAND_REG_IMM_FP32", "_Imm32">;
1174+ def VSrc_v2b16 : RegOrImmOperand <"VS_32", "OPERAND_REG_IMM_V2INT16", "_ImmV2I16">;
1175+ def VSrc_v2f16 : RegOrImmOperand <"VS_32", "OPERAND_REG_IMM_V2FP16", "_ImmV2F16">;
1176+ def VSrc_b64 : RegOrImmOperand <"VS_64", "OPERAND_REG_IMM_INT64", "_Imm64">;
1177+ def VSrc_f64 : RegOrImmOperand <"VS_64", "OPERAND_REG_IMM_FP64", "_Imm64"> {
12601178 let DecoderMethod = "decodeOperand_VSrc_f64";
12611179}
1262- def VSrc_v2b32 : RegOrV2B32 <"VS_64", "OPERAND_REG_IMM ">;
1263- def VSrc_v2f32 : RegOrV2F32 <"VS_64", "OPERAND_REG_IMM ">;
1180+ def VSrc_v2b32 : RegOrImmOperand <"VS_64", "OPERAND_REG_IMM_V2INT32", "_Imm32 ">;
1181+ def VSrc_v2f32 : RegOrImmOperand <"VS_64", "OPERAND_REG_IMM_V2FP32", "_Imm32 ">;
12641182
12651183//===----------------------------------------------------------------------===//
12661184// VSrc_*_Deferred Operands with an SGPR, VGPR or a 32-bit immediate for use
12671185// with FMAMK/FMAAK
12681186//===----------------------------------------------------------------------===//
12691187
1270- def VSrc_f16_Deferred : RegOrF16_Deferred <"VS_32", "OPERAND_REG_IMM ">;
1271- def VSrc_f32_Deferred : RegOrF32_Deferred <"VS_32", "OPERAND_REG_IMM ">;
1188+ def VSrc_f16_Deferred : RegOrImmOperand <"VS_32", "OPERAND_REG_IMM_FP16_DEFERRED", "_Deferred_Imm16 ">;
1189+ def VSrc_f32_Deferred : RegOrImmOperand <"VS_32", "OPERAND_REG_IMM_FP32_DEFERRED", "_Deferred_Imm32 ">;
12721190
1273- def VSrcFake16_f16_Lo128_Deferred : RegOrF16_Lo128_Deferred<"VS_32_Lo128",
1274- "OPERAND_REG_IMM">;
1191+ def VSrcFake16_f16_Lo128_Deferred : RegOrImmOperand<"VS_32_Lo128",
1192+ "OPERAND_REG_IMM_FP16_DEFERRED",
1193+ "_Deferred_Imm16">;
12751194
12761195//===----------------------------------------------------------------------===//
12771196// VRegSrc_* Operands with a VGPR
@@ -1332,30 +1251,30 @@ def ARegSrc_32 : AVOperand<AGPR_32, "decodeSrcA9", "OPW32">;
13321251// VCSrc_* Operands with an SGPR, VGPR or an inline constant
13331252//===----------------------------------------------------------------------===//
13341253
1335- def VCSrc_b16 : RegOrB16 <"VS_32", "OPERAND_REG_INLINE_C ">;
1336- def VCSrc_f16 : RegOrF16 <"VS_32", "OPERAND_REG_INLINE_C ">;
1337- def VCSrc_b32 : RegOrB32 <"VS_32", "OPERAND_REG_INLINE_C ">;
1338- def VCSrc_f32 : RegOrF32 <"VS_32", "OPERAND_REG_INLINE_C ">;
1339- def VCSrc_v2b16 : RegOrV2B16 <"VS_32", "OPERAND_REG_INLINE_C ">;
1340- def VCSrc_v2f16 : RegOrV2F16 <"VS_32", "OPERAND_REG_INLINE_C ">;
1254+ def VCSrc_b16 : RegOrImmOperand <"VS_32", "OPERAND_REG_INLINE_C_INT16", "_Imm16 ">;
1255+ def VCSrc_f16 : RegOrImmOperand <"VS_32", "OPERAND_REG_INLINE_C_FP16", "_Imm16 ">;
1256+ def VCSrc_b32 : RegOrImmOperand <"VS_32", "OPERAND_REG_INLINE_C_INT32", "_Imm32 ">;
1257+ def VCSrc_f32 : RegOrImmOperand <"VS_32", "OPERAND_REG_INLINE_C_FP32", "_Imm32 ">;
1258+ def VCSrc_v2b16 : RegOrImmOperand <"VS_32", "OPERAND_REG_INLINE_C_V2INT16", "_ImmV2I16 ">;
1259+ def VCSrc_v2f16 : RegOrImmOperand <"VS_32", "OPERAND_REG_INLINE_C_V2FP16", "_ImmV2F16 ">;
13411260
13421261//===----------------------------------------------------------------------===//
13431262// VISrc_* Operands with a VGPR or an inline constant
13441263//===----------------------------------------------------------------------===//
13451264
1346- def VISrc_64_f16 : RegOrF16 <"VReg_64", "OPERAND_REG_INLINE_C ">;
1347- def VISrc_64_b32 : RegOrB32 <"VReg_64", "OPERAND_REG_INLINE_C ">;
1348- def VISrc_64_f64 : RegOrF64 <"VReg_64", "OPERAND_REG_INLINE_C ">;
1349- def VISrc_128_f16 : RegOrF16 <"VReg_128", "OPERAND_REG_INLINE_C ">;
1350- def VISrc_128_b32 : RegOrB32 <"VReg_128", "OPERAND_REG_INLINE_C ">;
1351- def VISrc_128_f32 : RegOrF32 <"VReg_128", "OPERAND_REG_INLINE_C ">;
1352- def VISrc_256_b32 : RegOrB32 <"VReg_256", "OPERAND_REG_INLINE_C ">;
1353- def VISrc_256_f32 : RegOrF32 <"VReg_256", "OPERAND_REG_INLINE_C ">;
1354- def VISrc_256_f64 : RegOrF64 <"VReg_256", "OPERAND_REG_INLINE_C ">;
1355- def VISrc_512_b32 : RegOrB32 <"VReg_512", "OPERAND_REG_INLINE_C ">;
1356- def VISrc_512_f32 : RegOrF32 <"VReg_512", "OPERAND_REG_INLINE_C ">;
1357- def VISrc_1024_b32 : RegOrB32 <"VReg_1024", "OPERAND_REG_INLINE_C ">;
1358- def VISrc_1024_f32 : RegOrF32 <"VReg_1024", "OPERAND_REG_INLINE_C ">;
1265+ def VISrc_64_f16 : RegOrImmOperand <"VReg_64", "OPERAND_REG_INLINE_C_FP16", "_Imm16 ">;
1266+ def VISrc_64_b32 : RegOrImmOperand <"VReg_64", "OPERAND_REG_INLINE_C_INT32", "_Imm32 ">;
1267+ def VISrc_64_f64 : RegOrImmOperand <"VReg_64", "OPERAND_REG_INLINE_C_FP64", "_Imm64 ">;
1268+ def VISrc_128_f16 : RegOrImmOperand <"VReg_128", "OPERAND_REG_INLINE_C_FP16", "_Imm16 ">;
1269+ def VISrc_128_b32 : RegOrImmOperand <"VReg_128", "OPERAND_REG_INLINE_C_INT32", "_Imm32 ">;
1270+ def VISrc_128_f32 : RegOrImmOperand <"VReg_128", "OPERAND_REG_INLINE_C_FP32", "_Imm32 ">;
1271+ def VISrc_256_b32 : RegOrImmOperand <"VReg_256", "OPERAND_REG_INLINE_C_INT32", "_Imm32 ">;
1272+ def VISrc_256_f32 : RegOrImmOperand <"VReg_256", "OPERAND_REG_INLINE_C_FP32", "_Imm32 ">;
1273+ def VISrc_256_f64 : RegOrImmOperand <"VReg_256", "OPERAND_REG_INLINE_C_FP64", "_Imm64 ">;
1274+ def VISrc_512_b32 : RegOrImmOperand <"VReg_512", "OPERAND_REG_INLINE_C_INT32", "_Imm32 ">;
1275+ def VISrc_512_f32 : RegOrImmOperand <"VReg_512", "OPERAND_REG_INLINE_C_FP32", "_Imm32 ">;
1276+ def VISrc_1024_b32 : RegOrImmOperand <"VReg_1024", "OPERAND_REG_INLINE_C_INT32", "_Imm32 ">;
1277+ def VISrc_1024_f32 : RegOrImmOperand <"VReg_1024", "OPERAND_REG_INLINE_C_FP32", "_Imm32 ">;
13591278
13601279//===----------------------------------------------------------------------===//
13611280// AVSrc_*, AVDst_*, AVLdSt_* Operands with an AGPR or VGPR
@@ -1387,11 +1306,11 @@ def AVLdSt_160 : AVLdStOperand<AV_160, "OPW160">;
13871306// ACSrc_* Operands with an AGPR or an inline constant
13881307//===----------------------------------------------------------------------===//
13891308
1390- def AISrc_64_f64 : RegOrF64 <"AReg_64", "OPERAND_REG_INLINE_AC ">;
1391- def AISrc_128_f32 : RegOrF32 <"AReg_128", "OPERAND_REG_INLINE_AC ">;
1392- def AISrc_128_b32 : RegOrB32 <"AReg_128", "OPERAND_REG_INLINE_AC ">;
1393- def AISrc_256_f64 : RegOrF64 <"AReg_256", "OPERAND_REG_INLINE_AC ">;
1394- def AISrc_512_f32 : RegOrF32 <"AReg_512", "OPERAND_REG_INLINE_AC ">;
1395- def AISrc_512_b32 : RegOrB32 <"AReg_512", "OPERAND_REG_INLINE_AC ">;
1396- def AISrc_1024_f32 : RegOrF32 <"AReg_1024", "OPERAND_REG_INLINE_AC ">;
1397- def AISrc_1024_b32 : RegOrB32 <"AReg_1024", "OPERAND_REG_INLINE_AC ">;
1309+ def AISrc_64_f64 : RegOrImmOperand <"AReg_64", "OPERAND_REG_INLINE_AC_FP64", "_Imm64 ">;
1310+ def AISrc_128_f32 : RegOrImmOperand <"AReg_128", "OPERAND_REG_INLINE_AC_FP32", "_Imm32 ">;
1311+ def AISrc_128_b32 : RegOrImmOperand <"AReg_128", "OPERAND_REG_INLINE_AC_INT32", "_Imm32 ">;
1312+ def AISrc_256_f64 : RegOrImmOperand <"AReg_256", "OPERAND_REG_INLINE_AC_FP64", "_Imm64 ">;
1313+ def AISrc_512_f32 : RegOrImmOperand <"AReg_512", "OPERAND_REG_INLINE_AC_FP32", "_Imm32 ">;
1314+ def AISrc_512_b32 : RegOrImmOperand <"AReg_512", "OPERAND_REG_INLINE_AC_INT32", "_Imm32 ">;
1315+ def AISrc_1024_f32 : RegOrImmOperand <"AReg_1024", "OPERAND_REG_INLINE_AC_FP32", "_Imm32 ">;
1316+ def AISrc_1024_b32 : RegOrImmOperand <"AReg_1024", "OPERAND_REG_INLINE_AC_INT32", "_Imm32 ">;
0 commit comments