Index: lib/Target/Mips/MipsInstrFormats.td =================================================================== --- lib/Target/Mips/MipsInstrFormats.td +++ lib/Target/Mips/MipsInstrFormats.td @@ -653,6 +653,15 @@ let Inst{5-0} = funct; } +class ERNC_FM funct> : StdArch +{ + bits<32> Inst; + let Inst{31-26} = 0x10; + let Inst{25} = 1; + let Inst{24-7} = 0; + let Inst{6} = 1; + let Inst{5-0} = funct; +} //===----------------------------------------------------------------------===// // Enable/disable interrupt instruction format Index: lib/Target/Mips/MipsInstrInfo.td =================================================================== --- lib/Target/Mips/MipsInstrInfo.td +++ lib/Target/Mips/MipsInstrInfo.td @@ -166,6 +166,8 @@ AssemblerPredicate<"FeatureMips32">; def HasMips32r2 : Predicate<"Subtarget->hasMips32r2()">, AssemblerPredicate<"FeatureMips32r2">; +def HasMips32r5 : Predicate<"Subtarget->hasMips32r5()">, + AssemblerPredicate<"FeatureMips32r5">; def HasMips32r6 : Predicate<"Subtarget->hasMips32r6()">, AssemblerPredicate<"FeatureMips32r6">; def NotMips32r6 : Predicate<"!Subtarget->hasMips32r6()">, @@ -242,6 +244,7 @@ class ISA_MIPS32R2_NOT_32R6_64R6 { list InsnPredicates = [HasMips32r2, NotMips32r6, NotMips64r6]; } +class ISA_MIPS32R5 { list InsnPredicates = [HasMips32r5]; } class ISA_MIPS64 { list InsnPredicates = [HasMips64]; } class ISA_MIPS64_NOT_64R6 { list InsnPredicates = [HasMips64, NotMips64r6]; @@ -874,6 +877,11 @@ InstSE<(outs), (ins), opstr, [], NoItinerary, FrmOther, opstr>; +// Eretnc +class ERNC_FT : + InstSE<(outs), (ins), + opstr, [], NoItinerary, FrmOther, opstr>; + // Interrupts class DEI_FT : InstSE<(outs RO:$rt), (ins), @@ -1291,6 +1299,7 @@ let AdditionalPredicates = [NotInMicroMips] in { def ERET : MMRel, ER_FT<"eret">, ER_FM<0x18>, INSN_MIPS3_32; +def ERETNC : MMRel, ERNC_FT<"eretnc">, ERNC_FM<0x18>, ISA_MIPS32R5; } def DERET : MMRel, ER_FT<"deret">, ER_FM<0x1f>, ISA_MIPS32; Index: lib/Target/Mips/MipsSubtarget.h =================================================================== --- lib/Target/Mips/MipsSubtarget.h +++ lib/Target/Mips/MipsSubtarget.h @@ -189,7 +189,7 @@ } bool hasMips32r5() const { return (MipsArchVersion >= Mips32r5 && MipsArchVersion < Mips32Max) || - hasMips64r2(); + hasMips64r5(); } bool hasMips32r6() const { return (MipsArchVersion >= Mips32r6 && MipsArchVersion < Mips32Max) || Index: test/MC/Mips/mips32/valid-xfail.s =================================================================== --- test/MC/Mips/mips32/valid-xfail.s +++ test/MC/Mips/mips32/valid-xfail.s @@ -35,4 +35,5 @@ c.ult.s $fcc7,$f24,$f10 c.un.d $fcc6,$f23,$f24 c.un.s $fcc1,$f30,$f4 + eretnc rorv $13,$a3,$s5 Index: test/MC/Mips/mips32r2/valid-xfail.s =================================================================== --- test/MC/Mips/mips32r2/valid-xfail.s +++ test/MC/Mips/mips32r2/valid-xfail.s @@ -117,6 +117,7 @@ dpsx.w.ph $ac0,$s7,$gp dvpe $s6 emt $8 + eretnc evpe $v0 extpdpv $s6,$ac0,$s8 extpv $13,$ac0,$14 Index: test/MC/Mips/mips32r3/valid-xfail.s =================================================================== --- test/MC/Mips/mips32r3/valid-xfail.s +++ test/MC/Mips/mips32r3/valid-xfail.s @@ -117,6 +117,7 @@ dpsx.w.ph $ac0,$s7,$gp dvpe $s6 emt $8 + eretnc evpe $v0 extpdpv $s6,$ac0,$s8 extpv $13,$ac0,$14 Index: test/MC/Mips/mips32r5/valid.s =================================================================== --- test/MC/Mips/mips32r5/valid.s +++ test/MC/Mips/mips32r5/valid.s @@ -70,6 +70,7 @@ ei $14 # CHECK: ei $14 # encoding: [0x41,0x6e,0x60,0x20] ei # CHECK: ei # encoding: [0x41,0x60,0x60,0x20] eret + eretnc # CHECK: eretnc # encoding: [0x42,0x00,0x00,0x58] floor.w.d $f14,$f11 floor.w.s $f8,$f9 j 1f # CHECK: j $tmp0 # encoding: [0b000010AA,A,A,A] Index: test/MC/Mips/mips32r6/valid.s =================================================================== --- test/MC/Mips/mips32r6/valid.s +++ test/MC/Mips/mips32r6/valid.s @@ -103,6 +103,8 @@ divu $2,$3,$4 # CHECK: divu $2, $3, $4 # encoding: [0x00,0x64,0x10,0x9b] ei $14 # CHECK: ei $14 # encoding: [0x41,0x6e,0x60,0x20] ei # CHECK: ei # encoding: [0x41,0x60,0x60,0x20] + eret + eretnc # CHECK: eretnc # encoding: [0x42,0x00,0x00,0x58] jialc $5, 256 # CHECK: jialc $5, 256 # encoding: [0xf8,0x05,0x01,0x00] jic $5, 256 # CHECK: jic $5, 256 # encoding: [0xd8,0x05,0x01,0x00] lsa $2, $3, $4, 3 # CHECK: lsa $2, $3, $4, 3 # encoding: [0x00,0x64,0x10,0xc5] Index: test/MC/Mips/mips64/valid-xfail.s =================================================================== --- test/MC/Mips/mips64/valid-xfail.s +++ test/MC/Mips/mips64/valid-xfail.s @@ -62,6 +62,7 @@ cvt.s.pu $f14,$f25 dmfc0 $10,c0_watchhi,2 dmtc0 $15,c0_datalo + eretnc madd.ps $f22,$f3,$f14,$f3 mov.ps $f22,$f17 movf.ps $f10,$f28,$fcc6 Index: test/MC/Mips/mips64r2/valid-xfail.s =================================================================== --- test/MC/Mips/mips64r2/valid-xfail.s +++ test/MC/Mips/mips64r2/valid-xfail.s @@ -119,6 +119,7 @@ drorv $at,$a1,$s7 dvpe $s6 emt $8 + eretnc evpe $v0 extpdpv $s6,$ac0,$s8 extpv $13,$ac0,$14 Index: test/MC/Mips/mips64r3/valid-xfail.s =================================================================== --- test/MC/Mips/mips64r3/valid-xfail.s +++ test/MC/Mips/mips64r3/valid-xfail.s @@ -119,6 +119,7 @@ drorv $at,$a1,$s7 dvpe $s6 emt $8 + eretnc evpe $v0 extpdpv $s6,$ac0,$s8 extpv $13,$ac0,$14 Index: test/MC/Mips/mips64r5/valid.s =================================================================== --- test/MC/Mips/mips64r5/valid.s +++ test/MC/Mips/mips64r5/valid.s @@ -132,6 +132,7 @@ ei $14 # CHECK: ei $14 # encoding: [0x41,0x6e,0x60,0x20] ei # CHECK: ei # encoding: [0x41,0x60,0x60,0x20] eret + eretnc # CHECK: eretnc # encoding: [0x42,0x00,0x00,0x58] floor.l.d $f26,$f7 floor.l.s $f12,$f5 floor.w.d $f14,$f11 Index: test/MC/Mips/mips64r6/valid.s =================================================================== --- test/MC/Mips/mips64r6/valid.s +++ test/MC/Mips/mips64r6/valid.s @@ -132,6 +132,7 @@ dsubu $15,$11,5025 # CHECK: daddiu $15, $11, -5025 # encoding: [0x65,0x6f,0xec,0x5f] ei # CHECK: ei # encoding: [0x41,0x60,0x60,0x20] ei $14 # CHECK: ei $14 # encoding: [0x41,0x6e,0x60,0x20] + eretnc # CHECK: eretnc # encoding: [0x42,0x00,0x00,0x58] j 1f # CHECK: j $tmp0 # encoding: [0b000010AA,A,A,A] # CHECK: # fixup A - offset: 0, value: ($tmp0), kind: fixup_Mips_26 j a # CHECK: j a # encoding: [0b000010AA,A,A,A]