Skip to content

Commit 6efc6f1

Browse files
committed
fixup! Recommit [RISCV] Update the interface of sifive vqmaccqoq (llvm#74284)
1 parent 07cd8ad commit 6efc6f1

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

llvm/lib/Target/RISCV/RISCVInstrInfoXSf.td

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -358,15 +358,14 @@ multiclass VPseudoSiFiveVQMACCDOD<string Constraint = ""> {
358358
multiclass VPseudoSiFiveVQMACCQOQ<string Constraint = ""> {
359359
foreach i = [0, 1, 2, 3] in
360360
let VLMul = MxListVF4[i].value in
361-
defm NAME : VPseudoSiFiveVMACC<MxListVF8[i].MX, MxListVF8[i].vrclass,
361+
defm NAME : VPseudoSiFiveVMACC<MxListVF4[i].MX, MxListVF8[i].vrclass,
362362
MxListVF4[i].vrclass, Constraint>;
363363
}
364364

365365
multiclass VPseudoSiFiveVFWMACC<string Constraint = ""> {
366-
foreach i = [0, 1, 2, 3, 4] in
367-
let VLMul = MxListVF2[i].value in
368-
defm NAME : VPseudoSiFiveVMACC<MxListVF4[i].MX, MxListFW[i].wvrclass,
369-
MxListFW[i].vrclass, Constraint>;
366+
foreach m = MxListVF2 in
367+
let VLMul = m.value in
368+
defm NAME : VPseudoSiFiveVMACC<m.MX, m.wvrclass, m.vrclass, Constraint>;
370369
}
371370

372371
multiclass VPseudoSiFiveVFNRCLIP<string Constraint = "@earlyclobber $rd"> {
@@ -561,15 +560,17 @@ class GetFTypeInfo<int Sew> {
561560
}
562561

563562
multiclass VPatVMACC<string intrinsic, string instruction, string kind,
564-
list<VTypeInfoToWide> info_pairs, ValueType vec_m1> {
563+
list<VTypeInfoToWide> info_pairs, ValueType vec_m1,
564+
bit lmul_follows_vd = 0> {
565565
foreach pair = info_pairs in {
566566
defvar VdInfo = pair.Wti;
567567
defvar Vs2Info = pair.Vti;
568+
defvar LMul = !if(!eq(lmul_follows_vd, 1), VdInfo.LMul, Vs2Info.LMul);
568569
let Predicates = [HasVInstructions] in
569570
def : VPatTernaryNoMaskWithPolicy<"int_riscv_sf_" # intrinsic,
570571
"Pseudo" # instruction, kind, VdInfo.Vector,
571572
vec_m1, Vs2Info.Vector,
572-
Vs2Info.Log2SEW, VdInfo.LMul,
573+
Vs2Info.Log2SEW, LMul,
573574
VdInfo.RegClass, VR, Vs2Info.RegClass>;
574575
}
575576
}
@@ -589,7 +590,7 @@ defset list<VTypeInfoToWide> VQMACCQOQInfoPairs = {
589590
}
590591

591592
multiclass VPatVQMACCDOD<string intrinsic, string instruction, string kind>
592-
: VPatVMACC<intrinsic, instruction, kind, VQMACCDODInfoPairs, vint8m1_t>;
593+
: VPatVMACC<intrinsic, instruction, kind, VQMACCDODInfoPairs, vint8m1_t, 1>;
593594

594595
multiclass VPatVQMACCQOQ<string intrinsic, string instruction, string kind>
595596
: VPatVMACC<intrinsic, instruction, kind, VQMACCQOQInfoPairs, vint8m1_t>;

0 commit comments

Comments
 (0)