@@ -74,6 +74,7 @@ class CVInstMac<bits<7> funct7, bits<3> funct3, string opcodestr>
7474 : RVInstR<funct7, funct3, OPC_CUSTOM_1,
7575 (outs GPR:$rd_wb), (ins GPR:$rd, GPR:$rs1, GPR:$rs2),
7676 opcodestr, "$rd, $rs1, $rs2"> {
77+ let Constraints = "$rd = $rd_wb";
7778 let DecoderNamespace = "XCV";
7879}
7980
@@ -90,14 +91,16 @@ class CVInstMacMulN<bits<2> funct2, bits<3> funct3, dag outs, dag ins,
9091
9192class CVInstMacN<bits<2> funct2, bits<3> funct3, string opcodestr>
9293 : CVInstMacMulN<funct2, funct3, (outs GPR:$rd_wb),
93- (ins GPR:$rd, GPR:$rs1, GPR:$rs2, uimm5:$imm5), opcodestr>;
94+ (ins GPR:$rd, GPR:$rs1, GPR:$rs2, uimm5:$imm5), opcodestr> {
95+ let Constraints = "$rd = $rd_wb";
96+ }
9497
9598class CVInstMulN<bits<2> funct2, bits<3> funct3, string opcodestr>
9699 : CVInstMacMulN<funct2, funct3, (outs GPR:$rd),
97100 (ins GPR:$rs1, GPR:$rs2, uimm5:$imm5), opcodestr>;
98101
99102let Predicates = [HasVendorXCVmac, IsRV32], hasSideEffects = 0, mayLoad = 0,
100- mayStore = 0, Constraints = "$rd = $rd_wb" in {
103+ mayStore = 0 in {
101104 // 32x32 bit macs
102105 def CV_MAC : CVInstMac<0b1001000, 0b011, "cv.mac">,
103106 Sched<[]>;
@@ -179,7 +182,9 @@ let DecoderNamespace = "XCV" in {
179182
180183 class CVInstAluRRNR<bits<7> funct7, bits<3> funct3, string opcodestr>
181184 : RVInstR<funct7, funct3, OPC_CUSTOM_1, (outs GPR:$rd_wb),
182- (ins GPR:$rd, GPR:$rs1, GPR:$rs2), opcodestr, "$rd, $rs1, $rs2">;
185+ (ins GPR:$rd, GPR:$rs1, GPR:$rs2), opcodestr, "$rd, $rs1, $rs2"> {
186+ let Constraints = "$rd = $rd_wb";
187+ }
183188
184189 class CVInstAluRI<bits<7> funct7, bits<3> funct3, string opcodestr>
185190 : RVInstIBase<funct3, OPC_CUSTOM_1, (outs GPR:$rd),
@@ -254,8 +259,7 @@ let Predicates = [HasVendorXCValu, IsRV32],
254259 // hasSideEffects = 0, mayLoad = 0, mayStore = 0
255260
256261let Predicates = [HasVendorXCValu, IsRV32],
257- hasSideEffects = 0, mayLoad = 0, mayStore = 0,
258- Constraints = "$rd = $rd_wb" in {
262+ hasSideEffects = 0, mayLoad = 0, mayStore = 0 in {
259263 def CV_ADDNR : CVInstAluRRNR<0b1000000, 0b011, "cv.addnr">,
260264 Sched<[]>;
261265 def CV_ADDUNR : CVInstAluRRNR<0b1000001, 0b011, "cv.addunr">,
@@ -275,7 +279,6 @@ let Predicates = [HasVendorXCValu, IsRV32],
275279
276280} // Predicates = [HasVendorXCValu, IsRV32],
277281 // hasSideEffects = 0, mayLoad = 0, mayStore = 0,
278- // Constraints = "$rd = $rd_wb"
279282
280283let Predicates = [HasVendorXCValu, IsRV32] in {
281284 def : MnemonicAlias<"cv.slet", "cv.sle">;
0 commit comments