diff --git a/llvm/lib/Target/RISCV/RISCVInstrFormats.td b/llvm/lib/Target/RISCV/RISCVInstrFormats.td --- a/llvm/lib/Target/RISCV/RISCVInstrFormats.td +++ b/llvm/lib/Target/RISCV/RISCVInstrFormats.td @@ -224,10 +224,6 @@ // to build the decode table. field bits<32> SoftFail = 0; let Size = 4; - - bits<7> Opcode = 0; - - let Inst{6-0} = Opcode; } // Pseudo instructions @@ -289,7 +285,7 @@ let Inst{19-15} = rs1; let Inst{14-12} = funct3; let Inst{11-7} = rd; - let Opcode = opcode.Value; + let Inst{6-0} = opcode.Value; } class RVInstR4 funct2, bits<3> funct3, RISCVOpcode opcode, dag outs, @@ -306,7 +302,7 @@ let Inst{19-15} = rs1; let Inst{14-12} = funct3; let Inst{11-7} = rd; - let Opcode = opcode.Value; + let Inst{6-0} = opcode.Value; } class RVInstR4Frm funct2, RISCVOpcode opcode, dag outs, dag ins, @@ -324,7 +320,7 @@ let Inst{19-15} = rs1; let Inst{14-12} = frm; let Inst{11-7} = rd; - let Opcode = opcode.Value; + let Inst{6-0} = opcode.Value; } class RVInstRAtomic funct5, bit aq, bit rl, bits<3> funct3, @@ -342,7 +338,7 @@ let Inst{19-15} = rs1; let Inst{14-12} = funct3; let Inst{11-7} = rd; - let Opcode = opcode.Value; + let Inst{6-0} = opcode.Value; } class RVInstRFrm funct7, RISCVOpcode opcode, dag outs, dag ins, @@ -358,7 +354,7 @@ let Inst{19-15} = rs1; let Inst{14-12} = frm; let Inst{11-7} = rd; - let Opcode = opcode.Value; + let Inst{6-0} = opcode.Value; } class RVInstI funct3, RISCVOpcode opcode, dag outs, dag ins, @@ -372,7 +368,7 @@ let Inst{19-15} = rs1; let Inst{14-12} = funct3; let Inst{11-7} = rd; - let Opcode = opcode.Value; + let Inst{6-0} = opcode.Value; } class RVInstIShift imm11_7, bits<3> funct3, RISCVOpcode opcode, @@ -388,7 +384,7 @@ let Inst{19-15} = rs1; let Inst{14-12} = funct3; let Inst{11-7} = rd; - let Opcode = opcode.Value; + let Inst{6-0} = opcode.Value; } class RVInstIShiftW imm11_5, bits<3> funct3, RISCVOpcode opcode, @@ -403,7 +399,7 @@ let Inst{19-15} = rs1; let Inst{14-12} = funct3; let Inst{11-7} = rd; - let Opcode = opcode.Value; + let Inst{6-0} = opcode.Value; } class RVInstS funct3, RISCVOpcode opcode, dag outs, dag ins, @@ -418,7 +414,7 @@ let Inst{19-15} = rs1; let Inst{14-12} = funct3; let Inst{11-7} = imm12{4-0}; - let Opcode = opcode.Value; + let Inst{6-0} = opcode.Value; } class RVInstB funct3, RISCVOpcode opcode, dag outs, dag ins, @@ -435,7 +431,7 @@ let Inst{14-12} = funct3; let Inst{11-8} = imm12{3-0}; let Inst{7} = imm12{10}; - let Opcode = opcode.Value; + let Inst{6-0} = opcode.Value; } class RVInstU : RVInstVV { let Inst{26} = 0; - let Opcode = OPC_CUSTOM_0.Value; + let Inst{6-0} = OPC_CUSTOM_0.Value; let DecoderNamespace = "THeadV"; } @@ -45,7 +45,7 @@ string opcodestr, string argstr> : RVInstVX { let Inst{26} = 1; - let Opcode = OPC_CUSTOM_0.Value; + let Inst{6-0} = OPC_CUSTOM_0.Value; let DecoderNamespace = "THeadV"; } diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoZfa.td b/llvm/lib/Target/RISCV/RISCVInstrInfoZfa.td --- a/llvm/lib/Target/RISCV/RISCVInstrInfoZfa.td +++ b/llvm/lib/Target/RISCV/RISCVInstrInfoZfa.td @@ -65,7 +65,7 @@ let Inst{19-15} = imm; let Inst{14-12} = funct3; let Inst{11-7} = rd; - let Opcode = opcode.Value; + let Inst{6-0} = opcode.Value; } let hasSideEffects = 0, mayLoad = 0, mayStore = 0, mayRaiseFPException = 1, diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoZvk.td b/llvm/lib/Target/RISCV/RISCVInstrInfoZvk.td --- a/llvm/lib/Target/RISCV/RISCVInstrInfoZvk.td +++ b/llvm/lib/Target/RISCV/RISCVInstrInfoZvk.td @@ -36,7 +36,7 @@ let Inst{19-15} = imm{4-0}; let Inst{14-12} = OPIVI.Value; let Inst{11-7} = vd; - let Opcode = OPC_OP_V.Value; + let Inst{6-0} = OPC_OP_V.Value; let Uses = [VTYPE, VL]; let RVVConstraint = VMConstraint; @@ -54,20 +54,20 @@ // op vd, vs2, vs1 class PALUVVNoVm funct6, RISCVVFormat opv, string opcodestr> : VALUVVNoVm { - let Opcode = OPC_OP_P.Value; + let Inst{6-0} = OPC_OP_P.Value; } // op vd, vs2, imm, vm class PALUVINoVm funct6, string opcodestr, Operand optype = simm5> : VALUVINoVm { - let Opcode = OPC_OP_P.Value; + let Inst{6-0} = OPC_OP_P.Value; let Inst{14-12} = OPMVV.Value; } // op vd, vs2 (use vs1 as instruction encoding) class PALUVs2NoVm funct6, bits<5> vs1, RISCVVFormat opv, string opcodestr> : VALUVs2NoVm { - let Opcode = OPC_OP_P.Value; + let Inst{6-0} = OPC_OP_P.Value; } multiclass VAES_MV_V_S funct6_vv, bits<6> funct6_vs, bits<5> vs1, @@ -80,7 +80,7 @@ // to customize one for them. class VAESKF_MV_I funct6, string opcodestr, Operand optype> : VALUVINoVm { - let Opcode = OPC_OP_P.Value; + let Inst{6-0} = OPC_OP_P.Value; let Inst{14-12} = OPMVV.Value; } } // hasSideEffects = 0, mayLoad = 0, mayStore = 0