@@ -2213,11 +2213,13 @@ multiclass VPseudoTiedBinaryRoundingMode<VReg RetClass,
2213
2213
DAGOperand Op2Class,
2214
2214
LMULInfo MInfo,
2215
2215
string Constraint = "",
2216
+ int sew = 0,
2216
2217
int TargetConstraintType = 1> {
2218
+ defvar suffix = !if(sew, "_" # MInfo.MX # "_E" # sew, "_" # MInfo.MX);
2217
2219
let VLMul = MInfo.value in {
2218
- def "_" # MInfo.MX # "_TIED":
2220
+ def suffix # "_TIED":
2219
2221
VPseudoTiedBinaryNoMaskRoundingMode<RetClass, Op2Class, Constraint, TargetConstraintType>;
2220
- def "_" # MInfo.MX # "_MASK_TIED" :
2222
+ def suffix # "_MASK_TIED" :
2221
2223
VPseudoTiedBinaryMaskRoundingMode<RetClass, Op2Class, Constraint, TargetConstraintType>,
2222
2224
RISCVMaskedPseudo<MaskIdx=2>;
2223
2225
}
@@ -2334,9 +2336,9 @@ multiclass VPseudoBinaryW_VV<LMULInfo m> {
2334
2336
"@earlyclobber $rd", TargetConstraintType=3>;
2335
2337
}
2336
2338
2337
- multiclass VPseudoBinaryW_VV_RM<LMULInfo m> {
2339
+ multiclass VPseudoBinaryW_VV_RM<LMULInfo m, int sew = 0 > {
2338
2340
defm _VV : VPseudoBinaryRoundingMode<m.wvrclass, m.vrclass, m.vrclass, m,
2339
- "@earlyclobber $rd", UsesVXRM=0,
2341
+ "@earlyclobber $rd", sew, UsesVXRM=0,
2340
2342
TargetConstraintType=3>;
2341
2343
}
2342
2344
@@ -2356,10 +2358,10 @@ multiclass VPseudoBinaryW_VF<LMULInfo m, FPR_Info f> {
2356
2358
"@earlyclobber $rd">;
2357
2359
}
2358
2360
2359
- multiclass VPseudoBinaryW_VF_RM<LMULInfo m, FPR_Info f> {
2361
+ multiclass VPseudoBinaryW_VF_RM<LMULInfo m, FPR_Info f, int sew = 0 > {
2360
2362
defm "_V" # f.FX : VPseudoBinaryRoundingMode<m.wvrclass, m.vrclass,
2361
2363
f.fprclass, m,
2362
- "@earlyclobber $rd",
2364
+ "@earlyclobber $rd", sew,
2363
2365
UsesVXRM=0,
2364
2366
TargetConstraintType=3>;
2365
2367
}
@@ -2371,11 +2373,13 @@ multiclass VPseudoBinaryW_WV<LMULInfo m> {
2371
2373
"@earlyclobber $rd", TargetConstraintType=3>;
2372
2374
}
2373
2375
2374
- multiclass VPseudoBinaryW_WV_RM<LMULInfo m> {
2376
+ multiclass VPseudoBinaryW_WV_RM<LMULInfo m, int sew = 0 > {
2375
2377
defm _WV : VPseudoBinaryRoundingMode<m.wvrclass, m.wvrclass, m.vrclass, m,
2376
- "@earlyclobber $rd", UsesVXRM=0, TargetConstraintType=3>;
2378
+ "@earlyclobber $rd", sew, UsesVXRM = 0,
2379
+ TargetConstraintType = 3>;
2377
2380
defm _WV : VPseudoTiedBinaryRoundingMode<m.wvrclass, m.vrclass, m,
2378
- "@earlyclobber $rd", TargetConstraintType=3>;
2381
+ "@earlyclobber $rd", sew,
2382
+ TargetConstraintType = 3>;
2379
2383
}
2380
2384
2381
2385
multiclass VPseudoBinaryW_WX<LMULInfo m> {
@@ -2387,11 +2391,11 @@ multiclass VPseudoBinaryW_WF<LMULInfo m, FPR_Info f, int TargetConstraintType =
2387
2391
f.fprclass, m, /*Constraint*/ "", TargetConstraintType=TargetConstraintType>;
2388
2392
}
2389
2393
2390
- multiclass VPseudoBinaryW_WF_RM<LMULInfo m, FPR_Info f> {
2394
+ multiclass VPseudoBinaryW_WF_RM<LMULInfo m, FPR_Info f, int sew = 0 > {
2391
2395
defm "_W" # f.FX : VPseudoBinaryRoundingMode<m.wvrclass, m.wvrclass,
2392
2396
f.fprclass, m,
2393
2397
Constraint="",
2394
- sew=0 ,
2398
+ sew=sew ,
2395
2399
UsesVXRM=0,
2396
2400
TargetConstraintType=3>;
2397
2401
}
@@ -2979,16 +2983,17 @@ multiclass VPseudoVWMUL_VV_VX {
2979
2983
2980
2984
multiclass VPseudoVWMUL_VV_VF_RM {
2981
2985
foreach m = MxListFW in {
2982
- defm "" : VPseudoBinaryW_VV_RM<m>,
2986
+ foreach e = SchedSEWSet<m.MX, isF=1, isWidening=1>.val in
2987
+ defm "" : VPseudoBinaryW_VV_RM<m, sew=e>,
2983
2988
SchedBinary<"WriteVFWMulV", "ReadVFWMulV", "ReadVFWMulV", m.MX,
2984
- forceMergeOpRead=true>;
2989
+ e, forceMergeOpRead=true>;
2985
2990
}
2986
2991
2987
2992
foreach f = FPListW in {
2988
2993
foreach m = f.MxListFW in {
2989
- defm "" : VPseudoBinaryW_VF_RM<m, f>,
2994
+ defm "" : VPseudoBinaryW_VF_RM<m, f, sew=f.SEW >,
2990
2995
SchedBinary<"WriteVFWMulF", "ReadVFWMulV", "ReadVFWMulF", m.MX,
2991
- forceMergeOpRead=true>;
2996
+ f.SEW, forceMergeOpRead=true>;
2992
2997
}
2993
2998
}
2994
2999
}
@@ -3007,31 +3012,33 @@ multiclass VPseudoVWALU_WV_WX {
3007
3012
3008
3013
multiclass VPseudoVFWALU_VV_VF_RM {
3009
3014
foreach m = MxListFW in {
3010
- defm "" : VPseudoBinaryW_VV_RM<m>,
3011
- SchedBinary<"WriteVFWALUV", "ReadVFWALUV", "ReadVFWALUV", m.MX,
3012
- forceMergeOpRead=true>;
3015
+ foreach e = SchedSEWSet<m.MX, isF=1, isWidening=1>.val in
3016
+ defm "" : VPseudoBinaryW_VV_RM<m, sew=e>,
3017
+ SchedBinary<"WriteVFWALUV", "ReadVFWALUV", "ReadVFWALUV", m.MX,
3018
+ e, forceMergeOpRead=true>;
3013
3019
}
3014
3020
3015
3021
foreach f = FPListW in {
3016
3022
foreach m = f.MxListFW in {
3017
- defm "" : VPseudoBinaryW_VF_RM<m, f>,
3023
+ defm "" : VPseudoBinaryW_VF_RM<m, f, sew=f.SEW >,
3018
3024
SchedBinary<"WriteVFWALUF", "ReadVFWALUV", "ReadVFWALUF", m.MX,
3019
- forceMergeOpRead=true>;
3025
+ f.SEW, forceMergeOpRead=true>;
3020
3026
}
3021
3027
}
3022
3028
}
3023
3029
3024
3030
multiclass VPseudoVFWALU_WV_WF_RM {
3025
3031
foreach m = MxListFW in {
3026
- defm "" : VPseudoBinaryW_WV_RM<m>,
3027
- SchedBinary<"WriteVFWALUV", "ReadVFWALUV", "ReadVFWALUV", m.MX,
3028
- forceMergeOpRead=true>;
3032
+ foreach e = SchedSEWSet<m.MX, isF=1, isWidening=1>.val in
3033
+ defm "" : VPseudoBinaryW_WV_RM<m, sew=e>,
3034
+ SchedBinary<"WriteVFWALUV", "ReadVFWALUV", "ReadVFWALUV", m.MX,
3035
+ e, forceMergeOpRead=true>;
3029
3036
}
3030
3037
foreach f = FPListW in {
3031
3038
foreach m = f.MxListFW in {
3032
- defm "" : VPseudoBinaryW_WF_RM<m, f>,
3039
+ defm "" : VPseudoBinaryW_WF_RM<m, f, sew=f.SEW >,
3033
3040
SchedBinary<"WriteVFWALUF", "ReadVFWALUV", "ReadVFWALUF", m.MX,
3034
- forceMergeOpRead=true>;
3041
+ f.SEW, forceMergeOpRead=true>;
3035
3042
}
3036
3043
}
3037
3044
}
@@ -5028,13 +5035,16 @@ multiclass VPatBinaryW_VV<string intrinsic, string instruction,
5028
5035
}
5029
5036
5030
5037
multiclass VPatBinaryW_VV_RM<string intrinsic, string instruction,
5031
- list<VTypeInfoToWide> vtilist> {
5038
+ list<VTypeInfoToWide> vtilist, bit isSEWAware = 0 > {
5032
5039
foreach VtiToWti = vtilist in {
5033
5040
defvar Vti = VtiToWti.Vti;
5034
5041
defvar Wti = VtiToWti.Wti;
5042
+ defvar name = !if(isSEWAware,
5043
+ instruction # "_VV_" # Vti.LMul.MX # "_E" # Vti.SEW,
5044
+ instruction # "_VV_" # Vti.LMul.MX);
5035
5045
let Predicates = !listconcat(GetVTypePredicates<Vti>.Predicates,
5036
5046
GetVTypePredicates<Wti>.Predicates) in
5037
- defm : VPatBinaryRoundingMode<intrinsic, instruction # "_VV_" # Vti.LMul.MX ,
5047
+ defm : VPatBinaryRoundingMode<intrinsic, name ,
5038
5048
Wti.Vector, Vti.Vector, Vti.Vector, Vti.Mask,
5039
5049
Vti.Log2SEW, Wti.RegClass,
5040
5050
Vti.RegClass, Vti.RegClass>;
@@ -5057,14 +5067,17 @@ multiclass VPatBinaryW_VX<string intrinsic, string instruction,
5057
5067
}
5058
5068
5059
5069
multiclass VPatBinaryW_VX_RM<string intrinsic, string instruction,
5060
- list<VTypeInfoToWide> vtilist> {
5070
+ list<VTypeInfoToWide> vtilist, bit isSEWAware = 0 > {
5061
5071
foreach VtiToWti = vtilist in {
5062
5072
defvar Vti = VtiToWti.Vti;
5063
5073
defvar Wti = VtiToWti.Wti;
5064
5074
defvar kind = "V"#Vti.ScalarSuffix;
5075
+ defvar name = !if(isSEWAware,
5076
+ instruction#"_"#kind#"_"#Vti.LMul.MX # "_E" # Vti.SEW,
5077
+ instruction#"_"#kind#"_"#Vti.LMul.MX);
5065
5078
let Predicates = !listconcat(GetVTypePredicates<Vti>.Predicates,
5066
5079
GetVTypePredicates<Wti>.Predicates) in
5067
- defm : VPatBinaryRoundingMode<intrinsic, instruction#"_"#kind#"_"#Vti.LMul.MX ,
5080
+ defm : VPatBinaryRoundingMode<intrinsic, name ,
5068
5081
Wti.Vector, Vti.Vector, Vti.Scalar, Vti.Mask,
5069
5082
Vti.Log2SEW, Wti.RegClass,
5070
5083
Vti.RegClass, Vti.ScalarRegClass>;
@@ -5101,27 +5114,30 @@ multiclass VPatBinaryW_WV<string intrinsic, string instruction,
5101
5114
}
5102
5115
5103
5116
multiclass VPatBinaryW_WV_RM<string intrinsic, string instruction,
5104
- list<VTypeInfoToWide> vtilist> {
5117
+ list<VTypeInfoToWide> vtilist, bit isSEWAware = 0 > {
5105
5118
foreach VtiToWti = vtilist in {
5106
5119
defvar Vti = VtiToWti.Vti;
5107
5120
defvar Wti = VtiToWti.Wti;
5121
+ defvar name = !if(isSEWAware,
5122
+ instruction # "_WV_" # Vti.LMul.MX # "_E" # Vti.SEW,
5123
+ instruction # "_WV_" # Vti.LMul.MX);
5108
5124
let Predicates = !listconcat(GetVTypePredicates<Vti>.Predicates,
5109
5125
GetVTypePredicates<Wti>.Predicates) in {
5110
- def : VPatTiedBinaryNoMaskRoundingMode<intrinsic, instruction # "_WV_" # Vti.LMul.MX ,
5126
+ def : VPatTiedBinaryNoMaskRoundingMode<intrinsic, name ,
5111
5127
Wti.Vector, Vti.Vector,
5112
5128
Vti.Log2SEW, Wti.RegClass, Vti.RegClass>;
5113
- def : VPatBinaryNoMaskTURoundingMode<intrinsic, instruction # "_WV_" # Vti.LMul.MX ,
5129
+ def : VPatBinaryNoMaskTURoundingMode<intrinsic, name ,
5114
5130
Wti.Vector, Wti.Vector, Vti.Vector, Vti.Log2SEW,
5115
5131
Wti.RegClass, Wti.RegClass, Vti.RegClass>;
5116
5132
let AddedComplexity = 1 in {
5117
- def : VPatTiedBinaryNoMaskTURoundingMode<intrinsic, instruction # "_WV_" # Vti.LMul.MX ,
5133
+ def : VPatTiedBinaryNoMaskTURoundingMode<intrinsic, name ,
5118
5134
Wti.Vector, Vti.Vector,
5119
5135
Vti.Log2SEW, Wti.RegClass, Vti.RegClass>;
5120
- def : VPatTiedBinaryMaskRoundingMode<intrinsic, instruction # "_WV_" # Vti.LMul.MX ,
5136
+ def : VPatTiedBinaryMaskRoundingMode<intrinsic, name ,
5121
5137
Wti.Vector, Vti.Vector, Vti.Mask,
5122
5138
Vti.Log2SEW, Wti.RegClass, Vti.RegClass>;
5123
5139
}
5124
- def : VPatBinaryMaskTARoundingMode<intrinsic, instruction # "_WV_" # Vti.LMul.MX ,
5140
+ def : VPatBinaryMaskTARoundingMode<intrinsic, name ,
5125
5141
Wti.Vector, Wti.Vector, Vti.Vector, Vti.Mask,
5126
5142
Vti.Log2SEW, Wti.RegClass,
5127
5143
Wti.RegClass, Vti.RegClass>;
@@ -5145,14 +5161,17 @@ multiclass VPatBinaryW_WX<string intrinsic, string instruction,
5145
5161
}
5146
5162
5147
5163
multiclass VPatBinaryW_WX_RM<string intrinsic, string instruction,
5148
- list<VTypeInfoToWide> vtilist> {
5164
+ list<VTypeInfoToWide> vtilist, bit isSEWAware = 0 > {
5149
5165
foreach VtiToWti = vtilist in {
5150
5166
defvar Vti = VtiToWti.Vti;
5151
5167
defvar Wti = VtiToWti.Wti;
5152
5168
defvar kind = "W"#Vti.ScalarSuffix;
5169
+ defvar name = !if(isSEWAware,
5170
+ instruction#"_"#kind#"_"#Vti.LMul.MX#"_E"#Vti.SEW,
5171
+ instruction#"_"#kind#"_"#Vti.LMul.MX);
5153
5172
let Predicates = !listconcat(GetVTypePredicates<Vti>.Predicates,
5154
5173
GetVTypePredicates<Wti>.Predicates) in
5155
- defm : VPatBinaryRoundingMode<intrinsic, instruction#"_"#kind#"_"#Vti.LMul.MX ,
5174
+ defm : VPatBinaryRoundingMode<intrinsic, name ,
5156
5175
Wti.Vector, Wti.Vector, Vti.Scalar, Vti.Mask,
5157
5176
Vti.Log2SEW, Wti.RegClass,
5158
5177
Wti.RegClass, Vti.ScalarRegClass>;
@@ -5417,20 +5436,22 @@ multiclass VPatBinaryW_VV_VX<string intrinsic, string instruction,
5417
5436
: VPatBinaryW_VV<intrinsic, instruction, vtilist>,
5418
5437
VPatBinaryW_VX<intrinsic, instruction, vtilist>;
5419
5438
5420
- multiclass VPatBinaryW_VV_VX_RM<string intrinsic, string instruction,
5421
- list<VTypeInfoToWide> vtilist>
5422
- : VPatBinaryW_VV_RM<intrinsic, instruction, vtilist>,
5423
- VPatBinaryW_VX_RM<intrinsic, instruction, vtilist>;
5439
+ multiclass
5440
+ VPatBinaryW_VV_VX_RM<string intrinsic, string instruction,
5441
+ list<VTypeInfoToWide> vtilist, bit isSEWAware = 0>
5442
+ : VPatBinaryW_VV_RM<intrinsic, instruction, vtilist, isSEWAware>,
5443
+ VPatBinaryW_VX_RM<intrinsic, instruction, vtilist, isSEWAware>;
5424
5444
5425
5445
multiclass VPatBinaryW_WV_WX<string intrinsic, string instruction,
5426
5446
list<VTypeInfoToWide> vtilist>
5427
5447
: VPatBinaryW_WV<intrinsic, instruction, vtilist>,
5428
5448
VPatBinaryW_WX<intrinsic, instruction, vtilist>;
5429
5449
5430
- multiclass VPatBinaryW_WV_WX_RM<string intrinsic, string instruction,
5431
- list<VTypeInfoToWide> vtilist>
5432
- : VPatBinaryW_WV_RM<intrinsic, instruction, vtilist>,
5433
- VPatBinaryW_WX_RM<intrinsic, instruction, vtilist>;
5450
+ multiclass
5451
+ VPatBinaryW_WV_WX_RM<string intrinsic, string instruction,
5452
+ list<VTypeInfoToWide> vtilist, bit isSEWAware = 0>
5453
+ : VPatBinaryW_WV_RM<intrinsic, instruction, vtilist, isSEWAware>,
5454
+ VPatBinaryW_WX_RM<intrinsic, instruction, vtilist, isSEWAware>;
5434
5455
5435
5456
multiclass VPatBinaryV_WV_WX_WI<string intrinsic, string instruction,
5436
5457
list<VTypeInfoToWide> vtilist>
@@ -7073,13 +7094,13 @@ defm : VPatBinaryV_VX_RM<"int_riscv_vfrsub", "PseudoVFRSUB", AllFloatVectors,
7073
7094
// 13.3. Vector Widening Floating-Point Add/Subtract Instructions
7074
7095
//===----------------------------------------------------------------------===//
7075
7096
defm : VPatBinaryW_VV_VX_RM<"int_riscv_vfwadd", "PseudoVFWADD",
7076
- AllWidenableFloatVectors>;
7097
+ AllWidenableFloatVectors, isSEWAware=1 >;
7077
7098
defm : VPatBinaryW_VV_VX_RM<"int_riscv_vfwsub", "PseudoVFWSUB",
7078
- AllWidenableFloatVectors>;
7099
+ AllWidenableFloatVectors, isSEWAware=1 >;
7079
7100
defm : VPatBinaryW_WV_WX_RM<"int_riscv_vfwadd_w", "PseudoVFWADD",
7080
- AllWidenableFloatVectors>;
7101
+ AllWidenableFloatVectors, isSEWAware=1 >;
7081
7102
defm : VPatBinaryW_WV_WX_RM<"int_riscv_vfwsub_w", "PseudoVFWSUB",
7082
- AllWidenableFloatVectors>;
7103
+ AllWidenableFloatVectors, isSEWAware=1 >;
7083
7104
7084
7105
//===----------------------------------------------------------------------===//
7085
7106
// 13.4. Vector Single-Width Floating-Point Multiply/Divide Instructions
@@ -7095,7 +7116,7 @@ defm : VPatBinaryV_VX_RM<"int_riscv_vfrdiv", "PseudoVFRDIV",
7095
7116
// 13.5. Vector Widening Floating-Point Multiply
7096
7117
//===----------------------------------------------------------------------===//
7097
7118
defm : VPatBinaryW_VV_VX_RM<"int_riscv_vfwmul", "PseudoVFWMUL",
7098
- AllWidenableFloatVectors>;
7119
+ AllWidenableFloatVectors, isSEWAware=1 >;
7099
7120
7100
7121
//===----------------------------------------------------------------------===//
7101
7122
// 13.6. Vector Single-Width Floating-Point Fused Multiply-Add Instructions
0 commit comments