Skip to content

Commit 794e485

Browse files
committed
[HW] Modified mcfg instructions
1 parent 0dbde54 commit 794e485

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

llvm/lib/Target/RISCV/RISCVInstrInfoXTHead.td

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,31 +79,31 @@ class RVMLoadStore<bits<1> matrix, bits<3> ldst, bits<2> size, dag outs, dag ins
7979
let Inst{6-0} = OPC_CUSTOM_0.Value;
8080
}
8181

82-
class RVMConfig<bits<3> funct3_h, dag outs, dag ins, string opcodestr, string argstr>
82+
class RVMConfigK<bits<3> funct3_h, dag outs, dag ins, string opcodestr, string argstr>
8383
: RVInst<outs, ins, opcodestr, argstr, [], InstFormatOther> {
8484
bits<5> rs1;
8585
bits<5> rd;
8686

8787
let Inst{31} = 0b0;
8888
let Inst{30-28} = funct3_h;
89-
let Inst{27-23} = 0b11100;
89+
let Inst{27-22} = 0b111000;
9090
let Inst{19-15} = rs1;
9191
let Inst{14-12} = 0b000;
9292
let Inst{11-7} = rd;
9393
let Inst{6-0} = OPC_CUSTOM_0.Value;
9494
}
9595

96-
class RVMConfigK<bits<3> funct3_h, dag outs, dag ins, string opcodestr, string argstr>
97-
: RVMConfig<funct3_h, outs, ins, opcodestr, argstr> {
98-
bits<3> imm3;
99-
let Inst{22-20} = imm3;
96+
class RVMConfig<bits<3> funct3_h, dag outs, dag ins, string opcodestr, string argstr>
97+
: RVMConfigK<funct3_h, outs, ins, opcodestr, argstr> {
98+
bits<2> imm2;
99+
let Inst{21-20} = imm2{1-0};
100100
}
101101

102102
let Predicates = [HasVendorXTHeadMatrix], DecoderNamespace = "XTHeadMatrix",hasSideEffects = 0, mayLoad = 0, mayStore = 0 in {
103103
let hasSideEffects = 1 in {
104-
def MCFGK : RVMConfigK<0b000, (outs GPR:$rd), (ins GPR:$rs1, uimm3:$imm3), "mcfgk", "$rd, $rs1, $imm3">;
105-
def MCFGM : RVMConfig<0b001, (outs GPR:$rd), (ins GPR:$rs1), "mcfgm", "$rd, $rs1">;
106-
def MCFGN : RVMConfig<0b010, (outs GPR:$rd), (ins GPR:$rs1), "mcfgn", "$rd, $rs1">;
104+
def MCFGK : RVMConfigK<0b000, (outs GPR:$rd), (ins GPR:$rs1 ), "mcfgk", "$rd, $rs1">;
105+
def MCFGM : RVMConfig <0b001, (outs GPR:$rd), (ins GPR:$rs1, uimm2:$imm2), "mcfgm", "$rd, $rs1, $imm2">;
106+
def MCFGN : RVMConfig <0b010, (outs GPR:$rd), (ins GPR:$rs1, uimm2:$imm2), "mcfgn", "$rd, $rs1, $imm2">;
107107
}
108108
def FMMACC_B : RVMArith<0b0001, 0b00000, (outs ACC:$md), (ins MR:$ms1, MR:$ms2), "fmmacc.b", "$md, $ms2, $ms1">;
109109
def FMMACC_H : RVMArith<0b0001, 0b01000, (outs ACC:$md), (ins MR:$ms1, MR:$ms2), "fmmacc.h", "$md, $ms2, $ms1">;

0 commit comments

Comments
 (0)