@@ -31,3 +31,63 @@ let Predicates = [HasStdExtZvfbfwma],
3131 DestEEW = EEWSEWx2 in {
3232defm 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