@@ -1386,27 +1386,32 @@ multiclass VOPC_Real_Base<GFXGen Gen, bits<9> op> {
1386
1386
1387
1387
multiclass VOPC_Real_with_name<GFXGen Gen, bits<9> op, string OpName,
1388
1388
string asm_name, string pseudo_mnemonic = ""> {
1389
- let AssemblerPredicate = Gen.AssemblerPredicate, DecoderNamespace = Gen.DecoderNamespace in {
1390
- defvar ps32 = !cast<VOPC_Pseudo>(OpName#"_e32");
1391
- defvar ps64 = !cast<VOP3_Pseudo>(OpName#"_e64");
1389
+ defvar ps32 = !cast<VOPC_Pseudo>(OpName#"_e32");
1390
+ defvar ps64 = !cast<VOP3_Pseudo>(OpName#"_e64");
1391
+ let AssemblerPredicate = Gen.AssemblerPredicate in {
1392
+ // MnemonicAlias and GCNPredicateControl both define the field Predicates,
1393
+ // so GCNPredicateControl must come after MnemonicAlias because it contains
1394
+ // the predicates we actually want.
1395
+ def : MnemonicAlias<!if(!empty(pseudo_mnemonic), ps32.Mnemonic,
1396
+ pseudo_mnemonic),
1397
+ asm_name, ps32.AsmVariantName>,
1398
+ GCNPredicateControl;
1399
+ def : MnemonicAlias<!if(!empty(pseudo_mnemonic), ps64.Mnemonic,
1400
+ pseudo_mnemonic),
1401
+ asm_name, ps64.AsmVariantName>,
1402
+ GCNPredicateControl;
1403
+
1404
+ let DecoderNamespace = Gen.DecoderNamespace in {
1392
1405
def _e32#Gen.Suffix :
1393
1406
// 32 and 64 bit forms of the instruction have _e32 and _e64
1394
1407
// respectively appended to their assembly mnemonic.
1395
1408
// _e64 is printed as part of the VOPDstS64orS32 operand, whereas
1396
1409
// the destination-less 32bit forms add it to the asmString here.
1397
1410
VOPC_Real<ps32, Gen.Subtarget, asm_name#"_e32">,
1398
- VOPCe<op{7-0}>,
1399
- MnemonicAlias<!if(!empty(pseudo_mnemonic), ps32.Mnemonic,
1400
- pseudo_mnemonic),
1401
- asm_name, ps32.AsmVariantName>,
1402
- Requires<[Gen.AssemblerPredicate]>;
1411
+ VOPCe<op{7-0}>;
1403
1412
def _e64#Gen.Suffix :
1404
- VOP3_Real<ps64, Gen.Subtarget, asm_name>,
1405
- VOP3a_gfx11_gfx12<{0, op}, ps64.Pfl>,
1406
- MnemonicAlias<!if(!empty(pseudo_mnemonic), ps64.Mnemonic,
1407
- pseudo_mnemonic),
1408
- asm_name, ps64.AsmVariantName>,
1409
- Requires<[Gen.AssemblerPredicate]> {
1413
+ VOP3_Real_Gen<ps64, Gen, asm_name>,
1414
+ VOP3a_gfx11_gfx12<{0, op}, ps64.Pfl> {
1410
1415
// Encoding used for VOPC instructions encoded as VOP3 differs from
1411
1416
// VOP3e by destination name (sdst) as VOPC doesn't have vector dst.
1412
1417
bits<8> sdst;
@@ -1453,8 +1458,9 @@ multiclass VOPC_Real_with_name<GFXGen Gen, bits<9> op, string OpName,
1453
1458
def _e64_dpp#Gen.Suffix : VOPC64_DPP16_Dst<{0, op}, psDPP, asm_name>,
1454
1459
SIMCInstr<psDPP.PseudoInstr, Gen.Subtarget>;
1455
1460
def _e64_dpp8#Gen.Suffix : VOPC64_DPP8_Dst<{0, op}, ps64, asm_name>;
1456
- }
1457
- } // End AssemblerPredicate = Gen.AssemblerPredicate, DecoderNamespace = Gen.DecoderNamespace
1461
+ } // end if ps64.Pfl.HasExtVOP3DPP
1462
+ } // End DecoderNamespace
1463
+ } // End AssemblerPredicate
1458
1464
}
1459
1465
1460
1466
multiclass VOPC_Real_t16<GFXGen Gen, bits<9> op, string asm_name,
@@ -1514,24 +1520,29 @@ multiclass VOPCX_Real<GFXGen Gen, bits<9> op> {
1514
1520
1515
1521
multiclass VOPCX_Real_with_name<GFXGen Gen, bits<9> op, string OpName,
1516
1522
string asm_name, string pseudo_mnemonic = ""> {
1517
- let AssemblerPredicate = Gen.AssemblerPredicate, DecoderNamespace = Gen.DecoderNamespace in {
1518
- defvar ps32 = !cast<VOPC_Pseudo>(OpName#"_nosdst_e32");
1519
- defvar ps64 = !cast<VOP3_Pseudo>(OpName#"_nosdst_e64");
1523
+ defvar ps32 = !cast<VOPC_Pseudo>(OpName#"_nosdst_e32");
1524
+ defvar ps64 = !cast<VOP3_Pseudo>(OpName#"_nosdst_e64");
1525
+ let AssemblerPredicate = Gen.AssemblerPredicate in {
1526
+ // MnemonicAlias and GCNPredicateControl both define the field Predicates,
1527
+ // so GCNPredicateControl must come after MnemonicAlias because it contains
1528
+ // the predicates we actually want.
1529
+ def : MnemonicAlias<!if(!empty(pseudo_mnemonic), !subst("_nosdst", "", ps32.Mnemonic),
1530
+ pseudo_mnemonic),
1531
+ asm_name, ps32.AsmVariantName>,
1532
+ GCNPredicateControl;
1533
+ def : MnemonicAlias<!if(!empty(pseudo_mnemonic), !subst("_nosdst", "", ps64.Mnemonic),
1534
+ pseudo_mnemonic),
1535
+ asm_name, ps64.AsmVariantName>,
1536
+ GCNPredicateControl;
1537
+
1538
+ let DecoderNamespace = Gen.DecoderNamespace in {
1520
1539
def _e32#Gen.Suffix
1521
1540
: VOPC_Real<ps32, Gen.Subtarget, asm_name>,
1522
- MnemonicAlias<!if(!empty(pseudo_mnemonic), !subst("_nosdst", "", ps32.Mnemonic),
1523
- pseudo_mnemonic),
1524
- asm_name, ps32.AsmVariantName>,
1525
- Requires<[Gen.AssemblerPredicate]>,
1526
1541
VOPCe<op{7-0}> {
1527
1542
let AsmString = asm_name # "{_e32} " # ps32.AsmOperands;
1528
1543
}
1529
1544
def _e64#Gen.Suffix
1530
- : VOP3_Real<ps64, Gen.Subtarget, asm_name>,
1531
- MnemonicAlias<!if(!empty(pseudo_mnemonic), !subst("_nosdst", "", ps64.Mnemonic),
1532
- pseudo_mnemonic),
1533
- asm_name, ps64.AsmVariantName>,
1534
- Requires<[Gen.AssemblerPredicate]>,
1545
+ : VOP3_Real_Gen<ps64, Gen, asm_name>,
1535
1546
VOP3a_gfx11_gfx12<{0, op}, ps64.Pfl> {
1536
1547
let Inst{7-0} = ? ; // sdst
1537
1548
let AsmString = asm_name # "{_e64} " # ps64.AsmOperands;
@@ -1557,8 +1568,9 @@ multiclass VOPCX_Real_with_name<GFXGen Gen, bits<9> op, string OpName,
1557
1568
def _e64_dpp8#Gen.Suffix : VOPC64_DPP8_NoDst<{0, op}, ps64, asm_name> {
1558
1569
let AsmString = asm_name # "{_e64_dpp} " # AsmDPP8;
1559
1570
}
1560
- }
1561
- } // End AssemblerPredicate = Gen.AssemblerPredicate, DecoderNamespace = Gen.DecoderNamespace
1571
+ } // End if ps64.Pfl.HasExtVOP3DPP
1572
+ } // End DecoderNamespace
1573
+ } // End AssemblerPredicate
1562
1574
}
1563
1575
1564
1576
multiclass VOPCX_Real_t16<GFXGen Gen, bits<9> op, string asm_name,
0 commit comments