Skip to content

Commit c189396

Browse files
committed
[NFC][RISCV] Move Zvfbf* relative stuffs to RISCVInstrInfoZvfbf.td
1 parent 6523258 commit c189396

File tree

5 files changed

+61
-60
lines changed

5 files changed

+61
-60
lines changed

llvm/lib/Target/RISCV/RISCVInstrInfoV.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1838,5 +1838,5 @@ let Predicates = [HasVInstructionsI64, IsRV64] in {
18381838
}
18391839
} // Predicates = [HasVInstructionsI64, IsRV64]
18401840

1841-
include "RISCVInstrInfoZvfbf.td"
18421841
include "RISCVInstrInfoVPseudos.td"
1842+
include "RISCVInstrInfoZvfbf.td"

llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6450,8 +6450,6 @@ defm PseudoVFWMACC : VPseudoVWMAC_VV_VF_RM;
64506450
defm PseudoVFWNMACC : VPseudoVWMAC_VV_VF_RM;
64516451
defm PseudoVFWMSAC : VPseudoVWMAC_VV_VF_RM;
64526452
defm PseudoVFWNMSAC : VPseudoVWMAC_VV_VF_RM;
6453-
let Predicates = [HasStdExtZvfbfwma] in
6454-
defm PseudoVFWMACCBF16 : VPseudoVWMAC_VV_VF_BF_RM;
64556453
}
64566454

64576455
//===----------------------------------------------------------------------===//
@@ -6544,7 +6542,6 @@ defm PseudoVFWCVT_F_XU : VPseudoVWCVTF_V;
65446542
defm PseudoVFWCVT_F_X : VPseudoVWCVTF_V;
65456543

65466544
defm PseudoVFWCVT_F_F : VPseudoVWCVTD_V;
6547-
defm PseudoVFWCVTBF16_F_F : VPseudoVWCVTD_V;
65486545
} // mayRaiseFPException = true
65496546

65506547
//===----------------------------------------------------------------------===//
@@ -6561,7 +6558,6 @@ defm PseudoVFNCVT_F_XU : VPseudoVNCVTF_W_RM;
65616558
defm PseudoVFNCVT_F_X : VPseudoVNCVTF_W_RM;
65626559

65636560
defm PseudoVFNCVT_F_F : VPseudoVNCVTD_W_RM;
6564-
defm PseudoVFNCVTBF16_F_F : VPseudoVNCVTD_W_RM;
65656561

65666562
defm PseudoVFNCVT_ROD_F_F : VPseudoVNCVTD_W;
65676563
} // mayRaiseFPException = true
@@ -7090,9 +7086,6 @@ defm : VPatTernaryW_VV_VX_RM<"int_riscv_vfwmsac", "PseudoVFWMSAC",
70907086
AllWidenableFloatVectors, isSEWAware=1>;
70917087
defm : VPatTernaryW_VV_VX_RM<"int_riscv_vfwnmsac", "PseudoVFWNMSAC",
70927088
AllWidenableFloatVectors, isSEWAware=1>;
7093-
let Predicates = [HasStdExtZvfbfwma] in
7094-
defm : VPatTernaryW_VV_VX_RM<"int_riscv_vfwmaccbf16", "PseudoVFWMACCBF16",
7095-
AllWidenableBFloatToFloatVectors, isSEWAware=1>;
70967089

70977090
//===----------------------------------------------------------------------===//
70987091
// 13.8. Vector Floating-Point Square-Root Instruction
@@ -7206,8 +7199,6 @@ defm : VPatConversionWF_VI<"int_riscv_vfwcvt_f_x_v", "PseudoVFWCVT_F_X",
72067199
isSEWAware=1>;
72077200
defm : VPatConversionWF_VF<"int_riscv_vfwcvt_f_f_v", "PseudoVFWCVT_F_F",
72087201
isSEWAware=1>;
7209-
defm : VPatConversionWF_VF_BF<"int_riscv_vfwcvtbf16_f_f_v",
7210-
"PseudoVFWCVTBF16_F_F", isSEWAware=1>;
72117202

72127203
//===----------------------------------------------------------------------===//
72137204
// 13.19. Narrowing Floating-Point/Integer Type-Convert Instructions
@@ -7224,8 +7215,6 @@ defm : VPatConversionVF_WI_RM<"int_riscv_vfncvt_f_x_w", "PseudoVFNCVT_F_X",
72247215
isSEWAware=1>;
72257216
defm : VPatConversionVF_WF_RM<"int_riscv_vfncvt_f_f_w", "PseudoVFNCVT_F_F",
72267217
AllWidenableFloatVectors, isSEWAware=1>;
7227-
defm : VPatConversionVF_WF_BF_RM<"int_riscv_vfncvtbf16_f_f_w",
7228-
"PseudoVFNCVTBF16_F_F", isSEWAware=1>;
72297218
defm : VPatConversionVF_WF<"int_riscv_vfncvt_rod_f_f_w", "PseudoVFNCVT_ROD_F_F",
72307219
isSEWAware=1>;
72317220

llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,8 +1315,6 @@ foreach fvti = AllFloatVectors in {
13151315
// 13.7. Vector Widening Floating-Point Fused Multiply-Add Instructions
13161316
defm : VPatWidenFPMulAccSDNode_VV_VF_RM<"PseudoVFWMACC",
13171317
AllWidenableFloatVectors>;
1318-
defm : VPatWidenFPMulAccSDNode_VV_VF_RM<"PseudoVFWMACCBF16",
1319-
AllWidenableBFloatToFloatVectors>;
13201318
defm : VPatWidenFPNegMulAccSDNode_VV_VF_RM<"PseudoVFWNMACC">;
13211319
defm : VPatWidenFPMulSacSDNode_VV_VF_RM<"PseudoVFWMSAC">;
13221320
defm : VPatWidenFPNegMulSacSDNode_VV_VF_RM<"PseudoVFWNMSAC">;
@@ -1460,20 +1458,6 @@ foreach fvtiToFWti = AllWidenableFloatVectors in {
14601458
fvti.AVL, fvti.Log2SEW, TA_MA)>;
14611459
}
14621460

1463-
foreach fvtiToFWti = AllWidenableBFloatToFloatVectors in {
1464-
defvar fvti = fvtiToFWti.Vti;
1465-
defvar fwti = fvtiToFWti.Wti;
1466-
let Predicates = [HasVInstructionsBF16Minimal] in
1467-
def : Pat<(fvti.Vector (fpround (fwti.Vector fwti.RegClass:$rs1))),
1468-
(!cast<Instruction>("PseudoVFNCVTBF16_F_F_W_"#fvti.LMul.MX#"_E"#fvti.SEW)
1469-
(fvti.Vector (IMPLICIT_DEF)),
1470-
fwti.RegClass:$rs1,
1471-
// Value to indicate no rounding mode change in
1472-
// RISCVInsertReadWriteCSR
1473-
FRM_DYN,
1474-
fvti.AVL, fvti.Log2SEW, TA_MA)>;
1475-
}
1476-
14771461
//===----------------------------------------------------------------------===//
14781462
// Vector Element Extracts
14791463
//===----------------------------------------------------------------------===//

llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2322,8 +2322,6 @@ defm : VPatFPMulAddVL_VV_VF_RM<any_riscv_vfnmsub_vl, "PseudoVFNMSUB">;
23222322

23232323
// 13.7. Vector Widening Floating-Point Fused Multiply-Add Instructions
23242324
defm : VPatWidenFPMulAccVL_VV_VF_RM<riscv_vfwmadd_vl, "PseudoVFWMACC">;
2325-
defm : VPatWidenFPMulAccVL_VV_VF_RM<riscv_vfwmadd_vl, "PseudoVFWMACCBF16",
2326-
AllWidenableBFloatToFloatVectors>;
23272325
defm : VPatWidenFPMulAccVL_VV_VF_RM<riscv_vfwnmadd_vl, "PseudoVFWNMACC">;
23282326
defm : VPatWidenFPMulAccVL_VV_VF_RM<riscv_vfwmsub_vl, "PseudoVFWMSAC">;
23292327
defm : VPatWidenFPMulAccVL_VV_VF_RM<riscv_vfwnmsub_vl, "PseudoVFWNMSAC">;
@@ -2541,20 +2539,6 @@ foreach fvtiToFWti = AllWidenableFloatVectors in {
25412539
GPR:$vl, fvti.Log2SEW, TA_MA)>;
25422540
}
25432541

2544-
foreach fvtiToFWti = AllWidenableBFloatToFloatVectors in {
2545-
defvar fvti = fvtiToFWti.Vti;
2546-
defvar fwti = fvtiToFWti.Wti;
2547-
let Predicates = [HasVInstructionsBF16Minimal] in
2548-
def : Pat<(fwti.Vector (any_riscv_fpextend_vl
2549-
(fvti.Vector fvti.RegClass:$rs1),
2550-
(fvti.Mask VMV0:$vm),
2551-
VLOpFrag)),
2552-
(!cast<Instruction>("PseudoVFWCVTBF16_F_F_V_"#fvti.LMul.MX#"_E"#fvti.SEW#"_MASK")
2553-
(fwti.Vector (IMPLICIT_DEF)), fvti.RegClass:$rs1,
2554-
(fvti.Mask VMV0:$vm),
2555-
GPR:$vl, fvti.Log2SEW, TA_MA)>;
2556-
}
2557-
25582542
// 13.19 Narrowing Floating-Point/Integer Type-Convert Instructions
25592543
defm : VPatNConvertFP2I_RM_VL_W<riscv_vfcvt_rm_xu_f_vl, "PseudoVFNCVT_XU_F_W">;
25602544
defm : VPatNConvertFP2I_RM_VL_W<riscv_vfcvt_rm_x_f_vl, "PseudoVFNCVT_X_F_W">;
@@ -2596,22 +2580,6 @@ foreach fvtiToFWti = AllWidenableFloatVectors in {
25962580
}
25972581
}
25982582

2599-
foreach fvtiToFWti = AllWidenableBFloatToFloatVectors in {
2600-
defvar fvti = fvtiToFWti.Vti;
2601-
defvar fwti = fvtiToFWti.Wti;
2602-
let Predicates = [HasVInstructionsBF16Minimal] in
2603-
def : Pat<(fvti.Vector (any_riscv_fpround_vl
2604-
(fwti.Vector fwti.RegClass:$rs1),
2605-
(fwti.Mask VMV0:$vm), VLOpFrag)),
2606-
(!cast<Instruction>("PseudoVFNCVTBF16_F_F_W_"#fvti.LMul.MX#"_E"#fvti.SEW#"_MASK")
2607-
(fvti.Vector (IMPLICIT_DEF)), fwti.RegClass:$rs1,
2608-
(fwti.Mask VMV0:$vm),
2609-
// Value to indicate no rounding mode change in
2610-
// RISCVInsertReadWriteCSR
2611-
FRM_DYN,
2612-
GPR:$vl, fvti.Log2SEW, TA_MA)>;
2613-
}
2614-
26152583
// 14. Vector Reduction Operations
26162584

26172585
// 14.1. Vector Single-Width Integer Reduction Instructions

llvm/lib/Target/RISCV/RISCVInstrInfoZvfbf.td

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,63 @@ let Predicates = [HasStdExtZvfbfwma],
3131
DestEEW = EEWSEWx2 in {
3232
defm VFWMACCBF16_V : VWMAC_FV_V_F<"vfwmaccbf16", 0b111011>;
3333
}
34+
35+
let Predicates = [HasStdExtZvfbfmin] in {
36+
defm PseudoVFWCVTBF16_F_F : VPseudoVWCVTD_V;
37+
defm PseudoVFNCVTBF16_F_F : VPseudoVNCVTD_W_RM;
38+
}
39+
40+
let mayRaiseFPException = true, Predicates = [HasStdExtZvfbfwma] in
41+
defm PseudoVFWMACCBF16 : VPseudoVWMAC_VV_VF_BF_RM;
42+
43+
44+
let Predicates = [HasStdExtZvfbfmin] in {
45+
defm : VPatConversionWF_VF_BF<"int_riscv_vfwcvtbf16_f_f_v",
46+
"PseudoVFWCVTBF16_F_F", isSEWAware=1>;
47+
defm : VPatConversionVF_WF_BF_RM<"int_riscv_vfncvtbf16_f_f_w",
48+
"PseudoVFNCVTBF16_F_F", isSEWAware=1>;
49+
50+
foreach fvtiToFWti = AllWidenableBFloatToFloatVectors in {
51+
defvar fvti = fvtiToFWti.Vti;
52+
defvar fwti = fvtiToFWti.Wti;
53+
let Predicates = [HasVInstructionsBF16Minimal] in
54+
def : Pat<(fwti.Vector (any_riscv_fpextend_vl
55+
(fvti.Vector fvti.RegClass:$rs1),
56+
(fvti.Mask VMV0:$vm),
57+
VLOpFrag)),
58+
(!cast<Instruction>("PseudoVFWCVTBF16_F_F_V_"#fvti.LMul.MX#"_E"#fvti.SEW#"_MASK")
59+
(fwti.Vector (IMPLICIT_DEF)), fvti.RegClass:$rs1,
60+
(fvti.Mask VMV0:$vm),
61+
GPR:$vl, fvti.Log2SEW, TA_MA)>;
62+
63+
let Predicates = [HasVInstructionsBF16Minimal] in
64+
def : Pat<(fvti.Vector (any_riscv_fpround_vl
65+
(fwti.Vector fwti.RegClass:$rs1),
66+
(fwti.Mask VMV0:$vm), VLOpFrag)),
67+
(!cast<Instruction>("PseudoVFNCVTBF16_F_F_W_"#fvti.LMul.MX#"_E"#fvti.SEW#"_MASK")
68+
(fvti.Vector (IMPLICIT_DEF)), fwti.RegClass:$rs1,
69+
(fwti.Mask VMV0:$vm),
70+
// Value to indicate no rounding mode change in
71+
// RISCVInsertReadWriteCSR
72+
FRM_DYN,
73+
GPR:$vl, fvti.Log2SEW, TA_MA)>;
74+
let Predicates = [HasVInstructionsBF16Minimal] in
75+
def : Pat<(fvti.Vector (fpround (fwti.Vector fwti.RegClass:$rs1))),
76+
(!cast<Instruction>("PseudoVFNCVTBF16_F_F_W_"#fvti.LMul.MX#"_E"#fvti.SEW)
77+
(fvti.Vector (IMPLICIT_DEF)),
78+
fwti.RegClass:$rs1,
79+
// Value to indicate no rounding mode change in
80+
// RISCVInsertReadWriteCSR
81+
FRM_DYN,
82+
fvti.AVL, fvti.Log2SEW, TA_MA)>;
83+
}
84+
}
85+
86+
let Predicates = [HasStdExtZvfbfwma] in {
87+
defm : VPatTernaryW_VV_VX_RM<"int_riscv_vfwmaccbf16", "PseudoVFWMACCBF16",
88+
AllWidenableBFloatToFloatVectors, isSEWAware=1>;
89+
defm : VPatWidenFPMulAccVL_VV_VF_RM<riscv_vfwmadd_vl, "PseudoVFWMACCBF16",
90+
AllWidenableBFloatToFloatVectors>;
91+
defm : VPatWidenFPMulAccSDNode_VV_VF_RM<"PseudoVFWMACCBF16",
92+
AllWidenableBFloatToFloatVectors>;
93+
}

0 commit comments

Comments
 (0)