diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td b/llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td --- a/llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td +++ b/llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td @@ -2012,81 +2012,81 @@ fvti.LMul.MX # "_TU") $passthru, (fvti.Scalar fvti.ScalarRegClass:$rs2), GPR:$vl, fvti.Log2SEW)>; +} - // 13.17. Vector Single-Width Floating-Point/Integer Type-Convert Instructions - defm : VPatConvertFP2IVL_V; - defm : VPatConvertFP2IVL_V; - defm : VPatConvertFP2I_RM_VL_V; - defm : VPatConvertFP2I_RM_VL_V; - - defm : VPatConvertFP2IVL_V; - defm : VPatConvertFP2IVL_V; - - defm : VPatConvertI2FPVL_V; - defm : VPatConvertI2FPVL_V; - - defm : VPatConvertI2FP_RM_VL_V; - defm : VPatConvertI2FP_RM_VL_V; - - // 13.18. Widening Floating-Point/Integer Type-Convert Instructions - defm : VPatWConvertFP2IVL_V; - defm : VPatWConvertFP2IVL_V; - defm : VPatWConvertFP2I_RM_VL_V; - defm : VPatWConvertFP2I_RM_VL_V; - - defm : VPatWConvertFP2IVL_V; - defm : VPatWConvertFP2IVL_V; +// 13.17. Vector Single-Width Floating-Point/Integer Type-Convert Instructions +defm : VPatConvertFP2IVL_V; +defm : VPatConvertFP2IVL_V; +defm : VPatConvertFP2I_RM_VL_V; +defm : VPatConvertFP2I_RM_VL_V; - defm : VPatWConvertI2FPVL_V; - defm : VPatWConvertI2FPVL_V; +defm : VPatConvertFP2IVL_V; +defm : VPatConvertFP2IVL_V; - defm : VPatWConvertI2FP_RM_VL_V; - defm : VPatWConvertI2FP_RM_VL_V; +defm : VPatConvertI2FPVL_V; +defm : VPatConvertI2FPVL_V; - foreach fvtiToFWti = AllWidenableFloatVectors in { - defvar fvti = fvtiToFWti.Vti; - defvar fwti = fvtiToFWti.Wti; - def : Pat<(fwti.Vector (any_riscv_fpextend_vl - (fvti.Vector fvti.RegClass:$rs1), - (fvti.Mask V0), - VLOpFrag)), - (!cast("PseudoVFWCVT_F_F_V_"#fvti.LMul.MX#"_MASK") - (fwti.Vector (IMPLICIT_DEF)), fvti.RegClass:$rs1, - (fvti.Mask V0), GPR:$vl, fvti.Log2SEW, TA_MA)>; - } +defm : VPatConvertI2FP_RM_VL_V; +defm : VPatConvertI2FP_RM_VL_V; - // 13.19 Narrowing Floating-Point/Integer Type-Convert Instructions - defm : VPatNConvertFP2IVL_W; - defm : VPatNConvertFP2IVL_W; - defm : VPatNConvertFP2I_RM_VL_W; - defm : VPatNConvertFP2I_RM_VL_W; +// 13.18. Widening Floating-Point/Integer Type-Convert Instructions +defm : VPatWConvertFP2IVL_V; +defm : VPatWConvertFP2IVL_V; +defm : VPatWConvertFP2I_RM_VL_V; +defm : VPatWConvertFP2I_RM_VL_V; - defm : VPatNConvertFP2IVL_W; - defm : VPatNConvertFP2IVL_W; +defm : VPatWConvertFP2IVL_V; +defm : VPatWConvertFP2IVL_V; - defm : VPatNConvertI2FPVL_W; - defm : VPatNConvertI2FPVL_W; +defm : VPatWConvertI2FPVL_V; +defm : VPatWConvertI2FPVL_V; - defm : VPatNConvertI2FP_RM_VL_W; - defm : VPatNConvertI2FP_RM_VL_W; +defm : VPatWConvertI2FP_RM_VL_V; +defm : VPatWConvertI2FP_RM_VL_V; - foreach fvtiToFWti = AllWidenableFloatVectors in { - defvar fvti = fvtiToFWti.Vti; - defvar fwti = fvtiToFWti.Wti; - def : Pat<(fvti.Vector (any_riscv_fpround_vl - (fwti.Vector fwti.RegClass:$rs1), - (fwti.Mask V0), VLOpFrag)), - (!cast("PseudoVFNCVT_F_F_W_"#fvti.LMul.MX#"_MASK") - (fvti.Vector (IMPLICIT_DEF)), fwti.RegClass:$rs1, - (fwti.Mask V0), GPR:$vl, fvti.Log2SEW, TA_MA)>; - - def : Pat<(fvti.Vector (any_riscv_fncvt_rod_vl - (fwti.Vector fwti.RegClass:$rs1), - (fwti.Mask V0), VLOpFrag)), - (!cast("PseudoVFNCVT_ROD_F_F_W_"#fvti.LMul.MX#"_MASK") - (fvti.Vector (IMPLICIT_DEF)), fwti.RegClass:$rs1, - (fwti.Mask V0), GPR:$vl, fvti.Log2SEW, TA_MA)>; - } +foreach fvtiToFWti = AllWidenableFloatVectors in { + defvar fvti = fvtiToFWti.Vti; + defvar fwti = fvtiToFWti.Wti; + def : Pat<(fwti.Vector (any_riscv_fpextend_vl + (fvti.Vector fvti.RegClass:$rs1), + (fvti.Mask V0), + VLOpFrag)), + (!cast("PseudoVFWCVT_F_F_V_"#fvti.LMul.MX#"_MASK") + (fwti.Vector (IMPLICIT_DEF)), fvti.RegClass:$rs1, + (fvti.Mask V0), GPR:$vl, fvti.Log2SEW, TA_MA)>; +} + +// 13.19 Narrowing Floating-Point/Integer Type-Convert Instructions +defm : VPatNConvertFP2IVL_W; +defm : VPatNConvertFP2IVL_W; +defm : VPatNConvertFP2I_RM_VL_W; +defm : VPatNConvertFP2I_RM_VL_W; + +defm : VPatNConvertFP2IVL_W; +defm : VPatNConvertFP2IVL_W; + +defm : VPatNConvertI2FPVL_W; +defm : VPatNConvertI2FPVL_W; + +defm : VPatNConvertI2FP_RM_VL_W; +defm : VPatNConvertI2FP_RM_VL_W; + +foreach fvtiToFWti = AllWidenableFloatVectors in { + defvar fvti = fvtiToFWti.Vti; + defvar fwti = fvtiToFWti.Wti; + def : Pat<(fvti.Vector (any_riscv_fpround_vl + (fwti.Vector fwti.RegClass:$rs1), + (fwti.Mask V0), VLOpFrag)), + (!cast("PseudoVFNCVT_F_F_W_"#fvti.LMul.MX#"_MASK") + (fvti.Vector (IMPLICIT_DEF)), fwti.RegClass:$rs1, + (fwti.Mask V0), GPR:$vl, fvti.Log2SEW, TA_MA)>; + + def : Pat<(fvti.Vector (any_riscv_fncvt_rod_vl + (fwti.Vector fwti.RegClass:$rs1), + (fwti.Mask V0), VLOpFrag)), + (!cast("PseudoVFNCVT_ROD_F_F_W_"#fvti.LMul.MX#"_MASK") + (fvti.Vector (IMPLICIT_DEF)), fwti.RegClass:$rs1, + (fwti.Mask V0), GPR:$vl, fvti.Log2SEW, TA_MA)>; } } // Predicates = [HasVInstructionsAnyF]