@@ -1104,7 +1104,7 @@ def : InstAlias<"vneg.v $vd, $vs", (VRSUB_VX VR:$vd, VR:$vs, X0, zero_reg)>;
11041104// The destination vector register group cannot overlap a source vector
11051105// register group of a different element width (including the mask register
11061106// if masked), otherwise an illegal instruction exception is raised.
1107- let Constraints = "@earlyclobber $vd" in {
1107+ let Constraints = "@earlyclobber $vd", DestEEW = EEWSEWx2 in {
11081108let RVVConstraint = WidenV in {
11091109defm VWADDU_V : VALU_MV_V_X<"vwaddu", 0b110000, "v">;
11101110defm VWSUBU_V : VALU_MV_V_X<"vwsubu", 0b110010, "v">;
@@ -1121,7 +1121,7 @@ defm VWSUBU_W : VALU_MV_V_X<"vwsubu", 0b110110, "w">;
11211121defm VWADD_W : VALU_MV_V_X<"vwadd", 0b110101, "w">;
11221122defm VWSUB_W : VALU_MV_V_X<"vwsub", 0b110111, "w">;
11231123} // RVVConstraint = WidenW
1124- } // Constraints = "@earlyclobber $vd"
1124+ } // Constraints = "@earlyclobber $vd", DestEEW = EEWSEWx2
11251125
11261126def : InstAlias<"vwcvt.x.x.v $vd, $vs$vm",
11271127 (VWADD_VX VR:$vd, VR:$vs, X0, VMaskOp:$vm)>;
@@ -1147,10 +1147,11 @@ defm VMADC_V : VALUm_IV_V_X_I<"vmadc", 0b010001>;
11471147defm VMADC_V : VALUNoVm_IV_V_X_I<"vmadc", 0b010001>;
11481148} // Constraints = "@earlyclobber $vd", RVVConstraint = NoConstraint
11491149defm VSBC_V : VALUm_IV_V_X<"vsbc", 0b010010>;
1150- let Constraints = "@earlyclobber $vd", RVVConstraint = NoConstraint in {
1150+ let Constraints = "@earlyclobber $vd", RVVConstraint = NoConstraint,
1151+ DestEEW = EEW1 in {
11511152defm VMSBC_V : VALUm_IV_V_X<"vmsbc", 0b010011>;
11521153defm VMSBC_V : VALUNoVm_IV_V_X<"vmsbc", 0b010011>;
1153- } // Constraints = "@earlyclobber $vd", RVVConstraint = NoConstraint
1154+ } // Constraints = "@earlyclobber $vd", RVVConstraint = NoConstraint, DestEEW = EEW1
11541155
11551156// Vector Bitwise Logical Instructions
11561157defm VAND_V : VALU_IV_V_X_I<"vand", 0b001001>;
@@ -1183,7 +1184,7 @@ def : InstAlias<"vncvt.x.x.w $vd, $vs",
11831184 (VNSRL_WX VR:$vd, VR:$vs, X0, zero_reg)>;
11841185
11851186// Vector Integer Comparison Instructions
1186- let RVVConstraint = NoConstraint in {
1187+ let RVVConstraint = NoConstraint, DestEEW = EEW1 in {
11871188defm VMSEQ_V : VCMP_IV_V_X_I<"vmseq", 0b011000>;
11881189defm VMSNE_V : VCMP_IV_V_X_I<"vmsne", 0b011001>;
11891190defm VMSLTU_V : VCMP_IV_V_X<"vmsltu", 0b011010>;
@@ -1192,7 +1193,7 @@ defm VMSLEU_V : VCMP_IV_V_X_I<"vmsleu", 0b011100>;
11921193defm VMSLE_V : VCMP_IV_V_X_I<"vmsle", 0b011101>;
11931194defm VMSGTU_V : VCMP_IV_X_I<"vmsgtu", 0b011110>;
11941195defm VMSGT_V : VCMP_IV_X_I<"vmsgt", 0b011111>;
1195- } // RVVConstraint = NoConstraint
1196+ } // RVVConstraint = NoConstraint, DestEEW = EEW1
11961197
11971198def : InstAlias<"vmsgtu.vv $vd, $va, $vb$vm",
11981199 (VMSLTU_VV VR:$vd, VR:$vb, VR:$va, VMaskOp:$vm), 0>;
@@ -1204,7 +1205,7 @@ def : InstAlias<"vmsge.vv $vd, $va, $vb$vm",
12041205 (VMSLE_VV VR:$vd, VR:$vb, VR:$va, VMaskOp:$vm), 0>;
12051206
12061207let isCodeGenOnly = 0, isAsmParserOnly = 1, hasSideEffects = 0, mayLoad = 0,
1207- mayStore = 0 in {
1208+ mayStore = 0, DestEEW = EEW1 in {
12081209// For unsigned comparisons we need to special case 0 immediate to maintain
12091210// the always true/false semantics we would invert if we just decremented the
12101211// immediate like we do for signed. To match the GNU assembler we will use
@@ -1227,7 +1228,7 @@ def PseudoVMSLT_VI : Pseudo<(outs VR:$vd),
12271228}
12281229
12291230let isCodeGenOnly = 0, isAsmParserOnly = 1, hasSideEffects = 0, mayLoad = 0,
1230- mayStore = 0 in {
1231+ mayStore = 0, DestEEW = EEW1 in {
12311232def PseudoVMSGEU_VX : Pseudo<(outs VR:$vd),
12321233 (ins VR:$vs2, GPR:$rs1),
12331234 [], "vmsgeu.vx", "$vd, $vs2, $rs1">;
@@ -1267,11 +1268,12 @@ defm VREMU_V : VDIV_MV_V_X<"vremu", 0b100010>;
12671268defm VREM_V : VDIV_MV_V_X<"vrem", 0b100011>;
12681269
12691270// Vector Widening Integer Multiply Instructions
1270- let Constraints = "@earlyclobber $vd", RVVConstraint = WidenV in {
1271+ let Constraints = "@earlyclobber $vd", RVVConstraint = WidenV,
1272+ DestEEW = EEWSEWx2 in {
12711273defm VWMUL_V : VWMUL_MV_V_X<"vwmul", 0b111011>;
12721274defm VWMULU_V : VWMUL_MV_V_X<"vwmulu", 0b111000>;
12731275defm VWMULSU_V : VWMUL_MV_V_X<"vwmulsu", 0b111010>;
1274- } // Constraints = "@earlyclobber $vd", RVVConstraint = WidenV
1276+ } // Constraints = "@earlyclobber $vd", RVVConstraint = WidenV, DestEEW = EEWSEWx2
12751277
12761278// Vector Single-Width Integer Multiply-Add Instructions
12771279defm VMACC_V : VMAC_MV_V_X<"vmacc", 0b101101>;
@@ -1280,10 +1282,12 @@ defm VMADD_V : VMAC_MV_V_X<"vmadd", 0b101001>;
12801282defm VNMSUB_V : VMAC_MV_V_X<"vnmsub", 0b101011>;
12811283
12821284// Vector Widening Integer Multiply-Add Instructions
1285+ let DestEEW = EEWSEWx2 in {
12831286defm VWMACCU_V : VWMAC_MV_V_X<"vwmaccu", 0b111100>;
12841287defm VWMACC_V : VWMAC_MV_V_X<"vwmacc", 0b111101>;
12851288defm VWMACCSU_V : VWMAC_MV_V_X<"vwmaccsu", 0b111111>;
12861289defm VWMACCUS_V : VWMAC_MV_X<"vwmaccus", 0b111110>;
1290+ } // DestEEW = EEWSEWx2
12871291
12881292// Vector Integer Merge Instructions
12891293defm VMERGE_V : VMRG_IV_V_X_I<"vmerge", 0b010111>;
@@ -1342,7 +1346,8 @@ defm VFRSUB_V : VALU_FV_F<"vfrsub", 0b100111>;
13421346// Vector Widening Floating-Point Add/Subtract Instructions
13431347let Constraints = "@earlyclobber $vd",
13441348 Uses = [FRM],
1345- mayRaiseFPException = true in {
1349+ mayRaiseFPException = true,
1350+ DestEEW = EEWSEWx2 in {
13461351let RVVConstraint = WidenV in {
13471352defm VFWADD_V : VWALU_FV_V_F<"vfwadd", 0b110000, "v">;
13481353defm VFWSUB_V : VWALU_FV_V_F<"vfwsub", 0b110010, "v">;
@@ -1355,7 +1360,7 @@ let RVVConstraint = WidenW in {
13551360defm VFWADD_W : VWALU_FV_V_F<"vfwadd", 0b110100, "w">;
13561361defm VFWSUB_W : VWALU_FV_V_F<"vfwsub", 0b110110, "w">;
13571362} // RVVConstraint = WidenW
1358- } // Constraints = "@earlyclobber $vd", Uses = [FRM], mayRaiseFPException = true
1363+ } // Constraints = "@earlyclobber $vd", Uses = [FRM], mayRaiseFPException = true, DestEEW = EEWSEWx2
13591364
13601365// Vector Single-Width Floating-Point Multiply/Divide Instructions
13611366let Uses = [FRM], mayRaiseFPException = true in {
@@ -1366,9 +1371,9 @@ defm VFRDIV_V : VDIV_FV_F<"vfrdiv", 0b100001>;
13661371
13671372// Vector Widening Floating-Point Multiply
13681373let Constraints = "@earlyclobber $vd", RVVConstraint = WidenV,
1369- Uses = [FRM], mayRaiseFPException = true in {
1374+ Uses = [FRM], mayRaiseFPException = true, DestEEW = EEWSEWx2 in {
13701375defm VFWMUL_V : VWMUL_FV_V_F<"vfwmul", 0b111000>;
1371- } // Constraints = "@earlyclobber $vd", RVVConstraint = WidenV, Uses = [FRM], mayRaiseFPException = true
1376+ } // Constraints = "@earlyclobber $vd", RVVConstraint = WidenV, Uses = [FRM], mayRaiseFPException = true, DestEEW = EEWSEWx2
13721377
13731378// Vector Single-Width Floating-Point Fused Multiply-Add Instructions
13741379let Uses = [FRM], mayRaiseFPException = true in {
@@ -1383,12 +1388,12 @@ defm VFNMSUB_V : VMAC_FV_V_F<"vfnmsub", 0b101011>;
13831388}
13841389
13851390// Vector Widening Floating-Point Fused Multiply-Add Instructions
1386- let Uses = [FRM], mayRaiseFPException = true in {
1391+ let Uses = [FRM], mayRaiseFPException = true, DestEEW = EEWSEWx2 in {
13871392defm VFWMACC_V : VWMAC_FV_V_F<"vfwmacc", 0b111100>;
13881393defm VFWNMACC_V : VWMAC_FV_V_F<"vfwnmacc", 0b111101>;
13891394defm VFWMSAC_V : VWMAC_FV_V_F<"vfwmsac", 0b111110>;
13901395defm VFWNMSAC_V : VWMAC_FV_V_F<"vfwnmsac", 0b111111>;
1391- } // Constraints = "@earlyclobber $vd", RVVConstraint = WidenV, Uses = [FRM], mayRaiseFPException = true
1396+ } // Constraints = "@earlyclobber $vd", RVVConstraint = WidenV, Uses = [FRM], mayRaiseFPException = true, DestEEW = EEWSEWx2
13921397
13931398// Vector Floating-Point Square-Root Instruction
13941399let Uses = [FRM], mayRaiseFPException = true in {
@@ -1420,14 +1425,14 @@ def : InstAlias<"vfabs.v $vd, $vs",
14201425 (VFSGNJX_VV VR:$vd, VR:$vs, VR:$vs, zero_reg)>;
14211426
14221427// Vector Floating-Point Compare Instructions
1423- let RVVConstraint = NoConstraint, mayRaiseFPException = true in {
1428+ let RVVConstraint = NoConstraint, mayRaiseFPException = true, DestEEW = EEW1 in {
14241429defm VMFEQ_V : VCMP_FV_V_F<"vmfeq", 0b011000>;
14251430defm VMFNE_V : VCMP_FV_V_F<"vmfne", 0b011100>;
14261431defm VMFLT_V : VCMP_FV_V_F<"vmflt", 0b011011>;
14271432defm VMFLE_V : VCMP_FV_V_F<"vmfle", 0b011001>;
14281433defm VMFGT_V : VCMP_FV_F<"vmfgt", 0b011101>;
14291434defm VMFGE_V : VCMP_FV_F<"vmfge", 0b011111>;
1430- } // RVVConstraint = NoConstraint, mayRaiseFPException = true
1435+ } // RVVConstraint = NoConstraint, mayRaiseFPException = true, DestEEW = EEW1
14311436
14321437def : InstAlias<"vmfgt.vv $vd, $va, $vb$vm",
14331438 (VMFLT_VV VR:$vd, VR:$vb, VR:$va, VMaskOp:$vm), 0>;
@@ -1471,7 +1476,7 @@ defm VFCVT_F_X_V : VCVTF_IV_VS2<"vfcvt.f.x.v", 0b010010, 0b00011>;
14711476
14721477// Widening Floating-Point/Integer Type-Convert Instructions
14731478let Constraints = "@earlyclobber $vd", RVVConstraint = WidenCvt,
1474- mayRaiseFPException = true in {
1479+ mayRaiseFPException = true, DestEEW = EEWSEWx2 in {
14751480let Uses = [FRM] in {
14761481defm VFWCVT_XU_F_V : VWCVTI_FV_VS2<"vfwcvt.xu.f.v", 0b010010, 0b01000>;
14771482defm VFWCVT_X_F_V : VWCVTI_FV_VS2<"vfwcvt.x.f.v", 0b010010, 0b01001>;
@@ -1481,7 +1486,7 @@ defm VFWCVT_RTZ_X_F_V : VWCVTI_FV_VS2<"vfwcvt.rtz.x.f.v", 0b010010, 0b01111>;
14811486defm VFWCVT_F_XU_V : VWCVTF_IV_VS2<"vfwcvt.f.xu.v", 0b010010, 0b01010>;
14821487defm VFWCVT_F_X_V : VWCVTF_IV_VS2<"vfwcvt.f.x.v", 0b010010, 0b01011>;
14831488defm VFWCVT_F_F_V : VWCVTF_FV_VS2<"vfwcvt.f.f.v", 0b010010, 0b01100>;
1484- } // Constraints = "@earlyclobber $vd", RVVConstraint = WidenCvt
1489+ } // Constraints = "@earlyclobber $vd", RVVConstraint = WidenCvt, DestEEW = EEWSEWx2
14851490
14861491// Narrowing Floating-Point/Integer Type-Convert Instructions
14871492let Constraints = "@earlyclobber $vd", mayRaiseFPException = true in {
@@ -1515,14 +1520,14 @@ defm VREDXOR : VRED_MV_V<"vredxor", 0b000011>;
15151520} // RVVConstraint = NoConstraint, ElementsDependOn = EltDepsVLMask
15161521
15171522// Vector Widening Integer Reduction Instructions
1518- let Constraints = "@earlyclobber $vd", RVVConstraint = NoConstraint, ElementsDependOn = EltDepsVLMask in {
1523+ let Constraints = "@earlyclobber $vd", RVVConstraint = NoConstraint, ElementsDependOn = EltDepsVLMask, DestEEW = EEWSEWx2 in {
15191524// Set earlyclobber for following instructions for second and mask operands.
15201525// This has the downside that the earlyclobber constraint is too coarse and
15211526// will impose unnecessary restrictions by not allowing the destination to
15221527// overlap with the first (wide) operand.
15231528defm VWREDSUMU : VWRED_IV_V<"vwredsumu", 0b110000>;
15241529defm VWREDSUM : VWRED_IV_V<"vwredsum", 0b110001>;
1525- } // Constraints = "@earlyclobber $vd", RVVConstraint = NoConstraint, ElementsDependOn = EltDepsVLMask
1530+ } // Constraints = "@earlyclobber $vd", RVVConstraint = NoConstraint, ElementsDependOn = EltDepsVLMask, DestEEW = EEWSEWx2
15261531
15271532} // Predicates = [HasVInstructions]
15281533
@@ -1543,7 +1548,7 @@ def : InstAlias<"vfredsum.vs $vd, $vs2, $vs1$vm",
15431548 (VFREDUSUM_VS VR:$vd, VR:$vs2, VR:$vs1, VMaskOp:$vm), 0>;
15441549
15451550// Vector Widening Floating-Point Reduction Instructions
1546- let Constraints = "@earlyclobber $vd", RVVConstraint = NoConstraint, ElementsDependOn = EltDepsVLMask in {
1551+ let Constraints = "@earlyclobber $vd", RVVConstraint = NoConstraint, ElementsDependOn = EltDepsVLMask, DestEEW = EEWSEWx2 in {
15471552// Set earlyclobber for following instructions for second and mask operands.
15481553// This has the downside that the earlyclobber constraint is too coarse and
15491554// will impose unnecessary restrictions by not allowing the destination to
@@ -1552,15 +1557,15 @@ let Uses = [FRM], mayRaiseFPException = true in {
15521557defm VFWREDOSUM : VWREDO_FV_V<"vfwredosum", 0b110011>;
15531558defm VFWREDUSUM : VWRED_FV_V<"vfwredusum", 0b110001>;
15541559}
1555- } // Constraints = "@earlyclobber $vd", RVVConstraint = NoConstraint, ElementsDependOn = EltDepsVLMask
1560+ } // Constraints = "@earlyclobber $vd", RVVConstraint = NoConstraint, ElementsDependOn = EltDepsVLMask, DestEEW = EEWSEWx2
15561561
15571562def : InstAlias<"vfwredsum.vs $vd, $vs2, $vs1$vm",
15581563 (VFWREDUSUM_VS VR:$vd, VR:$vs2, VR:$vs1, VMaskOp:$vm), 0>;
15591564} // Predicates = [HasVInstructionsAnyF]
15601565
15611566let Predicates = [HasVInstructions] in {
15621567// Vector Mask-Register Logical Instructions
1563- let RVVConstraint = NoConstraint in {
1568+ let RVVConstraint = NoConstraint, DestEEW = EEW1 in {
15641569defm VMAND_M : VMALU_MV_Mask<"vmand", 0b011001, "m">;
15651570defm VMNAND_M : VMALU_MV_Mask<"vmnand", 0b011101, "m">;
15661571defm VMANDN_M : VMALU_MV_Mask<"vmandn", 0b011000, "m">;
@@ -1607,12 +1612,14 @@ def : InstAlias<"vpopc.m $vd, $vs2$vm",
16071612
16081613let Constraints = "@earlyclobber $vd", RVVConstraint = Iota, ElementsDependOn = EltDepsVLMask in {
16091614
1615+ let DestEEW = EEW1 in {
16101616// vmsbf.m set-before-first mask bit
16111617defm VMSBF_M : VMSFS_MV_V<"vmsbf.m", 0b010100, 0b00001>;
16121618// vmsif.m set-including-first mask bit
16131619defm VMSIF_M : VMSFS_MV_V<"vmsif.m", 0b010100, 0b00011>;
16141620// vmsof.m set-only-first mask bit
16151621defm VMSOF_M : VMSFS_MV_V<"vmsof.m", 0b010100, 0b00010>;
1622+ } // DestEEW = EEW1
16161623// Vector Iota Instruction
16171624defm VIOTA_M : VIOTA_MV_V<"viota.m", 0b010100, 0b10000>;
16181625
0 commit comments