Skip to content

Commit b9e6ec8

Browse files
committed
[Refactor] Replace explicit .Value with type-safe SMTVEncoding2 param.
1 parent 0c7a92a commit b9e6ec8

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

llvm/lib/Target/RISCV/RISCVInstrInfoXSMTVDot.td

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def SMT_VDot_Slide3 : SMTVEncoding2<0b10>;
6060

6161
let hasSideEffects = 0, mayLoad = 0, mayStore = 0 in {
6262
// Base vector dot product (no slide) format.
63-
class RVInstSMTVDot<bits<2> sign, string opcodestr, string argstr>
63+
class RVInstSMTVDot<SMTVEncoding2 sign, string opcodestr, string argstr>
6464
: RVInst<(outs VR:$vd), (ins VR:$vs1, VR:$vs2), opcodestr, argstr, [], InstFormatR> {
6565
bits<5> vd;
6666
bits<5> vs1;
@@ -70,14 +70,14 @@ class RVInstSMTVDot<bits<2> sign, string opcodestr, string argstr>
7070
let Inst{24-20} = vs2;
7171
let Inst{19-15} = vs1;
7272
let Inst{14} = 0b0;
73-
let Inst{13-12} = sign;
73+
let Inst{13-12} = sign.Value;
7474
let Inst{11-8} = vd{4-1};
7575
let Inst{7} = 0b0;
7676
let Inst{6-0} = OPC_CUSTOM_1.Value;
7777
}
7878

7979
// Sliding-window vector dot product format.
80-
class RVInstSMTVDotSlide<bits<2> funct2, bits<2> sign, string opcodestr, string argstr>
80+
class RVInstSMTVDotSlide<SMTVEncoding2 funct2, SMTVEncoding2 sign, string opcodestr, string argstr>
8181
: RVInst<(outs VR:$vd), (ins VR:$vs1, VR:$vs2), opcodestr, argstr, [], InstFormatR> {
8282
bits<5> vd;
8383
bits<5> vs1;
@@ -86,8 +86,8 @@ class RVInstSMTVDotSlide<bits<2> funct2, bits<2> sign, string opcodestr, string
8686
let Inst{31-25} = OPMMA_SLIDE.Value;
8787
let Inst{24-20} = vs2;
8888
let Inst{19-16} = vs1{4-1};
89-
let Inst{15-14} = funct2;
90-
let Inst{13-12} = sign;
89+
let Inst{15-14} = funct2.Value;
90+
let Inst{13-12} = sign.Value;
9191
let Inst{11-8} = vd{4-1};
9292
let Inst{7} = 0b0;
9393
let Inst{6-0} = OPC_CUSTOM_1.Value;
@@ -105,10 +105,10 @@ let Predicates = [HasVendorXSMTVDot] in {
105105
// NOTE: Destination registers (vd) MUST be even-numbered (v0, v2, ..., v30)
106106
// due to hardware alignment constraints. Using odd registers may cause undefined behavior.
107107
// TODO: Enforce even-numbered vd.
108-
def VMADOT : RVInstSMTVDot<SMT_VDot_SS.Value, "smt.vmadot", "$vd, $vs1, $vs2">;
109-
def VMADOTU : RVInstSMTVDot<SMT_VDot_UU.Value, "smt.vmadotu", "$vd, $vs1, $vs2">;
110-
def VMADOTSU : RVInstSMTVDot<SMT_VDot_SU.Value, "smt.vmadotsu", "$vd, $vs1, $vs2">;
111-
def VMADOTUU : RVInstSMTVDot<SMT_VDot_US.Value, "smt.vmadotus", "$vd, $vs1, $vs2">;
108+
def VMADOT : RVInstSMTVDot<SMT_VDot_SS, "smt.vmadot", "$vd, $vs1, $vs2">;
109+
def VMADOTU : RVInstSMTVDot<SMT_VDot_UU, "smt.vmadotu", "$vd, $vs1, $vs2">;
110+
def VMADOTSU : RVInstSMTVDot<SMT_VDot_SU, "smt.vmadotsu", "$vd, $vs1, $vs2">;
111+
def VMADOTUU : RVInstSMTVDot<SMT_VDot_US, "smt.vmadotus", "$vd, $vs1, $vs2">;
112112

113113
//===----------------------------------------------------------------------===//
114114
// Sliding-window Vector Dot Product Instructions
@@ -125,17 +125,17 @@ def VMADOTUU : RVInstSMTVDot<SMT_VDot_US.Value, "smt.vmadotus", "$vd, $vs1, $vs2
125125
// even-numbered (v0, v2, ..., v30) due to hardware alignment constraints.
126126
// Using odd registers may cause undefined behavior.
127127
// TODO: Enforce even-numbered vd.
128-
def VMADOT1 : RVInstSMTVDotSlide<SMT_VDot_Slide1.Value, SMT_VDot_SS.Value, "smt.vmadot1", "$vd, $vs1, $vs2">;
129-
def VMADOT1U : RVInstSMTVDotSlide<SMT_VDot_Slide1.Value, SMT_VDot_UU.Value, "smt.vmadot1u", "$vd, $vs1, $vs2">;
130-
def VMADOT1SU : RVInstSMTVDotSlide<SMT_VDot_Slide1.Value, SMT_VDot_SU.Value, "smt.vmadot1su", "$vd, $vs1, $vs2">;
131-
def VMADOT1UU : RVInstSMTVDotSlide<SMT_VDot_Slide1.Value, SMT_VDot_US.Value, "smt.vmadot1us", "$vd, $vs1, $vs2">;
132-
def VMADOT2 : RVInstSMTVDotSlide<SMT_VDot_Slide2.Value, SMT_VDot_SS.Value, "smt.vmadot2", "$vd, $vs1, $vs2">;
133-
def VMADOT2U : RVInstSMTVDotSlide<SMT_VDot_Slide2.Value, SMT_VDot_UU.Value, "smt.vmadot2u", "$vd, $vs1, $vs2">;
134-
def VMADOT2SU : RVInstSMTVDotSlide<SMT_VDot_Slide2.Value, SMT_VDot_SU.Value, "smt.vmadot2su", "$vd, $vs1, $vs2">;
135-
def VMADOT2UU : RVInstSMTVDotSlide<SMT_VDot_Slide2.Value, SMT_VDot_US.Value, "smt.vmadot2us", "$vd, $vs1, $vs2">;
136-
def VMADOT3 : RVInstSMTVDotSlide<SMT_VDot_Slide3.Value, SMT_VDot_SS.Value, "smt.vmadot3", "$vd, $vs1, $vs2">;
137-
def VMADOT3U : RVInstSMTVDotSlide<SMT_VDot_Slide3.Value, SMT_VDot_UU.Value, "smt.vmadot3u", "$vd, $vs1, $vs2">;
138-
def VMADOT3SU : RVInstSMTVDotSlide<SMT_VDot_Slide3.Value, SMT_VDot_SU.Value, "smt.vmadot3su", "$vd, $vs1, $vs2">;
139-
def VMADOT3UU : RVInstSMTVDotSlide<SMT_VDot_Slide3.Value, SMT_VDot_US.Value, "smt.vmadot3us", "$vd, $vs1, $vs2">;
128+
def VMADOT1 : RVInstSMTVDotSlide<SMT_VDot_Slide1, SMT_VDot_SS, "smt.vmadot1", "$vd, $vs1, $vs2">;
129+
def VMADOT1U : RVInstSMTVDotSlide<SMT_VDot_Slide1, SMT_VDot_UU, "smt.vmadot1u", "$vd, $vs1, $vs2">;
130+
def VMADOT1SU : RVInstSMTVDotSlide<SMT_VDot_Slide1, SMT_VDot_SU, "smt.vmadot1su", "$vd, $vs1, $vs2">;
131+
def VMADOT1UU : RVInstSMTVDotSlide<SMT_VDot_Slide1, SMT_VDot_US, "smt.vmadot1us", "$vd, $vs1, $vs2">;
132+
def VMADOT2 : RVInstSMTVDotSlide<SMT_VDot_Slide2, SMT_VDot_SS, "smt.vmadot2", "$vd, $vs1, $vs2">;
133+
def VMADOT2U : RVInstSMTVDotSlide<SMT_VDot_Slide2, SMT_VDot_UU, "smt.vmadot2u", "$vd, $vs1, $vs2">;
134+
def VMADOT2SU : RVInstSMTVDotSlide<SMT_VDot_Slide2, SMT_VDot_SU, "smt.vmadot2su", "$vd, $vs1, $vs2">;
135+
def VMADOT2UU : RVInstSMTVDotSlide<SMT_VDot_Slide2, SMT_VDot_US, "smt.vmadot2us", "$vd, $vs1, $vs2">;
136+
def VMADOT3 : RVInstSMTVDotSlide<SMT_VDot_Slide3, SMT_VDot_SS, "smt.vmadot3", "$vd, $vs1, $vs2">;
137+
def VMADOT3U : RVInstSMTVDotSlide<SMT_VDot_Slide3, SMT_VDot_UU, "smt.vmadot3u", "$vd, $vs1, $vs2">;
138+
def VMADOT3SU : RVInstSMTVDotSlide<SMT_VDot_Slide3, SMT_VDot_SU, "smt.vmadot3su", "$vd, $vs1, $vs2">;
139+
def VMADOT3UU : RVInstSMTVDotSlide<SMT_VDot_Slide3, SMT_VDot_US, "smt.vmadot3us", "$vd, $vs1, $vs2">;
140140
}
141141
}

0 commit comments

Comments
 (0)