Skip to content

Commit f483229

Browse files
committed
[Fix] code review.
1 parent 93f28dd commit f483229

File tree

2 files changed

+19
-30
lines changed

2 files changed

+19
-30
lines changed

llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -344,17 +344,6 @@ static DecodeStatus DecodeVMV0RegisterClass(MCInst &Inst, uint32_t RegNo,
344344
return MCDisassembler::Success;
345345
}
346346

347-
static DecodeStatus DecodeVREvenRegisterClass(MCInst &Inst, uint32_t RegNo,
348-
uint64_t Address,
349-
const MCDisassembler *Decoder) {
350-
if (RegNo >= 32 || RegNo % 2)
351-
return MCDisassembler::Fail;
352-
353-
MCRegister Reg = RISCV::V0 + RegNo;
354-
Inst.addOperand(MCOperand::createReg(Reg));
355-
return MCDisassembler::Success;
356-
}
357-
358347
static DecodeStatus DecodeTRRegisterClass(MCInst &Inst, uint32_t RegNo,
359348
uint64_t Address,
360349
const MCDisassembler *Decoder) {

llvm/lib/Target/RISCV/RISCVInstrInfoXSMTVDot.td

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===-- RISCVInstrInfoXSMTVDot.td - SpacemiT Vector Dot Product ----*- tablegen -*-===//
1+
//===-- RISCVInstrInfoXSMTVDot.td --------------------------*- tablegen -*-===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
@@ -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 RVInstVDot<bits<2> sign, string opcodestr, string argstr>
63+
class RVInstSMTVDot<bits<2> 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;
@@ -77,7 +77,7 @@ class RVInstVDot<bits<2> sign, string opcodestr, string argstr>
7777
}
7878

7979
// Sliding-window vector dot product format.
80-
class RVInstVDotSlide<bits<2>funct2, bits<2> sign, string opcodestr, string argstr>
80+
class RVInstSMTVDotSlide<bits<2>funct2, bits<2> 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;
@@ -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 : RVInstVDot<SMT_VDot_SS.Value{1-0}, "smt.vmadot", "$vd, $vs1, $vs2">;
109-
def VMADOTU : RVInstVDot<SMT_VDot_UU.Value{1-0}, "smt.vmadotu", "$vd, $vs1, $vs2">;
110-
def VMADOTSU : RVInstVDot<SMT_VDot_SU.Value{1-0}, "smt.vmadotsu", "$vd, $vs1, $vs2">;
111-
def VMADOTUU : RVInstVDot<SMT_VDot_US.Value{1-0}, "smt.vmadotus", "$vd, $vs1, $vs2">;
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">;
112112

113113
//===----------------------------------------------------------------------===//
114114
// Sliding-window Vector Dot Product Instructions
@@ -125,17 +125,17 @@ def VMADOTUU : RVInstVDot<SMT_VDot_US.Value{1-0}, "smt.vmadotus", "$vd, $vs1, $v
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 : RVInstVDotSlide<SMT_VDot_Slide1.Value, SMT_VDot_SS.Value{1-0}, "smt.vmadot1", "$vd, $vs1, $vs2">;
129-
def VMADOT1U : RVInstVDotSlide<SMT_VDot_Slide1.Value, SMT_VDot_UU.Value{1-0}, "smt.vmadot1u", "$vd, $vs1, $vs2">;
130-
def VMADOT1SU : RVInstVDotSlide<SMT_VDot_Slide1.Value, SMT_VDot_SU.Value{1-0}, "smt.vmadot1su", "$vd, $vs1, $vs2">;
131-
def VMADOT1UU : RVInstVDotSlide<SMT_VDot_Slide1.Value, SMT_VDot_US.Value{1-0}, "smt.vmadot1us", "$vd, $vs1, $vs2">;
132-
def VMADOT2 : RVInstVDotSlide<SMT_VDot_Slide2.Value, SMT_VDot_SS.Value{1-0}, "smt.vmadot2", "$vd, $vs1, $vs2">;
133-
def VMADOT2U : RVInstVDotSlide<SMT_VDot_Slide2.Value, SMT_VDot_UU.Value{1-0}, "smt.vmadot2u", "$vd, $vs1, $vs2">;
134-
def VMADOT2SU : RVInstVDotSlide<SMT_VDot_Slide2.Value, SMT_VDot_SU.Value{1-0}, "smt.vmadot2su", "$vd, $vs1, $vs2">;
135-
def VMADOT2UU : RVInstVDotSlide<SMT_VDot_Slide2.Value, SMT_VDot_US.Value{1-0}, "smt.vmadot2us", "$vd, $vs1, $vs2">;
136-
def VMADOT3 : RVInstVDotSlide<SMT_VDot_Slide3.Value, SMT_VDot_SS.Value{1-0}, "smt.vmadot3", "$vd, $vs1, $vs2">;
137-
def VMADOT3U : RVInstVDotSlide<SMT_VDot_Slide3.Value, SMT_VDot_UU.Value{1-0}, "smt.vmadot3u", "$vd, $vs1, $vs2">;
138-
def VMADOT3SU : RVInstVDotSlide<SMT_VDot_Slide3.Value, SMT_VDot_SU.Value{1-0}, "smt.vmadot3su", "$vd, $vs1, $vs2">;
139-
def VMADOT3UU : RVInstVDotSlide<SMT_VDot_Slide3.Value, SMT_VDot_US.Value{1-0}, "smt.vmadot3us", "$vd, $vs1, $vs2">;
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">;
140140
}
141141
}

0 commit comments

Comments
 (0)