@@ -3287,10 +3287,10 @@ multiclass VPseudoTernaryW_VV<LMULInfo m> {
3287
3287
constraint, /*Commutable*/ 0, TargetConstraintType=3>;
3288
3288
}
3289
3289
3290
- multiclass VPseudoTernaryW_VV_RM<LMULInfo m> {
3290
+ multiclass VPseudoTernaryW_VV_RM<LMULInfo m, int sew = 0 > {
3291
3291
defvar constraint = "@earlyclobber $rd";
3292
3292
defm _VV : VPseudoTernaryWithPolicyRoundingMode<m.wvrclass, m.vrclass, m.vrclass, m,
3293
- constraint, /* Commutable */ 0,
3293
+ constraint, sew, /* Commutable */ 0,
3294
3294
TargetConstraintType=3>;
3295
3295
}
3296
3296
@@ -3306,11 +3306,11 @@ multiclass VPseudoTernaryW_VF<LMULInfo m, FPR_Info f, int TargetConstraintType =
3306
3306
m.vrclass, m, constraint, /*Commutable*/ 0, TargetConstraintType>;
3307
3307
}
3308
3308
3309
- multiclass VPseudoTernaryW_VF_RM<LMULInfo m, FPR_Info f> {
3309
+ multiclass VPseudoTernaryW_VF_RM<LMULInfo m, FPR_Info f, int sew = 0 > {
3310
3310
defvar constraint = "@earlyclobber $rd";
3311
3311
defm "_V" # f.FX : VPseudoTernaryWithPolicyRoundingMode<m.wvrclass, f.fprclass,
3312
3312
m.vrclass, m, constraint,
3313
- /* Commutable */ 0,
3313
+ sew, /* Commutable */ 0,
3314
3314
TargetConstraintType=3>;
3315
3315
}
3316
3316
@@ -3396,34 +3396,36 @@ multiclass VPseudoVWMAC_VX {
3396
3396
3397
3397
multiclass VPseudoVWMAC_VV_VF_RM {
3398
3398
foreach m = MxListFW in {
3399
- defm "" : VPseudoTernaryW_VV_RM<m>,
3400
- SchedTernary<"WriteVFWMulAddV", "ReadVFWMulAddV",
3401
- "ReadVFWMulAddV", "ReadVFWMulAddV", m.MX>;
3399
+ foreach e = SchedSEWSet<m.MX, isF=1, isWidening=1>.val in
3400
+ defm "" : VPseudoTernaryW_VV_RM<m, sew=e>,
3401
+ SchedTernary<"WriteVFWMulAddV", "ReadVFWMulAddV",
3402
+ "ReadVFWMulAddV", "ReadVFWMulAddV", m.MX, e>;
3402
3403
}
3403
3404
3404
3405
foreach f = FPListW in {
3405
3406
foreach m = f.MxListFW in {
3406
- defm "" : VPseudoTernaryW_VF_RM<m, f>,
3407
+ defm "" : VPseudoTernaryW_VF_RM<m, f, sew=f.SEW >,
3407
3408
SchedTernary<"WriteVFWMulAddF", "ReadVFWMulAddV",
3408
- "ReadVFWMulAddF", "ReadVFWMulAddV", m.MX>;
3409
+ "ReadVFWMulAddF", "ReadVFWMulAddV", m.MX, f.SEW >;
3409
3410
}
3410
3411
}
3411
3412
}
3412
3413
3413
3414
multiclass VPseudoVWMAC_VV_VF_BF_RM {
3414
3415
foreach m = MxListFW in {
3415
3416
defvar mx = m.MX;
3416
- defm "" : VPseudoTernaryW_VV_RM<m>,
3417
- SchedTernary<"WriteVFWMulAddV", "ReadVFWMulAddV",
3418
- "ReadVFWMulAddV", "ReadVFWMulAddV", mx>;
3417
+ foreach e = SchedSEWSet<mx, isF=1, isWidening=1>.val in
3418
+ defm "" : VPseudoTernaryW_VV_RM<m, sew=e>,
3419
+ SchedTernary<"WriteVFWMulAddV", "ReadVFWMulAddV",
3420
+ "ReadVFWMulAddV", "ReadVFWMulAddV", mx, e>;
3419
3421
}
3420
3422
3421
3423
foreach f = BFPListW in {
3422
3424
foreach m = f.MxListFW in {
3423
3425
defvar mx = m.MX;
3424
- defm "" : VPseudoTernaryW_VF_RM<m, f>,
3426
+ defm "" : VPseudoTernaryW_VF_RM<m, f, sew=f.SEW >,
3425
3427
SchedTernary<"WriteVFWMulAddF", "ReadVFWMulAddV",
3426
- "ReadVFWMulAddF", "ReadVFWMulAddV", mx>;
3428
+ "ReadVFWMulAddF", "ReadVFWMulAddV", mx, f.SEW >;
3427
3429
}
3428
3430
}
3429
3431
}
@@ -5703,7 +5705,7 @@ multiclass VPatTernaryW_VV<string intrinsic, string instruction,
5703
5705
}
5704
5706
5705
5707
multiclass VPatTernaryW_VV_RM<string intrinsic, string instruction,
5706
- list<VTypeInfoToWide> vtilist> {
5708
+ list<VTypeInfoToWide> vtilist, bit isSEWAware = 0 > {
5707
5709
foreach vtiToWti = vtilist in {
5708
5710
defvar vti = vtiToWti.Vti;
5709
5711
defvar wti = vtiToWti.Wti;
@@ -5712,7 +5714,8 @@ multiclass VPatTernaryW_VV_RM<string intrinsic, string instruction,
5712
5714
defm : VPatTernaryWithPolicyRoundingMode<intrinsic, instruction, "VV",
5713
5715
wti.Vector, vti.Vector, vti.Vector,
5714
5716
vti.Mask, vti.Log2SEW, vti.LMul,
5715
- wti.RegClass, vti.RegClass, vti.RegClass>;
5717
+ wti.RegClass, vti.RegClass,
5718
+ vti.RegClass, isSEWAware>;
5716
5719
}
5717
5720
}
5718
5721
@@ -5731,19 +5734,18 @@ multiclass VPatTernaryW_VX<string intrinsic, string instruction,
5731
5734
}
5732
5735
}
5733
5736
5734
- multiclass VPatTernaryW_VX_RM<string intrinsic, string instruction,
5735
- list<VTypeInfoToWide> vtilist> {
5737
+ multiclass
5738
+ VPatTernaryW_VX_RM<string intrinsic, string instruction,
5739
+ list<VTypeInfoToWide> vtilist, bit isSEWAware = 0> {
5736
5740
foreach vtiToWti = vtilist in {
5737
5741
defvar vti = vtiToWti.Vti;
5738
5742
defvar wti = vtiToWti.Wti;
5739
5743
let Predicates = !listconcat(GetVTypePredicates<vti>.Predicates,
5740
- GetVTypePredicates<wti>.Predicates) in
5741
- defm : VPatTernaryWithPolicyRoundingMode<intrinsic, instruction,
5742
- "V"#vti.ScalarSuffix,
5743
- wti.Vector, vti.Scalar, vti.Vector,
5744
- vti.Mask, vti.Log2SEW, vti.LMul,
5745
- wti.RegClass, vti.ScalarRegClass,
5746
- vti.RegClass>;
5744
+ GetVTypePredicates<wti>.Predicates) in defm
5745
+ : VPatTernaryWithPolicyRoundingMode<
5746
+ intrinsic, instruction, "V" #vti.ScalarSuffix, wti.Vector,
5747
+ vti.Scalar, vti.Vector, vti.Mask, vti.Log2SEW, vti.LMul,
5748
+ wti.RegClass, vti.ScalarRegClass, vti.RegClass, isSEWAware>;
5747
5749
}
5748
5750
}
5749
5751
@@ -5775,9 +5777,9 @@ multiclass VPatTernaryW_VV_VX<string intrinsic, string instruction,
5775
5777
VPatTernaryW_VX<intrinsic, instruction, vtilist>;
5776
5778
5777
5779
multiclass VPatTernaryW_VV_VX_RM<string intrinsic, string instruction,
5778
- list<VTypeInfoToWide> vtilist>
5779
- : VPatTernaryW_VV_RM<intrinsic, instruction, vtilist>,
5780
- VPatTernaryW_VX_RM<intrinsic, instruction, vtilist>;
5780
+ list<VTypeInfoToWide> vtilist, bit isSEWAware = 1 >
5781
+ : VPatTernaryW_VV_RM<intrinsic, instruction, vtilist, isSEWAware >,
5782
+ VPatTernaryW_VX_RM<intrinsic, instruction, vtilist, isSEWAware >;
5781
5783
5782
5784
multiclass VPatBinaryM_VV_VX<string intrinsic, string instruction,
5783
5785
list<VTypeInfo> vtilist>
@@ -7154,16 +7156,16 @@ defm : VPatTernaryV_VV_VX_AAXA_RM<"int_riscv_vfnmsub", "PseudoVFNMSUB",
7154
7156
// 13.7. Vector Widening Floating-Point Fused Multiply-Add Instructions
7155
7157
//===----------------------------------------------------------------------===//
7156
7158
defm : VPatTernaryW_VV_VX_RM<"int_riscv_vfwmacc", "PseudoVFWMACC",
7157
- AllWidenableFloatVectors>;
7159
+ AllWidenableFloatVectors, isSEWAware=1 >;
7158
7160
defm : VPatTernaryW_VV_VX_RM<"int_riscv_vfwnmacc", "PseudoVFWNMACC",
7159
- AllWidenableFloatVectors>;
7161
+ AllWidenableFloatVectors, isSEWAware=1 >;
7160
7162
defm : VPatTernaryW_VV_VX_RM<"int_riscv_vfwmsac", "PseudoVFWMSAC",
7161
- AllWidenableFloatVectors>;
7163
+ AllWidenableFloatVectors, isSEWAware=1 >;
7162
7164
defm : VPatTernaryW_VV_VX_RM<"int_riscv_vfwnmsac", "PseudoVFWNMSAC",
7163
- AllWidenableFloatVectors>;
7165
+ AllWidenableFloatVectors, isSEWAware=1 >;
7164
7166
let Predicates = [HasStdExtZvfbfwma] in
7165
7167
defm : VPatTernaryW_VV_VX_RM<"int_riscv_vfwmaccbf16", "PseudoVFWMACCBF16",
7166
- AllWidenableBFloatToFloatVectors>;
7168
+ AllWidenableBFloatToFloatVectors, isSEWAware=1 >;
7167
7169
7168
7170
//===----------------------------------------------------------------------===//
7169
7171
// 13.8. Vector Floating-Point Square-Root Instruction
0 commit comments