Index: llvm/trunk/lib/Target/Mips/MicroMipsInstrFormats.td =================================================================== --- llvm/trunk/lib/Target/Mips/MicroMipsInstrFormats.td +++ llvm/trunk/lib/Target/Mips/MicroMipsInstrFormats.td @@ -207,6 +207,15 @@ let Inst{0} = 1; } +class BRKSDBBP16_FM_MM op> { + bits<4> code_; + bits<16> Inst; + + let Inst{15-10} = 0x11; + let Inst{9-4} = op; + let Inst{3-0} = code_; +} + //===----------------------------------------------------------------------===// // MicroMIPS 32-bit Instruction Formats //===----------------------------------------------------------------------===// Index: llvm/trunk/lib/Target/Mips/MicroMipsInstrInfo.td =================================================================== --- llvm/trunk/lib/Target/Mips/MicroMipsInstrInfo.td +++ llvm/trunk/lib/Target/Mips/MicroMipsInstrInfo.td @@ -296,6 +296,12 @@ let isIndirectBranch = 1; } +// Break16 and Sdbbp16 +class BrkSdbbp16MM : + MicroMipsInst16<(outs), (ins uimm4:$code_), + !strconcat(opstr, "\t$code_"), + [], NoItinerary, FrmOther>; + // MicroMIPS Jump and Link (Call) - Short Delay Slot let isCall = 1, hasDelaySlot = 1, Defs = [RA] in { class JumpLinkMM : @@ -392,6 +398,8 @@ def JRC16_MM : JumpRegCMM16<"jrc", GPR32Opnd>, JALR_FM_MM16<0x0d>; def JRADDIUSP : JumpRAddiuStackMM16, JRADDIUSP_FM_MM16<0x18>; def JR16_MM : JumpRegMM16<"jr16", GPR32Opnd>, JALR_FM_MM16<0x0c>; +def BREAK16_MM : BrkSdbbp16MM<"break16">, BRKSDBBP16_FM_MM<0x28>; +def SDBBP16_MM : BrkSdbbp16MM<"sdbbp16">, BRKSDBBP16_FM_MM<0x2C>; class WaitMM : InstSE<(outs), (ins uimm10:$code_), !strconcat(opstr, "\t$code_"), [], Index: llvm/trunk/test/MC/Mips/micromips-16-bit-instructions.s =================================================================== --- llvm/trunk/test/MC/Mips/micromips-16-bit-instructions.s +++ llvm/trunk/test/MC/Mips/micromips-16-bit-instructions.s @@ -43,6 +43,8 @@ # CHECK-EL: move $zero, $zero # encoding: [0x00,0x0c] # CHECK-EL: jr16 $9 # encoding: [0x89,0x45] # CHECK-EL: nop # encoding: [0x00,0x00,0x00,0x00] +# CHECK-EL: break16 8 # encoding: [0x88,0x46] +# CHECK-EL: sdbbp16 14 # encoding: [0xce,0x46] #------------------------------------------------------------------------------ # Big endian #------------------------------------------------------------------------------ @@ -80,6 +82,8 @@ # CHECK-EB: move $zero, $zero # encoding: [0x0c,0x00] # CHECK-EB: jr16 $9 # encoding: [0x45,0x89] # CHECK-EB: nop # encoding: [0x00,0x00,0x00,0x00] +# CHECK-EB: break16 8 # encoding: [0x46,0x88] +# CHECK-EB: sdbbp16 14 # encoding: [0x46,0xce] addu16 $6, $17, $4 subu16 $5, $16, $3 @@ -113,3 +117,5 @@ jraddiusp 20 jalrs16 $9 jr16 $9 + break16 8 + sdbbp16 14