@@ -463,37 +463,51 @@ multiclass VPatVC_XVV<string intrinsic_suffix, string instruction_suffix,
463463 wti.RegClass, vti.RegClass, kind, op1_kind>;
464464}
465465
466+ class GetFTypeInfo<int Sew> {
467+ ValueType Scalar = !cond(!eq(Sew, 16) : f16,
468+ !eq(Sew, 32) : f32,
469+ !eq(Sew, 64) : f64);
470+ RegisterClass ScalarRegClass = !cond(!eq(Sew, 16) : FPR16,
471+ !eq(Sew, 32) : FPR32,
472+ !eq(Sew, 64) : FPR64);
473+
474+ string ScalarSuffix = !cond(!eq(Scalar, f16) : "FPR16",
475+ !eq(Scalar, f32) : "FPR32",
476+ !eq(Scalar, f64) : "FPR64");
477+ }
478+
466479let Predicates = [HasVendorXSfvcp] in {
467- foreach vti = AllIntegerVectors in {
468- defm : VPatVC_X<"x", "X", vti, vti.Scalar, vti.ScalarRegClass >;
480+ foreach vti = AllVectors in {
481+ defm : VPatVC_X<"x", "X", vti, XLenVT, GPR >;
469482 defm : VPatVC_X<"i", "I", vti, XLenVT, tsimm5>;
470- defm : VPatVC_XV<"xv", "XV", vti, vti.Scalar, vti.ScalarRegClass >;
483+ defm : VPatVC_XV<"xv", "XV", vti, XLenVT, GPR >;
471484 defm : VPatVC_XV<"iv", "IV", vti, XLenVT, tsimm5>;
472485 defm : VPatVC_XV<"vv", "VV", vti, vti.Vector, vti.RegClass>;
473- defm : VPatVC_XVV<"xvv", "XVV", vti, vti, vti.Scalar, vti.ScalarRegClass >;
486+ defm : VPatVC_XVV<"xvv", "XVV", vti, vti, XLenVT, GPR >;
474487 defm : VPatVC_XVV<"ivv", "IVV", vti, vti, XLenVT, tsimm5>;
475488 defm : VPatVC_XVV<"vvv", "VVV", vti, vti, vti.Vector, vti.RegClass>;
489+
490+ if !ne(vti.SEW, 8) then {
491+ defvar finfo = GetFTypeInfo<vti.SEW>;
492+ defm : VPatVC_XV<"fv", finfo.ScalarSuffix # "V", vti, finfo.Scalar,
493+ finfo.ScalarRegClass, payload1>;
494+ defm : VPatVC_XVV<"fvv", finfo.ScalarSuffix # "VV", vti, vti, finfo.Scalar,
495+ finfo.ScalarRegClass, payload1>;
496+ }
476497 }
477- foreach fvti = AllFloatVectors in {
478- defvar ivti = GetIntVTypeInfo<fvti>.Vti;
479- defm : VPatVC_XV<"fv", fvti.ScalarSuffix # "V", ivti, fvti.Scalar,
480- fvti.ScalarRegClass, payload1>;
481- defm : VPatVC_XVV<"fvv", fvti.ScalarSuffix # "VV", ivti, ivti, fvti.Scalar,
482- fvti.ScalarRegClass, payload1>;
483- }
484- foreach VtiToWti = AllWidenableIntVectors in {
498+ foreach VtiToWti = !listconcat(AllWidenableIntVectors, AllWidenableFloatVectors) in {
485499 defvar vti = VtiToWti.Vti;
486500 defvar wti = VtiToWti.Wti;
487- defm : VPatVC_XVV<"xvw", "XVW", wti, vti, vti.Scalar, vti.ScalarRegClass>;
501+ defvar iinfo = GetIntVTypeInfo<vti>.Vti;
502+ defm : VPatVC_XVV<"xvw", "XVW", wti, vti, iinfo.Scalar, iinfo.ScalarRegClass>;
488503 defm : VPatVC_XVV<"ivw", "IVW", wti, vti, XLenVT, tsimm5>;
489504 defm : VPatVC_XVV<"vvw", "VVW", wti, vti, vti.Vector, vti.RegClass>;
490- }
491- foreach VtiToWti = AllWidenableFloatVectors in {
492- defvar fvti = VtiToWti.Vti;
493- defvar iwti = GetIntVTypeInfo<VtiToWti.Wti>.Vti;
494- defvar ivti = GetIntVTypeInfo<fvti>.Vti;
495- defm : VPatVC_XVV<"fvw", fvti.ScalarSuffix # "VW", iwti, ivti, fvti.Scalar,
496- fvti.ScalarRegClass, payload1>;
505+
506+ if !ne(vti.SEW, 8) then {
507+ defvar finfo = GetFTypeInfo<vti.SEW>;
508+ defm : VPatVC_XVV<"fvw", finfo.ScalarSuffix # "VW", wti, vti, finfo.Scalar,
509+ finfo.ScalarRegClass, payload1>;
510+ }
497511 }
498512}
499513
0 commit comments