@@ -1223,17 +1223,20 @@ def FPVRegInputModsMatchClass : AsmOperandClass {
1223
1223
let PredicateMethod = "isVRegWithInputMods";
1224
1224
}
1225
1225
1226
- def FPT16VRegInputModsMatchClass : AsmOperandClass {
1227
- let Name = "T16VRegWithFPInputMods";
1226
+ class FPT16VRegInputModsMatchClass<bit IsFake16> : AsmOperandClass {
1227
+ let Name = !if(IsFake16, "Fake16VRegWithFPInputMods",
1228
+ "T16VRegWithFPInputMods");
1228
1229
let ParserMethod = "parseRegWithFPInputMods";
1229
- let PredicateMethod = "isT16VRegWithInputMods";
1230
+ let PredicateMethod = "isT16VRegWithInputMods<" #
1231
+ !if(IsFake16, "true", "false") # ">";
1230
1232
}
1231
1233
1232
1234
def FPVRegInputMods : InputMods <FPVRegInputModsMatchClass> {
1233
1235
let PrintMethod = "printOperandAndFPInputMods";
1234
1236
}
1235
1237
1236
- def FPT16VRegInputMods : InputMods <FPT16VRegInputModsMatchClass> {
1238
+ class FPT16VRegInputMods<bit IsFake16>
1239
+ : InputMods <FPT16VRegInputModsMatchClass<IsFake16>> {
1237
1240
let PrintMethod = "printOperandAndFPInputMods";
1238
1241
}
1239
1242
@@ -1265,13 +1268,16 @@ def IntVRegInputModsMatchClass : AsmOperandClass {
1265
1268
let PredicateMethod = "isVRegWithInputMods";
1266
1269
}
1267
1270
1268
- def IntT16VRegInputModsMatchClass : AsmOperandClass {
1269
- let Name = "T16VRegWithIntInputMods";
1271
+ class IntT16VRegInputModsMatchClass<bit IsFake16> : AsmOperandClass {
1272
+ let Name = !if(IsFake16, "Fake16VRegWithIntInputMods",
1273
+ "T16VRegWithIntInputMods");
1270
1274
let ParserMethod = "parseRegWithIntInputMods";
1271
- let PredicateMethod = "isT16VRegWithInputMods";
1275
+ let PredicateMethod = "isT16VRegWithInputMods<" #
1276
+ !if(IsFake16, "true", "false") # ">";
1272
1277
}
1273
1278
1274
- def IntT16VRegInputMods : InputMods <IntT16VRegInputModsMatchClass> {
1279
+ class IntT16VRegInputMods<bit IsFake16>
1280
+ : InputMods <IntT16VRegInputModsMatchClass<IsFake16>> {
1275
1281
let PrintMethod = "printOperandAndIntInputMods";
1276
1282
}
1277
1283
@@ -1510,25 +1516,17 @@ class getSOPSrcForVT<ValueType VT> {
1510
1516
}
1511
1517
1512
1518
// Returns the vreg register class to use for source operand given VT
1513
- class getVregSrcForVT<ValueType VT> {
1514
- RegisterClass ret = !if(!eq(VT.Size, 128), VReg_128,
1515
- !if(!eq(VT.Size, 96), VReg_96,
1516
- !if(!eq(VT.Size, 64), VReg_64,
1517
- !if(!eq(VT.Size, 48), VReg_64,
1518
- VGPR_32))));
1519
- }
1520
-
1521
- class getVregSrcForVT_t16<ValueType VT, bit IsFake16 = 1> {
1522
- RegisterClass ret = !if(!eq(VT.Size, 128), VReg_128,
1523
- !if(!eq(VT.Size, 96), VReg_96,
1524
- !if(!eq(VT.Size, 64), VReg_64,
1525
- !if(!eq(VT.Size, 48), VReg_64,
1526
- !if(!eq(VT.Size, 16),
1527
- !if(IsFake16, VGPR_32_Lo128, VGPR_16_Lo128),
1528
- VGPR_32)))));
1529
-
1530
- RegisterOperand op = !if (!and(!eq(VT.Size, 16), !not(IsFake16)),
1531
- VGPRSrc_16_Lo128, RegisterOperand<ret>);
1519
+ class getVregSrcForVT<ValueType VT, bit IsTrue16 = 0, bit IsFake16 = 0> {
1520
+ RegisterOperand ret =
1521
+ !if (!eq(VT.Size, 128), RegisterOperand<VReg_128>,
1522
+ !if (!eq(VT.Size, 96), RegisterOperand<VReg_96>,
1523
+ !if (!eq(VT.Size, 64), RegisterOperand<VReg_64>,
1524
+ !if (!eq(VT.Size, 48), RegisterOperand<VReg_64>,
1525
+ !if (!eq(VT.Size, 16),
1526
+ !if (IsTrue16,
1527
+ !if (IsFake16, VGPRSrc_32_Lo128, VGPRSrc_16_Lo128),
1528
+ RegisterOperand<VGPR_32>),
1529
+ RegisterOperand<VGPR_32>)))));
1532
1530
}
1533
1531
1534
1532
class getSDWASrcForVT <ValueType VT> {
@@ -1635,13 +1633,13 @@ class getSrcModDPP <ValueType VT> {
1635
1633
Operand ret = !if(VT.isFP, FPVRegInputMods, IntVRegInputMods);
1636
1634
}
1637
1635
1638
- class getSrcModDPP_t16 <ValueType VT> {
1636
+ class getSrcModDPP_t16 <ValueType VT, bit IsFake16 = 1 > {
1639
1637
Operand ret =
1640
1638
!if (VT.isFP,
1641
1639
!if (!or(!eq(VT.Value, f16.Value), !eq(VT.Value, bf16.Value)),
1642
- FPT16VRegInputMods, FPVRegInputMods),
1643
- !if (!eq(VT.Value, i16.Value), IntT16VRegInputMods,
1644
- IntVRegInputMods));
1640
+ FPT16VRegInputMods<IsFake16> , FPVRegInputMods),
1641
+ !if (!eq(VT.Value, i16.Value),
1642
+ IntT16VRegInputMods<IsFake16>, IntVRegInputMods));
1645
1643
}
1646
1644
1647
1645
// Return type of input modifiers operand for specified input operand for DPP
@@ -1784,10 +1782,9 @@ class getInsVOP3OpSel <RegisterOperand Src0RC, RegisterOperand Src1RC,
1784
1782
Src0Mod, Src1Mod, Src2Mod, /*HasOpSel=*/1>.ret;
1785
1783
}
1786
1784
1787
- class getInsDPPBase <RegisterOperand OldRC, RegisterClass Src0RC, RegisterClass Src1RC,
1788
- RegisterClass Src2RC, int NumSrcArgs, bit HasModifiers,
1789
- Operand Src0Mod, Operand Src1Mod, Operand Src2Mod, bit HasOld> {
1790
-
1785
+ class getInsDPPBase <RegisterOperand OldRC, RegisterOperand Src0RC, RegisterOperand Src1RC,
1786
+ RegisterOperand Src2RC, int NumSrcArgs, bit HasModifiers,
1787
+ Operand Src0Mod, Operand Src1Mod, Operand Src2Mod, bit HasOld> {
1791
1788
dag ret = !if(!eq(NumSrcArgs, 0),
1792
1789
// VOP1 without input operands (V_NOP)
1793
1790
(ins ),
@@ -1827,26 +1824,26 @@ class getInsDPPBase <RegisterOperand OldRC, RegisterClass Src0RC, RegisterClass
1827
1824
);
1828
1825
}
1829
1826
1830
- class getInsDPP <RegisterOperand OldRC, RegisterClass Src0RC, RegisterClass Src1RC,
1831
- RegisterClass Src2RC, int NumSrcArgs, bit HasModifiers,
1827
+ class getInsDPP <RegisterOperand OldRC, RegisterOperand Src0RC, RegisterOperand Src1RC,
1828
+ RegisterOperand Src2RC, int NumSrcArgs, bit HasModifiers,
1832
1829
Operand Src0Mod, Operand Src1Mod, Operand Src2Mod, bit HasOld = 1> {
1833
1830
dag ret = !con(getInsDPPBase<OldRC, Src0RC, Src1RC, Src2RC, NumSrcArgs,
1834
1831
HasModifiers, Src0Mod, Src1Mod, Src2Mod, HasOld>.ret,
1835
1832
(ins dpp_ctrl:$dpp_ctrl, row_mask:$row_mask,
1836
1833
bank_mask:$bank_mask, bound_ctrl:$bound_ctrl));
1837
1834
}
1838
1835
1839
- class getInsDPP16 <RegisterOperand OldRC, RegisterClass Src0RC, RegisterClass Src1RC,
1840
- RegisterClass Src2RC, int NumSrcArgs, bit HasModifiers,
1841
- Operand Src0Mod, Operand Src1Mod, Operand Src2Mod, bit HasOld = 1> {
1836
+ class getInsDPP16 <RegisterOperand OldRC, RegisterOperand Src0RC, RegisterOperand Src1RC,
1837
+ RegisterOperand Src2RC, int NumSrcArgs, bit HasModifiers,
1838
+ Operand Src0Mod, Operand Src1Mod, Operand Src2Mod, bit HasOld = 1> {
1842
1839
dag ret = !con(getInsDPP<OldRC, Src0RC, Src1RC, Src2RC, NumSrcArgs,
1843
1840
HasModifiers, Src0Mod, Src1Mod, Src2Mod, HasOld>.ret,
1844
1841
(ins FI:$fi));
1845
1842
}
1846
1843
1847
- class getInsDPP8 <RegisterOperand OldRC, RegisterClass Src0RC, RegisterClass Src1RC,
1848
- RegisterClass Src2RC, int NumSrcArgs, bit HasModifiers,
1849
- Operand Src0Mod, Operand Src1Mod, Operand Src2Mod, bit HasOld = 1> {
1844
+ class getInsDPP8 <RegisterOperand OldRC, RegisterOperand Src0RC, RegisterOperand Src1RC,
1845
+ RegisterOperand Src2RC, int NumSrcArgs, bit HasModifiers,
1846
+ Operand Src0Mod, Operand Src1Mod, Operand Src2Mod, bit HasOld = 1> {
1850
1847
dag ret = !con(getInsDPPBase<OldRC, Src0RC, Src1RC, Src2RC, NumSrcArgs,
1851
1848
HasModifiers, Src0Mod, Src1Mod, Src2Mod, HasOld>.ret,
1852
1849
(ins dpp8:$dpp8, FI:$fi));
@@ -2251,13 +2248,13 @@ class VOPProfile <list<ValueType> _ArgVT, bit _EnableClamp = 0> {
2251
2248
field RegisterOperand DstRCVOP3DPP = DstRC64;
2252
2249
field RegisterOperand DstRCSDWA = getSDWADstForVT<DstVT>.ret;
2253
2250
field RegisterOperand Src0RC32 = getVOPSrc0ForVT<Src0VT, IsTrue16>.ret;
2254
- field RegisterOperand Src1RC32 = RegisterOperand< getVregSrcForVT<Src1VT>.ret> ;
2251
+ field RegisterOperand Src1RC32 = getVregSrcForVT<Src1VT>.ret;
2255
2252
field RegisterOperand Src0RC64 = getVOP3SrcForVT<Src0VT>.ret;
2256
2253
field RegisterOperand Src1RC64 = getVOP3SrcForVT<Src1VT>.ret;
2257
2254
field RegisterOperand Src2RC64 = getVOP3SrcForVT<Src2VT>.ret;
2258
- field RegisterClass Src0DPP = getVregSrcForVT<Src0VT>.ret;
2259
- field RegisterClass Src1DPP = getVregSrcForVT<Src1VT>.ret;
2260
- field RegisterClass Src2DPP = getVregSrcForVT<Src2VT>.ret;
2255
+ field RegisterOperand Src0DPP = getVregSrcForVT<Src0VT>.ret;
2256
+ field RegisterOperand Src1DPP = getVregSrcForVT<Src1VT>.ret;
2257
+ field RegisterOperand Src2DPP = getVregSrcForVT<Src2VT>.ret;
2261
2258
field RegisterOperand Src0VOP3DPP = VGPRSrc_32;
2262
2259
field RegisterOperand Src1VOP3DPP = getVOP3DPPSrcForVT<Src1VT>.ret;
2263
2260
field RegisterOperand Src2VOP3DPP = getVOP3DPPSrcForVT<Src2VT>.ret;
@@ -2443,13 +2440,13 @@ class VOPProfile_True16<VOPProfile P> : VOPProfile<P.ArgVT> {
2443
2440
let DstRC = getVALUDstForVT<DstVT, 1 /*IsTrue16*/, 0 /*IsVOP3Encoding*/>.ret;
2444
2441
let DstRC64 = getVALUDstForVT<DstVT>.ret;
2445
2442
let Src0RC32 = getVOPSrc0ForVT<Src0VT, 1 /*IsTrue16*/, 0 /*IsFake16*/>.ret;
2446
- let Src1RC32 = getVregSrcForVT_t16 <Src1VT, 0 /*IsFake16*/>.op ;
2447
- let Src0DPP = getVregSrcForVT_t16 <Src0VT>.ret;
2448
- let Src1DPP = getVregSrcForVT_t16 <Src1VT>.ret;
2449
- let Src2DPP = getVregSrcForVT_t16 <Src2VT>.ret;
2450
- let Src0ModDPP = getSrcModDPP_t16<Src0VT>.ret;
2451
- let Src1ModDPP = getSrcModDPP_t16<Src1VT>.ret;
2452
- let Src2ModDPP = getSrcModDPP_t16<Src2VT>.ret;
2443
+ let Src1RC32 = getVregSrcForVT <Src1VT, 1 /*IsTrue16*/, 0 /*IsFake16*/>.ret ;
2444
+ let Src0DPP = getVregSrcForVT <Src0VT, 1 /*IsTrue16*/, 0 /*IsFake16*/ >.ret;
2445
+ let Src1DPP = getVregSrcForVT <Src1VT, 1 /*IsTrue16*/, 0 /*IsFake16*/ >.ret;
2446
+ let Src2DPP = getVregSrcForVT <Src2VT, 1 /*IsTrue16*/, 0 /*IsFake16*/ >.ret;
2447
+ let Src0ModDPP = getSrcModDPP_t16<Src0VT, 0 /*IsFake16*/ >.ret;
2448
+ let Src1ModDPP = getSrcModDPP_t16<Src1VT, 0 /*IsFake16*/ >.ret;
2449
+ let Src2ModDPP = getSrcModDPP_t16<Src2VT, 0 /*IsFake16*/ >.ret;
2453
2450
2454
2451
let DstRC64 = getVALUDstForVT<DstVT, 1 /*IsTrue16*/, 1 /*IsVOP3Encoding*/>.ret;
2455
2452
let Src0RC64 = getVOP3SrcForVT<Src0VT, 1 /*IsTrue16*/>.ret;
@@ -2465,10 +2462,10 @@ class VOPProfile_Fake16<VOPProfile P> : VOPProfile<P.ArgVT> {
2465
2462
// Most DstVT are 16-bit, but not all
2466
2463
let DstRC = getVALUDstForVT_fake16<DstVT>.ret;
2467
2464
let DstRC64 = getVALUDstForVT<DstVT>.ret;
2468
- let Src1RC32 = RegisterOperand<getVregSrcForVT_t16< Src1VT>.ret> ;
2469
- let Src0DPP = getVregSrcForVT_t16 <Src0VT>.ret;
2470
- let Src1DPP = getVregSrcForVT_t16 <Src1VT>.ret;
2471
- let Src2DPP = getVregSrcForVT_t16 <Src2VT>.ret;
2465
+ let Src1RC32 = getVregSrcForVT< Src1VT, 1/*IsTrue16*/, 1/*IsFake16*/ >.ret;
2466
+ let Src0DPP = getVregSrcForVT <Src0VT, 1/*IsTrue16*/, 1/*IsFake16*/ >.ret;
2467
+ let Src1DPP = getVregSrcForVT <Src1VT, 1/*IsTrue16*/, 1/*IsFake16*/ >.ret;
2468
+ let Src2DPP = getVregSrcForVT <Src2VT, 1/*IsTrue16*/, 1/*IsFake16*/ >.ret;
2472
2469
let Src0ModDPP = getSrcModDPP_t16<Src0VT>.ret;
2473
2470
let Src1ModDPP = getSrcModDPP_t16<Src1VT>.ret;
2474
2471
let Src2ModDPP = getSrcModDPP_t16<Src2VT>.ret;
0 commit comments