@@ -1104,7 +1104,7 @@ def : InstAlias<"vneg.v $vd, $vs", (VRSUB_VX VR:$vd, VR:$vs, X0, zero_reg)>;
1104
1104
// The destination vector register group cannot overlap a source vector
1105
1105
// register group of a different element width (including the mask register
1106
1106
// if masked), otherwise an illegal instruction exception is raised.
1107
- let Constraints = "@earlyclobber $vd" in {
1107
+ let Constraints = "@earlyclobber $vd", DestEEW = EEWSEWx2 in {
1108
1108
let RVVConstraint = WidenV in {
1109
1109
defm VWADDU_V : VALU_MV_V_X<"vwaddu", 0b110000, "v">;
1110
1110
defm VWSUBU_V : VALU_MV_V_X<"vwsubu", 0b110010, "v">;
@@ -1121,7 +1121,7 @@ defm VWSUBU_W : VALU_MV_V_X<"vwsubu", 0b110110, "w">;
1121
1121
defm VWADD_W : VALU_MV_V_X<"vwadd", 0b110101, "w">;
1122
1122
defm VWSUB_W : VALU_MV_V_X<"vwsub", 0b110111, "w">;
1123
1123
} // RVVConstraint = WidenW
1124
- } // Constraints = "@earlyclobber $vd"
1124
+ } // Constraints = "@earlyclobber $vd", DestEEW = EEWSEWx2
1125
1125
1126
1126
def : InstAlias<"vwcvt.x.x.v $vd, $vs$vm",
1127
1127
(VWADD_VX VR:$vd, VR:$vs, X0, VMaskOp:$vm)>;
@@ -1147,10 +1147,11 @@ defm VMADC_V : VALUm_IV_V_X_I<"vmadc", 0b010001>;
1147
1147
defm VMADC_V : VALUNoVm_IV_V_X_I<"vmadc", 0b010001>;
1148
1148
} // Constraints = "@earlyclobber $vd", RVVConstraint = NoConstraint
1149
1149
defm 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 {
1151
1152
defm VMSBC_V : VALUm_IV_V_X<"vmsbc", 0b010011>;
1152
1153
defm VMSBC_V : VALUNoVm_IV_V_X<"vmsbc", 0b010011>;
1153
- } // Constraints = "@earlyclobber $vd", RVVConstraint = NoConstraint
1154
+ } // Constraints = "@earlyclobber $vd", RVVConstraint = NoConstraint, DestEEW = EEW1
1154
1155
1155
1156
// Vector Bitwise Logical Instructions
1156
1157
defm VAND_V : VALU_IV_V_X_I<"vand", 0b001001>;
@@ -1183,7 +1184,7 @@ def : InstAlias<"vncvt.x.x.w $vd, $vs",
1183
1184
(VNSRL_WX VR:$vd, VR:$vs, X0, zero_reg)>;
1184
1185
1185
1186
// Vector Integer Comparison Instructions
1186
- let RVVConstraint = NoConstraint in {
1187
+ let RVVConstraint = NoConstraint, DestEEW = EEW1 in {
1187
1188
defm VMSEQ_V : VCMP_IV_V_X_I<"vmseq", 0b011000>;
1188
1189
defm VMSNE_V : VCMP_IV_V_X_I<"vmsne", 0b011001>;
1189
1190
defm VMSLTU_V : VCMP_IV_V_X<"vmsltu", 0b011010>;
@@ -1192,7 +1193,7 @@ defm VMSLEU_V : VCMP_IV_V_X_I<"vmsleu", 0b011100>;
1192
1193
defm VMSLE_V : VCMP_IV_V_X_I<"vmsle", 0b011101>;
1193
1194
defm VMSGTU_V : VCMP_IV_X_I<"vmsgtu", 0b011110>;
1194
1195
defm VMSGT_V : VCMP_IV_X_I<"vmsgt", 0b011111>;
1195
- } // RVVConstraint = NoConstraint
1196
+ } // RVVConstraint = NoConstraint, DestEEW = EEW1
1196
1197
1197
1198
def : InstAlias<"vmsgtu.vv $vd, $va, $vb$vm",
1198
1199
(VMSLTU_VV VR:$vd, VR:$vb, VR:$va, VMaskOp:$vm), 0>;
@@ -1204,7 +1205,7 @@ def : InstAlias<"vmsge.vv $vd, $va, $vb$vm",
1204
1205
(VMSLE_VV VR:$vd, VR:$vb, VR:$va, VMaskOp:$vm), 0>;
1205
1206
1206
1207
let isCodeGenOnly = 0, isAsmParserOnly = 1, hasSideEffects = 0, mayLoad = 0,
1207
- mayStore = 0 in {
1208
+ mayStore = 0, DestEEW = EEW1 in {
1208
1209
// For unsigned comparisons we need to special case 0 immediate to maintain
1209
1210
// the always true/false semantics we would invert if we just decremented the
1210
1211
// 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),
1227
1228
}
1228
1229
1229
1230
let isCodeGenOnly = 0, isAsmParserOnly = 1, hasSideEffects = 0, mayLoad = 0,
1230
- mayStore = 0 in {
1231
+ mayStore = 0, DestEEW = EEW1 in {
1231
1232
def PseudoVMSGEU_VX : Pseudo<(outs VR:$vd),
1232
1233
(ins VR:$vs2, GPR:$rs1),
1233
1234
[], "vmsgeu.vx", "$vd, $vs2, $rs1">;
@@ -1267,11 +1268,12 @@ defm VREMU_V : VDIV_MV_V_X<"vremu", 0b100010>;
1267
1268
defm VREM_V : VDIV_MV_V_X<"vrem", 0b100011>;
1268
1269
1269
1270
// Vector Widening Integer Multiply Instructions
1270
- let Constraints = "@earlyclobber $vd", RVVConstraint = WidenV in {
1271
+ let Constraints = "@earlyclobber $vd", RVVConstraint = WidenV,
1272
+ DestEEW = EEWSEWx2 in {
1271
1273
defm VWMUL_V : VWMUL_MV_V_X<"vwmul", 0b111011>;
1272
1274
defm VWMULU_V : VWMUL_MV_V_X<"vwmulu", 0b111000>;
1273
1275
defm VWMULSU_V : VWMUL_MV_V_X<"vwmulsu", 0b111010>;
1274
- } // Constraints = "@earlyclobber $vd", RVVConstraint = WidenV
1276
+ } // Constraints = "@earlyclobber $vd", RVVConstraint = WidenV, DestEEW = EEWSEWx2
1275
1277
1276
1278
// Vector Single-Width Integer Multiply-Add Instructions
1277
1279
defm VMACC_V : VMAC_MV_V_X<"vmacc", 0b101101>;
@@ -1280,10 +1282,12 @@ defm VMADD_V : VMAC_MV_V_X<"vmadd", 0b101001>;
1280
1282
defm VNMSUB_V : VMAC_MV_V_X<"vnmsub", 0b101011>;
1281
1283
1282
1284
// Vector Widening Integer Multiply-Add Instructions
1285
+ let DestEEW = EEWSEWx2 in {
1283
1286
defm VWMACCU_V : VWMAC_MV_V_X<"vwmaccu", 0b111100>;
1284
1287
defm VWMACC_V : VWMAC_MV_V_X<"vwmacc", 0b111101>;
1285
1288
defm VWMACCSU_V : VWMAC_MV_V_X<"vwmaccsu", 0b111111>;
1286
1289
defm VWMACCUS_V : VWMAC_MV_X<"vwmaccus", 0b111110>;
1290
+ } // DestEEW = EEWSEWx2
1287
1291
1288
1292
// Vector Integer Merge Instructions
1289
1293
defm VMERGE_V : VMRG_IV_V_X_I<"vmerge", 0b010111>;
@@ -1342,7 +1346,8 @@ defm VFRSUB_V : VALU_FV_F<"vfrsub", 0b100111>;
1342
1346
// Vector Widening Floating-Point Add/Subtract Instructions
1343
1347
let Constraints = "@earlyclobber $vd",
1344
1348
Uses = [FRM],
1345
- mayRaiseFPException = true in {
1349
+ mayRaiseFPException = true,
1350
+ DestEEW = EEWSEWx2 in {
1346
1351
let RVVConstraint = WidenV in {
1347
1352
defm VFWADD_V : VWALU_FV_V_F<"vfwadd", 0b110000, "v">;
1348
1353
defm VFWSUB_V : VWALU_FV_V_F<"vfwsub", 0b110010, "v">;
@@ -1355,7 +1360,7 @@ let RVVConstraint = WidenW in {
1355
1360
defm VFWADD_W : VWALU_FV_V_F<"vfwadd", 0b110100, "w">;
1356
1361
defm VFWSUB_W : VWALU_FV_V_F<"vfwsub", 0b110110, "w">;
1357
1362
} // RVVConstraint = WidenW
1358
- } // Constraints = "@earlyclobber $vd", Uses = [FRM], mayRaiseFPException = true
1363
+ } // Constraints = "@earlyclobber $vd", Uses = [FRM], mayRaiseFPException = true, DestEEW = EEWSEWx2
1359
1364
1360
1365
// Vector Single-Width Floating-Point Multiply/Divide Instructions
1361
1366
let Uses = [FRM], mayRaiseFPException = true in {
@@ -1366,9 +1371,9 @@ defm VFRDIV_V : VDIV_FV_F<"vfrdiv", 0b100001>;
1366
1371
1367
1372
// Vector Widening Floating-Point Multiply
1368
1373
let Constraints = "@earlyclobber $vd", RVVConstraint = WidenV,
1369
- Uses = [FRM], mayRaiseFPException = true in {
1374
+ Uses = [FRM], mayRaiseFPException = true, DestEEW = EEWSEWx2 in {
1370
1375
defm 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
1372
1377
1373
1378
// Vector Single-Width Floating-Point Fused Multiply-Add Instructions
1374
1379
let Uses = [FRM], mayRaiseFPException = true in {
@@ -1383,12 +1388,12 @@ defm VFNMSUB_V : VMAC_FV_V_F<"vfnmsub", 0b101011>;
1383
1388
}
1384
1389
1385
1390
// Vector Widening Floating-Point Fused Multiply-Add Instructions
1386
- let Uses = [FRM], mayRaiseFPException = true in {
1391
+ let Uses = [FRM], mayRaiseFPException = true, DestEEW = EEWSEWx2 in {
1387
1392
defm VFWMACC_V : VWMAC_FV_V_F<"vfwmacc", 0b111100>;
1388
1393
defm VFWNMACC_V : VWMAC_FV_V_F<"vfwnmacc", 0b111101>;
1389
1394
defm VFWMSAC_V : VWMAC_FV_V_F<"vfwmsac", 0b111110>;
1390
1395
defm 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
1392
1397
1393
1398
// Vector Floating-Point Square-Root Instruction
1394
1399
let Uses = [FRM], mayRaiseFPException = true in {
@@ -1420,14 +1425,14 @@ def : InstAlias<"vfabs.v $vd, $vs",
1420
1425
(VFSGNJX_VV VR:$vd, VR:$vs, VR:$vs, zero_reg)>;
1421
1426
1422
1427
// Vector Floating-Point Compare Instructions
1423
- let RVVConstraint = NoConstraint, mayRaiseFPException = true in {
1428
+ let RVVConstraint = NoConstraint, mayRaiseFPException = true, DestEEW = EEW1 in {
1424
1429
defm VMFEQ_V : VCMP_FV_V_F<"vmfeq", 0b011000>;
1425
1430
defm VMFNE_V : VCMP_FV_V_F<"vmfne", 0b011100>;
1426
1431
defm VMFLT_V : VCMP_FV_V_F<"vmflt", 0b011011>;
1427
1432
defm VMFLE_V : VCMP_FV_V_F<"vmfle", 0b011001>;
1428
1433
defm VMFGT_V : VCMP_FV_F<"vmfgt", 0b011101>;
1429
1434
defm VMFGE_V : VCMP_FV_F<"vmfge", 0b011111>;
1430
- } // RVVConstraint = NoConstraint, mayRaiseFPException = true
1435
+ } // RVVConstraint = NoConstraint, mayRaiseFPException = true, DestEEW = EEW1
1431
1436
1432
1437
def : InstAlias<"vmfgt.vv $vd, $va, $vb$vm",
1433
1438
(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>;
1471
1476
1472
1477
// Widening Floating-Point/Integer Type-Convert Instructions
1473
1478
let Constraints = "@earlyclobber $vd", RVVConstraint = WidenCvt,
1474
- mayRaiseFPException = true in {
1479
+ mayRaiseFPException = true, DestEEW = EEWSEWx2 in {
1475
1480
let Uses = [FRM] in {
1476
1481
defm VFWCVT_XU_F_V : VWCVTI_FV_VS2<"vfwcvt.xu.f.v", 0b010010, 0b01000>;
1477
1482
defm 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>;
1481
1486
defm VFWCVT_F_XU_V : VWCVTF_IV_VS2<"vfwcvt.f.xu.v", 0b010010, 0b01010>;
1482
1487
defm VFWCVT_F_X_V : VWCVTF_IV_VS2<"vfwcvt.f.x.v", 0b010010, 0b01011>;
1483
1488
defm 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
1485
1490
1486
1491
// Narrowing Floating-Point/Integer Type-Convert Instructions
1487
1492
let Constraints = "@earlyclobber $vd", mayRaiseFPException = true in {
@@ -1515,14 +1520,14 @@ defm VREDXOR : VRED_MV_V<"vredxor", 0b000011>;
1515
1520
} // RVVConstraint = NoConstraint, ElementsDependOn = EltDepsVLMask
1516
1521
1517
1522
// 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 {
1519
1524
// Set earlyclobber for following instructions for second and mask operands.
1520
1525
// This has the downside that the earlyclobber constraint is too coarse and
1521
1526
// will impose unnecessary restrictions by not allowing the destination to
1522
1527
// overlap with the first (wide) operand.
1523
1528
defm VWREDSUMU : VWRED_IV_V<"vwredsumu", 0b110000>;
1524
1529
defm VWREDSUM : VWRED_IV_V<"vwredsum", 0b110001>;
1525
- } // Constraints = "@earlyclobber $vd", RVVConstraint = NoConstraint, ElementsDependOn = EltDepsVLMask
1530
+ } // Constraints = "@earlyclobber $vd", RVVConstraint = NoConstraint, ElementsDependOn = EltDepsVLMask, DestEEW = EEWSEWx2
1526
1531
1527
1532
} // Predicates = [HasVInstructions]
1528
1533
@@ -1543,7 +1548,7 @@ def : InstAlias<"vfredsum.vs $vd, $vs2, $vs1$vm",
1543
1548
(VFREDUSUM_VS VR:$vd, VR:$vs2, VR:$vs1, VMaskOp:$vm), 0>;
1544
1549
1545
1550
// 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 {
1547
1552
// Set earlyclobber for following instructions for second and mask operands.
1548
1553
// This has the downside that the earlyclobber constraint is too coarse and
1549
1554
// will impose unnecessary restrictions by not allowing the destination to
@@ -1552,15 +1557,15 @@ let Uses = [FRM], mayRaiseFPException = true in {
1552
1557
defm VFWREDOSUM : VWREDO_FV_V<"vfwredosum", 0b110011>;
1553
1558
defm VFWREDUSUM : VWRED_FV_V<"vfwredusum", 0b110001>;
1554
1559
}
1555
- } // Constraints = "@earlyclobber $vd", RVVConstraint = NoConstraint, ElementsDependOn = EltDepsVLMask
1560
+ } // Constraints = "@earlyclobber $vd", RVVConstraint = NoConstraint, ElementsDependOn = EltDepsVLMask, DestEEW = EEWSEWx2
1556
1561
1557
1562
def : InstAlias<"vfwredsum.vs $vd, $vs2, $vs1$vm",
1558
1563
(VFWREDUSUM_VS VR:$vd, VR:$vs2, VR:$vs1, VMaskOp:$vm), 0>;
1559
1564
} // Predicates = [HasVInstructionsAnyF]
1560
1565
1561
1566
let Predicates = [HasVInstructions] in {
1562
1567
// Vector Mask-Register Logical Instructions
1563
- let RVVConstraint = NoConstraint in {
1568
+ let RVVConstraint = NoConstraint, DestEEW = EEW1 in {
1564
1569
defm VMAND_M : VMALU_MV_Mask<"vmand", 0b011001, "m">;
1565
1570
defm VMNAND_M : VMALU_MV_Mask<"vmnand", 0b011101, "m">;
1566
1571
defm VMANDN_M : VMALU_MV_Mask<"vmandn", 0b011000, "m">;
@@ -1607,12 +1612,14 @@ def : InstAlias<"vpopc.m $vd, $vs2$vm",
1607
1612
1608
1613
let Constraints = "@earlyclobber $vd", RVVConstraint = Iota, ElementsDependOn = EltDepsVLMask in {
1609
1614
1615
+ let DestEEW = EEW1 in {
1610
1616
// vmsbf.m set-before-first mask bit
1611
1617
defm VMSBF_M : VMSFS_MV_V<"vmsbf.m", 0b010100, 0b00001>;
1612
1618
// vmsif.m set-including-first mask bit
1613
1619
defm VMSIF_M : VMSFS_MV_V<"vmsif.m", 0b010100, 0b00011>;
1614
1620
// vmsof.m set-only-first mask bit
1615
1621
defm VMSOF_M : VMSFS_MV_V<"vmsof.m", 0b010100, 0b00010>;
1622
+ } // DestEEW = EEW1
1616
1623
// Vector Iota Instruction
1617
1624
defm VIOTA_M : VIOTA_MV_V<"viota.m", 0b010100, 0b10000>;
1618
1625
0 commit comments