Index: lib/Target/Mips/Disassembler/MipsDisassembler.cpp =================================================================== --- lib/Target/Mips/Disassembler/MipsDisassembler.cpp +++ lib/Target/Mips/Disassembler/MipsDisassembler.cpp @@ -448,6 +448,16 @@ DecodeBlezGroupBranch(MCInst &MI, InsnType insn, uint64_t Address, const void *Decoder); +template +static DecodeStatus +DecodeBgtzGroupBranchMMR6(MCInst &MI, InsnType insn, uint64_t Address, + const void *Decoder); + +template +static DecodeStatus +DecodeBlezGroupBranchMMR6(MCInst &MI, InsnType insn, uint64_t Address, + const void *Decoder); + static DecodeStatus DecodeRegListOperand(MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder); @@ -2070,3 +2080,89 @@ Inst.addOperand(MCOperand::createImm(SignExtend32<25>(Insn << 2))); return MCDisassembler::Success; } + +template +static DecodeStatus DecodeBgtzGroupBranchMMR6(MCInst &MI, InsnType insn, + uint64_t Address, + const void *Decoder) { + // We have: + // 0b000111 ttttt sssss iiiiiiiiiiiiiiii + // Invalid if rt == 0 + // BGTZALC_MMR6 if rs == 0 && rt != 0 + // BLTZALC_MMR6 if rs != 0 && rs == rt + // BLTUC_MMR6 if rs != 0 && rs != rt + + InsnType Rt = fieldFromInstruction(insn, 21, 5); + InsnType Rs = fieldFromInstruction(insn, 16, 5); + InsnType Imm = SignExtend64(fieldFromInstruction(insn, 0, 16), 16) * 2; + bool HasRs = false; + bool HasRt = false; + + if (Rt == 0) { + return MCDisassembler::Fail; + } + else if (Rs == 0) { + MI.setOpcode(Mips::BGTZALC_MMR6); + HasRt = true; + } + else if (Rs == Rt) { + MI.setOpcode(Mips::BLTZALC_MMR6); + HasRs = true; + } + else { + MI.setOpcode(Mips::BLTUC_MMR6); + HasRs = true; + HasRt = true; + } + + if (HasRs) + MI.addOperand(MCOperand::createReg(getReg(Decoder, Mips::GPR32RegClassID, + Rs))); + + if (HasRt) + MI.addOperand(MCOperand::createReg(getReg(Decoder, Mips::GPR32RegClassID, + Rt))); + + MI.addOperand(MCOperand::createImm(Imm)); + + return MCDisassembler::Success; +} + + +template +static DecodeStatus DecodeBlezGroupBranchMMR6(MCInst &MI, InsnType insn, + uint64_t Address, + const void *Decoder) { + // We have: + // 0b000110 ttttt sssss iiiiiiiiiiiiiiii + // Invalid if rs == 0 + // BLEZALC_MMR6 if rs == 0 && rt != 0 + // BGEZALC_MMR6 if rs == rt && rt != 0 + // BGEUC_MMR6 if rs != rt && rs != 0 && rt != 0 + + InsnType Rt = fieldFromInstruction(insn, 21, 5); + InsnType Rs = fieldFromInstruction(insn, 16, 5); + InsnType Imm = SignExtend64(fieldFromInstruction(insn, 0, 16), 16) * 2; + bool HasRs = false; + + if (Rt == 0) + return MCDisassembler::Fail; + else if (Rs == 0) + MI.setOpcode(Mips::BLEZALC_MMR6); + else if (Rs == Rt) + MI.setOpcode(Mips::BGEZALC_MMR6); + else { + HasRs = true; + MI.setOpcode(Mips::BGEUC_MMR6); + } + + if (HasRs) + MI.addOperand(MCOperand::createReg(getReg(Decoder, Mips::GPR32RegClassID, + Rs))); + MI.addOperand(MCOperand::createReg(getReg(Decoder, Mips::GPR32RegClassID, + Rt))); + + MI.addOperand(MCOperand::createImm(Imm)); + + return MCDisassembler::Success; +} Index: lib/Target/Mips/MicroMips32r6InstrFormats.td =================================================================== --- lib/Target/Mips/MicroMips32r6InstrFormats.td +++ lib/Target/Mips/MicroMips32r6InstrFormats.td @@ -14,6 +14,19 @@ class MMR6Arch { string Arch = "micromipsr6"; string BaseOpcode = opstr; + string DecoderNamespace = "MicroMipsR6"; +} + +//===----------------------------------------------------------------------===// +// +// Disambiguators +// +//===----------------------------------------------------------------------===// +// +// Some encodings are ambiguous except by comparing field values. + +class MMDecodeDisambiguatedBy : DecodeDisambiguates { + string DecoderNamespace = "MicroMipsR6_Ambiguous"; } // Class used for microMIPS32r6 and microMIPS64r6 instructions. @@ -239,7 +252,7 @@ let Inst{5-0} = 0; } -class POOL32A_RDPGPR_FM_MMR6 funct> { +class POOL32A_RDPGPR_FM_MMR6 funct> : MMR6Arch { bits<5> rt; bits<5> rd; bits<32> Inst; @@ -251,7 +264,7 @@ let Inst{5-0} = 0b111100; } -class POOL32A_RDHWR_FM_MMR6 { +class POOL32A_RDHWR_FM_MMR6 : MMR6Arch { bits<5> rt; bits<5> rs; bits<3> sel; @@ -425,7 +438,7 @@ let Inst{15-0} = offset; } -class LOAD_UPPER_IMM_FM_MMR6 { +class LOAD_UPPER_IMM_FM_MMR6 : MMR6Arch { bits<5> rt; bits<16> imm16; @@ -437,7 +450,8 @@ let Inst{15-0} = imm16; } -class CMP_BRANCH_1R_RT_OFF16_FM_MMR6 funct> : MipsR6Inst { +class CMP_BRANCH_1R_RT_OFF16_FM_MMR6 funct> + : MipsR6Inst, MMR6Arch { bits<5> rt; bits<16> offset; @@ -449,7 +463,8 @@ let Inst{15-0} = offset; } -class CMP_BRANCH_1R_BOTH_OFF16_FM_MMR6 funct> : MipsR6Inst { +class CMP_BRANCH_1R_BOTH_OFF16_FM_MMR6 funct> + : MipsR6Inst, MMR6Arch { bits<5> rt; bits<16> offset; @@ -557,7 +572,7 @@ } class POOL32F_ARITH_FM_MMR6 fmt, bits<8> funct> - : MMR6Arch, MipsR6Inst { + : MipsR6Inst, MMR6Arch { bits<5> ft; bits<5> fs; bits<5> fd; @@ -574,7 +589,7 @@ } class POOL32F_ARITHF_FM_MMR6 fmt, bits<9> funct> - : MMR6Arch, MipsR6Inst { + : MipsR6Inst, MMR6Arch { bits<5> ft; bits<5> fs; bits<5> fd; @@ -590,7 +605,7 @@ } class POOL32F_MOV_NEG_FM_MMR6 fmt, bits<7> funct> - : MMR6Arch, MipsR6Inst { + : MipsR6Inst, MMR6Arch { bits<5> ft; bits<5> fs; @@ -606,7 +621,7 @@ } class POOL32F_MINMAX_FM fmt, bits<9> funct> - : MMR6Arch, MipsR6Inst { + : MipsR6Inst, MMR6Arch { bits<5> ft; bits<5> fs; bits<5> fd; @@ -622,7 +637,7 @@ } class POOL32F_CMP_FM format, FIELD_CMP_COND Cond> - : MMR6Arch, MipsR6Inst { + : MipsR6Inst, MMR6Arch { bits<5> ft; bits<5> fs; bits<5> fd; @@ -638,7 +653,7 @@ } class POOL32F_CVT_LW_FM funct> - : MMR6Arch, MipsR6Inst { + : MipsR6Inst, MMR6Arch { bits<5> ft; bits<5> fs; @@ -653,7 +668,7 @@ } class POOL32F_CVT_DS_FM fmt, bits<7> funct> - : MMR6Arch, MipsR6Inst { + : MipsR6Inst, MMR6Arch { bits<5> ft; bits<5> fs; @@ -668,7 +683,7 @@ } class POOL32F_ABS_FM_MMR6 fmt, bits<7> funct> - : MMR6Arch, MipsR6Inst { + : MipsR6Inst, MMR6Arch { bits<5> ft; bits<5> fs; @@ -684,7 +699,7 @@ } class POOL32F_MATH_FM_MMR6 fmt, bits<8> funct> - : MMR6Arch, MipsR6Inst { + : MipsR6Inst, MMR6Arch { bits<5> ft; bits<5> fs; @@ -784,3 +799,18 @@ let Inst{15-6} = funct; let Inst{5-0} = 0x3c; } + +class CMP_BRANCH_2R_OFF16_FM_MMR6 funct> + : MipsR6Inst, MMR6Arch { + bits<5> rt; + bits<5> rs; + bits<16> offset; + + bits<32> Inst; + + let Inst{31-26} = funct; + let Inst{25-21} = rt; + let Inst{20-16} = rs; + let Inst{15-0} = offset; +} + Index: lib/Target/Mips/MicroMips32r6InstrInfo.td =================================================================== --- lib/Target/Mips/MicroMips32r6InstrInfo.td +++ lib/Target/Mips/MicroMips32r6InstrInfo.td @@ -33,12 +33,24 @@ class BNEZC16_MMR6_ENC : BEQZC_BNEZC_FM_MM16R6<0x2b>; class BITSWAP_MMR6_ENC : POOL32A_BITSWAP_FM_MMR6<0b101100>; class BRK_MMR6_ENC : BREAK_MMR6_ENC<"break">; -class BEQZALC_MMR6_ENC : CMP_BRANCH_1R_RT_OFF16_FM_MMR6<0b011101>; -class BNEZALC_MMR6_ENC : CMP_BRANCH_1R_RT_OFF16_FM_MMR6<0b011111>; -class BGTZALC_MMR6_ENC : CMP_BRANCH_1R_RT_OFF16_FM_MMR6<0b111000>; -class BLTZALC_MMR6_ENC : CMP_BRANCH_1R_BOTH_OFF16_FM_MMR6<0b111000>; -class BGEZALC_MMR6_ENC : CMP_BRANCH_1R_BOTH_OFF16_FM_MMR6<0b110000>; -class BLEZALC_MMR6_ENC : CMP_BRANCH_1R_RT_OFF16_FM_MMR6<0b110000>; +class BEQZALC_MMR6_ENC : CMP_BRANCH_1R_RT_OFF16_FM_MMR6<"beqzalc",0b011101>; +class BNEZALC_MMR6_ENC : CMP_BRANCH_1R_RT_OFF16_FM_MMR6<"bnezalc", 0b011111>; +class BGTZALC_MMR6_ENC : CMP_BRANCH_1R_RT_OFF16_FM_MMR6<"bgtzalc", 0b111000>, + MMDecodeDisambiguatedBy<"BgtzGroupBranchMMR6">; +class BLTZALC_MMR6_ENC : CMP_BRANCH_1R_BOTH_OFF16_FM_MMR6<"bltzalc", 0b111000>, + MMDecodeDisambiguatedBy<"BgtzGroupBranchMMR6">; +class BGEZALC_MMR6_ENC : CMP_BRANCH_1R_BOTH_OFF16_FM_MMR6<"bgezalc", 0b110000>, + MMDecodeDisambiguatedBy<"BlezGroupBranchMMR6">; +class BLEZALC_MMR6_ENC : CMP_BRANCH_1R_RT_OFF16_FM_MMR6<"blezalc", 0b110000>, + MMDecodeDisambiguatedBy<"BlezGroupBranchMMR6">; +class BGEC_MMR6_ENC : CMP_BRANCH_2R_OFF16_FM_MMR6<"bgec", 0b111001>; +class BGEUC_MMR6_ENC : CMP_BRANCH_2R_OFF16_FM_MMR6<"bgeuc", 0b110000>, + DecodeDisambiguates<"BlezGroupBranchMMR6">; +class BLTC_MMR6_ENC : CMP_BRANCH_2R_OFF16_FM_MMR6<"bltc", 0b110001>; +class BLTUC_MMR6_ENC : CMP_BRANCH_2R_OFF16_FM_MMR6<"bltuc", 0b111000>, + DecodeDisambiguates<"BgtzGroupBranchMMR6">; +class BEQC_MMR6_ENC : CMP_BRANCH_2R_OFF16_FM_MMR6<"beqc", 0b011101>; +class BNEC_MMR6_ENC : CMP_BRANCH_2R_OFF16_FM_MMR6<"bnec", 0b011111>; class CACHE_MMR6_ENC : CACHE_PREF_FM_MMR6<0b001000, 0b0110>; class CLO_MMR6_ENC : POOL32A_2R_FM_MMR6<0b0100101100>; class CLZ_MMR6_ENC : SPECIAL_2R_FM_MMR6<0b010000>; @@ -83,12 +95,12 @@ class LBE_MMR6_ENC : POOL32C_LB_LBU_FM_MMR6<0b100>; class LBUE_MMR6_ENC : POOL32C_LB_LBU_FM_MMR6<0b000>; class PAUSE_MMR6_ENC : POOL32A_PAUSE_FM_MMR6<"pause", 0b00101>; -class RDHWR_MMR6_ENC : POOL32A_RDHWR_FM_MMR6; +class RDHWR_MMR6_ENC : POOL32A_RDHWR_FM_MMR6<"rdhwr">; class WAIT_MMR6_ENC : WAIT_FM_MM, MMR6Arch<"wait">; class SSNOP_MMR6_ENC : BARRIER_FM_MM<0x1>, MMR6Arch<"ssnop">; class SYNC_MMR6_ENC : POOL32A_SYNC_FM_MMR6; class SYNCI_MMR6_ENC : POOL32I_SYNCI_FM_MMR6, MMR6Arch<"synci">; -class RDPGPR_MMR6_ENC : POOL32A_RDPGPR_FM_MMR6<0b1110000101>; +class RDPGPR_MMR6_ENC : POOL32A_RDPGPR_FM_MMR6<"rdpgpr", 0b1110000101>; class SDBBP_MMR6_ENC : SDBBP_FM_MM, MMR6Arch<"sdbbp">; class XOR_MMR6_ENC : ARITH_FM_MMR6<"xor", 0x310>; class XORI_MMR6_ENC : ADDI_FM_MMR6<"xori", 0x1c>; @@ -118,7 +130,7 @@ class LLE_MMR6_ENC : LOAD_WORD_EVA_FM_MMR6<0b110>; class LWE_MMR6_ENC : LOAD_WORD_EVA_FM_MMR6<0b111>; class LW_MMR6_ENC : LOAD_WORD_FM_MMR6; -class LUI_MMR6_ENC : LOAD_UPPER_IMM_FM_MMR6; +class LUI_MMR6_ENC : LOAD_UPPER_IMM_FM_MMR6<"lui">; class ADDU16_MMR6_ENC : POOL16A_ADDU16_FM_MMR6; class AND16_MMR6_ENC : POOL16C_AND16_FM_MMR6; @@ -136,7 +148,7 @@ class CMP_CBR_RT_Z_MMR6_DESC_BASE - : BRANCH_DESC_BASE, MMR6Arch { + : BRANCH_DESC_BASE { dag InOperandList = (ins GPROpnd:$rt, opnd:$offset); dag OutOperandList = (outs); string AsmString = !strconcat(instr_asm, "\t$rt, $offset"); @@ -173,6 +185,27 @@ list Defs = [RA]; } +class CMP_CBR_2R_MMR6_DESC_BASE : BRANCH_DESC_BASE { + dag InOperandList = (ins GPROpnd:$rs, GPROpnd:$rt, opnd:$offset); + dag OutOperandList = (outs); + string AsmString = !strconcat(instr_asm, "\t$rs, $rt, $offset"); + list Defs = [AT]; +} + +class BGEC_MMR6_DESC : CMP_CBR_2R_MMR6_DESC_BASE<"bgec", brtarget_mm, + GPR32Opnd>; +class BGEUC_MMR6_DESC : CMP_CBR_2R_MMR6_DESC_BASE<"bgeuc", brtarget_mm, + GPR32Opnd>; +class BLTC_MMR6_DESC : CMP_CBR_2R_MMR6_DESC_BASE<"bltc", brtarget_mm, + GPR32Opnd>; +class BLTUC_MMR6_DESC : CMP_CBR_2R_MMR6_DESC_BASE<"bltuc", brtarget_mm, + GPR32Opnd>; +class BEQC_MMR6_DESC : CMP_CBR_2R_MMR6_DESC_BASE<"beqc", brtarget_mm, + GPR32Opnd>; +class BNEC_MMR6_DESC : CMP_CBR_2R_MMR6_DESC_BASE<"bnec", brtarget_mm, + GPR32Opnd>; + /// Floating Point Instructions class FADD_S_MMR6_ENC : POOL32F_ARITH_FM_MMR6<"add.s", 0, 0b00110000>; class FADD_D_MMR6_ENC : POOL32F_ARITH_FM_MMR6<"add.d", 1, 0b00110000>; @@ -450,7 +483,7 @@ class SELEQZ_MMR6_DESC : SELEQNE_Z_MMR6_DESC_BASE<"seleqz", GPR32Opnd>; class SELNEZ_MMR6_DESC : SELEQNE_Z_MMR6_DESC_BASE<"selnez", GPR32Opnd>; class PAUSE_MMR6_DESC : Barrier<"pause">; -class RDHWR_MMR6_DESC : MMR6Arch<"rdhwr">, MipsR6Inst { +class RDHWR_MMR6_DESC : MipsR6Inst { dag OutOperandList = (outs GPR32Opnd:$rt); dag InOperandList = (ins HWRegsOpnd:$rs, uimm3:$sel); string AsmString = !strconcat("rdhwr", "\t$rt, $rs, $sel"); @@ -777,7 +810,7 @@ InstrItinClass Itinerary = II_LW; } -class LUI_MMR6_DESC : IsAsCheapAsAMove, MMR6Arch<"lui">, MipsR6Inst{ +class LUI_MMR6_DESC : IsAsCheapAsAMove, MipsR6Inst{ dag OutOperandList = (outs GPR32Opnd:$rt); dag InOperandList = (ins uimm16:$imm16); string AsmString = "lui\t$rt, $imm16"; @@ -801,7 +834,7 @@ let DecoderMethod = "DecodeSynciR6"; } -class RDPGPR_MMR6_DESC : MMR6Arch<"rdpgpr">, MipsR6Inst { +class RDPGPR_MMR6_DESC : MipsR6Inst { dag OutOperandList = (outs GPR32Opnd:$rt); dag InOperandList = (ins GPR32Opnd:$rd); string AsmString = !strconcat("rdpgpr", "\t$rt, $rd"); @@ -820,7 +853,6 @@ // //===----------------------------------------------------------------------===// -let DecoderNamespace = "MicroMipsR6" in { def ADD_MMR6 : StdMMR6Rel, ADD_MMR6_DESC, ADD_MMR6_ENC, ISA_MICROMIPS32R6; def ADDIU_MMR6 : StdMMR6Rel, ADDIU_MMR6_DESC, ADDIU_MMR6_ENC, ISA_MICROMIPS32R6; def ADDU_MMR6 : StdMMR6Rel, ADDU_MMR6_DESC, ADDU_MMR6_ENC, ISA_MICROMIPS32R6; @@ -855,6 +887,12 @@ def BNEZALC_MMR6 : R6MMR6Rel, BNEZALC_MMR6_ENC, BNEZALC_MMR6_DESC, ISA_MICROMIPS32R6; def BREAK_MMR6 : StdMMR6Rel, BRK_MMR6_DESC, BRK_MMR6_ENC, ISA_MICROMIPS32R6; +def BGEC_MMR6 : R6MMR6Rel, BGEC_MMR6_ENC, BGEC_MMR6_DESC, ISA_MICROMIPS32R6; +def BGEUC_MMR6 : R6MMR6Rel, BGEUC_MMR6_ENC, BGEUC_MMR6_DESC, ISA_MICROMIPS32R6; +def BLTC_MMR6 : R6MMR6Rel, BLTC_MMR6_ENC, BLTC_MMR6_DESC, ISA_MICROMIPS32R6; +def BLTUC_MMR6 : R6MMR6Rel, BLTUC_MMR6_ENC, BLTUC_MMR6_DESC, ISA_MICROMIPS32R6; +def BEQC_MMR6 : R6MMR6Rel, BEQC_MMR6_ENC, BEQC_MMR6_DESC, ISA_MICROMIPS32R6; +def BNEC_MMR6 : R6MMR6Rel, BNEC_MMR6_ENC, BNEC_MMR6_DESC, ISA_MICROMIPS32R6; def CACHE_MMR6 : R6MMR6Rel, CACHE_MMR6_ENC, CACHE_MMR6_DESC, ISA_MICROMIPS32R6; def CLO_MMR6 : R6MMR6Rel, CLO_MMR6_ENC, CLO_MMR6_DESC, ISA_MICROMIPS32R6; def CLZ_MMR6 : R6MMR6Rel, CLZ_MMR6_ENC, CLZ_MMR6_DESC, ISA_MICROMIPS32R6; @@ -1056,7 +1094,6 @@ ISA_MICROMIPS32R6; def XOR16_MMR6 : StdMMR6Rel, XOR16_MMR6_DESC, XOR16_MMR6_ENC, ISA_MICROMIPS32R6; -} //===----------------------------------------------------------------------===// // Index: lib/Target/Mips/Mips32r6InstrInfo.td =================================================================== --- lib/Target/Mips/Mips32r6InstrInfo.td +++ lib/Target/Mips/Mips32r6InstrInfo.td @@ -302,7 +302,8 @@ } class CMP_BC_DESC_BASE : BRANCH_DESC_BASE { + RegisterOperand GPROpnd> : BRANCH_DESC_BASE, + MipsR6Arch { dag InOperandList = (ins GPROpnd:$rs, GPROpnd:$rt, opnd:$offset); dag OutOperandList = (outs); string AsmString = !strconcat(instr_asm, "\t$rs, $rt, $offset"); @@ -665,11 +666,11 @@ def BC2EQZ : BC2EQZ_ENC, BC2EQZ_DESC, ISA_MIPS32R6; def BC2NEZ : BC2NEZ_ENC, BC2NEZ_DESC, ISA_MIPS32R6; def BC : R6MMR6Rel, BC_ENC, BC_DESC, ISA_MIPS32R6; -def BEQC : BEQC_ENC, BEQC_DESC, ISA_MIPS32R6; +def BEQC : R6MMR6Rel, BEQC_ENC, BEQC_DESC, ISA_MIPS32R6; def BEQZALC : R6MMR6Rel, BEQZALC_ENC, BEQZALC_DESC, ISA_MIPS32R6; def BEQZC : BEQZC_ENC, BEQZC_DESC, ISA_MIPS32R6; -def BGEC : BGEC_ENC, BGEC_DESC, ISA_MIPS32R6; -def BGEUC : BGEUC_ENC, BGEUC_DESC, ISA_MIPS32R6; +def BGEC : R6MMR6Rel, BGEC_ENC, BGEC_DESC, ISA_MIPS32R6; +def BGEUC : R6MMR6Rel, BGEUC_ENC, BGEUC_DESC, ISA_MIPS32R6; def BGEZALC : R6MMR6Rel, BGEZALC_ENC, BGEZALC_DESC, ISA_MIPS32R6; def BGEZC : BGEZC_ENC, BGEZC_DESC, ISA_MIPS32R6; def BGTZALC : R6MMR6Rel, BGTZALC_ENC, BGTZALC_DESC, ISA_MIPS32R6; @@ -677,11 +678,11 @@ def BITSWAP : R6MMR6Rel, BITSWAP_ENC, BITSWAP_DESC, ISA_MIPS32R6; def BLEZALC : R6MMR6Rel, BLEZALC_ENC, BLEZALC_DESC, ISA_MIPS32R6; def BLEZC : BLEZC_ENC, BLEZC_DESC, ISA_MIPS32R6; -def BLTC : BLTC_ENC, BLTC_DESC, ISA_MIPS32R6; -def BLTUC : BLTUC_ENC, BLTUC_DESC, ISA_MIPS32R6; +def BLTC : R6MMR6Rel, BLTC_ENC, BLTC_DESC, ISA_MIPS32R6; +def BLTUC : R6MMR6Rel, BLTUC_ENC, BLTUC_DESC, ISA_MIPS32R6; def BLTZALC : R6MMR6Rel, BLTZALC_ENC, BLTZALC_DESC, ISA_MIPS32R6; def BLTZC : BLTZC_ENC, BLTZC_DESC, ISA_MIPS32R6; -def BNEC : BNEC_ENC, BNEC_DESC, ISA_MIPS32R6; +def BNEC : R6MMR6Rel, BNEC_ENC, BNEC_DESC, ISA_MIPS32R6; def BNEZALC : R6MMR6Rel, BNEZALC_ENC, BNEZALC_DESC, ISA_MIPS32R6; def BNEZC : BNEZC_ENC, BNEZC_DESC, ISA_MIPS32R6; def BNVC : BNVC_ENC, BNVC_DESC, ISA_MIPS32R6; Index: test/MC/Disassembler/Mips/micromips32r6/valid.txt =================================================================== --- test/MC/Disassembler/Mips/micromips32r6/valid.txt +++ test/MC/Disassembler/Mips/micromips32r6/valid.txt @@ -38,6 +38,12 @@ 0x00 0xa4 0x1a 0x50 # CHECK: and $3, $4, $5 0xd0 0x64 0x04 0xd2 # CHECK: andi $3, $4, 1234 0x10 0x62 0xff 0xe9 # CHECK: aui $3, $2, -23 +0x74 0x83 0x00 0x08 # CHECK: beqc $3, $4, 16 +0xe4 0x83 0x00 0x08 # CHECK: bgec $3, $4, 16 +0xc0 0x83 0x00 0x08 # CHECK: bgeuc $3, $4, 16 +0xc4 0x83 0x00 0x08 # CHECK: bltc $3, $4, 16 +0xe0 0x83 0x00 0x08 # CHECK: bltuc $3, $4, 16 +0x7c 0x83 0x00 0x08 # CHECK: bnec $3, $4, 16 0x74 0x40 0x02 0x9a # CHECK: beqzalc $2, 1332 0x7c 0x40 0x02 0x9a # CHECK: bnezalc $2, 1332 0xc0 0x42 0x02 0x9a # CHECK: bgezalc $2, 1332 Index: test/MC/Mips/micromips32r6/valid.s =================================================================== --- test/MC/Mips/micromips32r6/valid.s +++ test/MC/Mips/micromips32r6/valid.s @@ -20,12 +20,18 @@ auipc $3, -1 # CHECK: auipc $3, -1 # encoding: [0x78,0x7e,0xff,0xff] align $4, $2, $3, 2 # CHECK: align $4, $2, $3, 2 # encoding: [0x00,0x43,0x24,0x1f] aui $3,$2,-23 # CHECK: aui $3, $2, -23 # encoding: [0x10,0x62,0xff,0xe9] + beqc $3,$4, 16 # CHECK: beqc $3, $4, 16 # encoding: [0x74,0x83,0x00,0x08] beqzalc $2, 1332 # CHECK: beqzalc $2, 1332 # encoding: [0x74,0x40,0x02,0x9a] + bgec $3,$4, 16 # CHECK: bgec $3, $4, 16 # encoding: [0xe4,0x83,0x00,0x08] + bgeuc $3,$4, 16 # CHECK: bgeuc $3, $4, 16 # encoding: [0xc0,0x83,0x00,0x08] bnezalc $2, 1332 # CHECK: bnezalc $2, 1332 # encoding: [0x7c,0x40,0x02,0x9a] bgezalc $2, 1332 # CHECK: bgezalc $2, 1332 # encoding: [0xc0,0x42,0x02,0x9a] bgtzalc $2, 1332 # CHECK: bgtzalc $2, 1332 # encoding: [0xe0,0x40,0x02,0x9a] + bltc $3,$4, 16 # CHECK: bltc $3, $4, 16 # encoding: [0xc4,0x83,0x00,0x08] + bltuc $3,$4, 16 # CHECK: bltuc $3, $4, 16 # encoding: [0xe0,0x83,0x00,0x08] bltzalc $2, 1332 # CHECK: bltzalc $2, 1332 # encoding: [0xe0,0x42,0x02,0x9a] blezalc $2, 1332 # CHECK: blezalc $2, 1332 # encoding: [0xc0,0x40,0x02,0x9a] + bnec $3,$4, 16 # CHECK: bnec $3, $4, 16 # encoding: [0x7c,0x83,0x00,0x08] balc 14572256 # CHECK: balc 14572256 # encoding: [0xb4,0x37,0x96,0xb8] b 132 # CHECK: bc16 132 # encoding: [0xcc,0x42] bc 14572256 # CHECK: bc 14572256 # encoding: [0x94,0x37,0x96,0xb8]