Skip to content

Commit 7edcb20

Browse files
toppercmahesh-attarde
authored andcommitted
[RISCV] Rename BFloatVectors -> BF16Vectors in tablegen. NFC (llvm#161469)
Part of this rename is taken from llvm#161158, but applies it more consistently to more variables. I think using BF16 makes it easier to not confuse BFloat and Float when reading.
1 parent c523339 commit 7edcb20

File tree

6 files changed

+19
-19
lines changed

6 files changed

+19
-19
lines changed

llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ defset list<VTypeInfo> AllVectors = {
345345
}
346346
}
347347

348-
defset list<VTypeInfo> AllFloatAndBFloatVectors = {
348+
defset list<VTypeInfo> AllFloatAndBF16Vectors = {
349349
defset list<VTypeInfo> AllFloatVectors = {
350350
defset list<VTypeInfo> NoGroupFloatVectors = {
351351
defset list<VTypeInfo> FractionalGroupFloatVectors = {
@@ -382,16 +382,16 @@ defset list<VTypeInfo> AllVectors = {
382382
}
383383
}
384384

385-
defset list<VTypeInfo> AllBFloatVectors = {
386-
defset list<VTypeInfo> NoGroupBFloatVectors = {
387-
defset list<VTypeInfo> FractionalGroupBFloatVectors = {
385+
defset list<VTypeInfo> AllBF16Vectors = {
386+
defset list<VTypeInfo> NoGroupBF16Vectors = {
387+
defset list<VTypeInfo> FractionalGroupBF16Vectors = {
388388
def VBF16MF4: VTypeInfo<vbfloat16mf4_t, vbool64_t, 16, V_MF4, bf16, FPR16>;
389389
def VBF16MF2: VTypeInfo<vbfloat16mf2_t, vbool32_t, 16, V_MF2, bf16, FPR16>;
390390
}
391391
def VBF16M1: VTypeInfo<vbfloat16m1_t, vbool16_t, 16, V_M1, bf16, FPR16>;
392392
}
393393

394-
defset list<GroupVTypeInfo> GroupBFloatVectors = {
394+
defset list<GroupVTypeInfo> GroupBF16Vectors = {
395395
def VBF16M2: GroupVTypeInfo<vbfloat16m2_t, vbfloat16m1_t, vbool8_t, 16,
396396
V_M2, bf16, FPR16>;
397397
def VBF16M4: GroupVTypeInfo<vbfloat16m4_t, vbfloat16m1_t, vbool4_t, 16,
@@ -542,7 +542,7 @@ defset list<VTypeInfoToWide> AllWidenableIntToFloatVectors = {
542542
def : VTypeInfoToWide<VI32M4, VF64M8>;
543543
}
544544

545-
defset list<VTypeInfoToWide> AllWidenableBFloatToFloatVectors = {
545+
defset list<VTypeInfoToWide> AllWidenableBF16ToFloatVectors = {
546546
def : VTypeInfoToWide<VBF16MF4, VF32MF2>;
547547
def : VTypeInfoToWide<VBF16MF2, VF32M1>;
548548
def : VTypeInfoToWide<VBF16M1, VF32M2>;
@@ -5870,7 +5870,7 @@ multiclass VPatConversionWF_VF<string intrinsic, string instruction,
58705870

58715871
multiclass VPatConversionWF_VF_BF<string intrinsic, string instruction,
58725872
bit isSEWAware = 0> {
5873-
foreach fvtiToFWti = AllWidenableBFloatToFloatVectors in
5873+
foreach fvtiToFWti = AllWidenableBF16ToFloatVectors in
58745874
{
58755875
defvar fvti = fvtiToFWti.Vti;
58765876
defvar fwti = fvtiToFWti.Wti;
@@ -5977,7 +5977,7 @@ multiclass VPatConversionVF_WF_RTZ<string intrinsic, string instruction,
59775977

59785978
multiclass VPatConversionVF_WF_BF_RM<string intrinsic, string instruction,
59795979
bit isSEWAware = 0> {
5980-
foreach fvtiToFWti = AllWidenableBFloatToFloatVectors in {
5980+
foreach fvtiToFWti = AllWidenableBF16ToFloatVectors in {
59815981
defvar fvti = fvtiToFWti.Vti;
59825982
defvar fwti = fvtiToFWti.Wti;
59835983
let Predicates = !listconcat(GetVTypePredicates<fvti>.Predicates,
@@ -7154,7 +7154,7 @@ defm : VPatConversionVI_VF<"int_riscv_vfclass", "PseudoVFCLASS">;
71547154
// We can use vmerge.vvm to support vector-vector vfmerge.
71557155
// NOTE: Clang previously used int_riscv_vfmerge for vector-vector, but now uses
71567156
// int_riscv_vmerge. Support both for compatibility.
7157-
foreach vti = AllFloatAndBFloatVectors in {
7157+
foreach vti = AllFloatAndBF16Vectors in {
71587158
let Predicates = GetVTypeMinimalPredicates<vti>.Predicates in
71597159
defm : VPatBinaryCarryInTAIL<"int_riscv_vmerge", "PseudoVMERGE", "VVM",
71607160
vti.Vector,

llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1388,7 +1388,7 @@ defm : VPatFPSetCCSDNode_VV_VF_FV<SETOLE, "PseudoVMFLE", "PseudoVMFGE">;
13881388
// Floating-point vselects:
13891389
// 11.15. Vector Integer Merge Instructions
13901390
// 13.15. Vector Floating-Point Merge Instruction
1391-
foreach fvti = AllFloatAndBFloatVectors in {
1391+
foreach fvti = AllFloatAndBF16Vectors in {
13921392
defvar ivti = GetIntVTypeInfo<fvti>.Vti;
13931393
let Predicates = GetVTypePredicates<ivti>.Predicates in {
13941394
def : Pat<(fvti.Vector (vselect (fvti.Mask VMV0:$vm), fvti.RegClass:$rs1,

llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2426,7 +2426,7 @@ foreach vti = AllFloatVectors in {
24262426
// Floating-point vselects:
24272427
// 11.15. Vector Integer Merge Instructions
24282428
// 13.15. Vector Floating-Point Merge Instruction
2429-
foreach fvti = AllFloatAndBFloatVectors in {
2429+
foreach fvti = AllFloatAndBF16Vectors in {
24302430
defvar ivti = GetIntVTypeInfo<fvti>.Vti;
24312431
let Predicates = GetVTypePredicates<ivti>.Predicates in {
24322432
def : Pat<(fvti.Vector (riscv_vmerge_vl (fvti.Mask VMV0:$vm),
@@ -2770,7 +2770,7 @@ foreach vti = NoGroupFloatVectors in {
27702770
}
27712771
}
27722772

2773-
foreach vti = AllFloatAndBFloatVectors in {
2773+
foreach vti = AllFloatAndBF16Vectors in {
27742774
defvar ivti = GetIntVTypeInfo<vti>.Vti;
27752775
let Predicates = GetVTypePredicates<ivti>.Predicates in {
27762776
def : Pat<(vti.Vector

llvm/lib/Target/RISCV/RISCVInstrInfoXAndes.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ multiclass VPseudoVNCVT_BF16_S {
560560
}
561561

562562
multiclass VPatConversionS_BF16<string intrinsic, string instruction> {
563-
foreach fvtiToFWti = AllWidenableBFloatToFloatVectors in {
563+
foreach fvtiToFWti = AllWidenableBF16ToFloatVectors in {
564564
defvar fvti = fvtiToFWti.Vti;
565565
defvar fwti = fvtiToFWti.Wti;
566566
let Predicates = [HasVendorXAndesVBFHCvt] in
@@ -572,7 +572,7 @@ multiclass VPatConversionS_BF16<string intrinsic, string instruction> {
572572
}
573573

574574
multiclass VPatConversionBF16_S<string intrinsic, string instruction> {
575-
foreach fvtiToFWti = AllWidenableBFloatToFloatVectors in {
575+
foreach fvtiToFWti = AllWidenableBF16ToFloatVectors in {
576576
defvar fvti = fvtiToFWti.Vti;
577577
defvar fwti = fvtiToFWti.Wti;
578578
let Predicates = [HasVendorXAndesVBFHCvt] in

llvm/lib/Target/RISCV/RISCVInstrInfoXSf.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ multiclass VPatVQMACCQOQ<string intrinsic, string instruction, string kind>
770770
: VPatVMACC<intrinsic, instruction, kind, VQMACCQOQInfoPairs, vint8m1_t>;
771771

772772
multiclass VPatVFWMACC<string intrinsic, string instruction, string kind>
773-
: VPatVMACC<intrinsic, instruction, kind, AllWidenableBFloatToFloatVectors,
773+
: VPatVMACC<intrinsic, instruction, kind, AllWidenableBF16ToFloatVectors,
774774
vbfloat16m1_t>;
775775

776776
defset list<VTypeInfoToWide> VFNRCLIPInfoPairs = {

llvm/lib/Target/RISCV/RISCVInstrInfoZvfbf.td

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ let Predicates = [HasStdExtZvfbfminOrZvfofp8min] in {
5353
defm : VPatConversionVF_WF_BF_RM<"int_riscv_vfncvtbf16_f_f_w",
5454
"PseudoVFNCVTBF16_F_F", isSEWAware=1>;
5555

56-
foreach fvtiToFWti = AllWidenableBFloatToFloatVectors in {
56+
foreach fvtiToFWti = AllWidenableBF16ToFloatVectors in {
5757
defvar fvti = fvtiToFWti.Vti;
5858
defvar fwti = fvtiToFWti.Wti;
5959
let Predicates = [HasVInstructionsBF16Minimal] in
@@ -91,9 +91,9 @@ let Predicates = [HasStdExtZvfbfminOrZvfofp8min] in {
9191

9292
let Predicates = [HasStdExtZvfbfwma] in {
9393
defm : VPatTernaryW_VV_VX_RM<"int_riscv_vfwmaccbf16", "PseudoVFWMACCBF16",
94-
AllWidenableBFloatToFloatVectors, isSEWAware=1>;
94+
AllWidenableBF16ToFloatVectors, isSEWAware=1>;
9595
defm : VPatWidenFPMulAccVL_VV_VF_RM<riscv_vfwmadd_vl, "PseudoVFWMACCBF16",
96-
AllWidenableBFloatToFloatVectors>;
96+
AllWidenableBF16ToFloatVectors>;
9797
defm : VPatWidenFPMulAccSDNode_VV_VF_RM<"PseudoVFWMACCBF16",
98-
AllWidenableBFloatToFloatVectors>;
98+
AllWidenableBF16ToFloatVectors>;
9999
}

0 commit comments

Comments
 (0)