diff options
| author | Vladimir Medic <Vladimir.Medic@imgtec.com> | 2013-07-17 14:05:19 +0000 |
|---|---|---|
| committer | Vladimir Medic <Vladimir.Medic@imgtec.com> | 2013-07-17 14:05:19 +0000 |
| commit | 29410f9c917dde933050b1b1acd4e03f82823747 (patch) | |
| tree | c59ce06a0b07e3bb5cca72cac9cadc75a902596e /llvm/lib | |
| parent | 8c25b9d86aba0bc6ff59a044c68f156a9b5a8364 (diff) | |
| download | bcm5719-llvm-29410f9c917dde933050b1b1acd4e03f82823747.tar.gz bcm5719-llvm-29410f9c917dde933050b1b1acd4e03f82823747.zip | |
Implement eret and deret(return from exception) instructions for Mips. Test examples are given.
llvm-svn: 186507
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/Mips/MipsInstrFormats.td | 13 | ||||
| -rw-r--r-- | llvm/lib/Target/Mips/MipsInstrInfo.td | 8 |
2 files changed, 21 insertions, 0 deletions
diff --git a/llvm/lib/Target/Mips/MipsInstrFormats.td b/llvm/lib/Target/Mips/MipsInstrFormats.td index c2a58795770..0ae93b43bed 100644 --- a/llvm/lib/Target/Mips/MipsInstrFormats.td +++ b/llvm/lib/Target/Mips/MipsInstrFormats.td @@ -520,6 +520,19 @@ class BRK_FM<bits<6> funct> } //===----------------------------------------------------------------------===// +// Exception return format <Cop0|1|0|funct> +//===----------------------------------------------------------------------===// + +class ER_FM<bits<6> funct> +{ + bits<32> Inst; + let Inst{31-26} = 0x10; + let Inst{25} = 1; + let Inst{24-6} = 0; + let Inst{5-0} = funct; +} + +//===----------------------------------------------------------------------===// // // FLOATING POINT INSTRUCTION FORMATS // diff --git a/llvm/lib/Target/Mips/MipsInstrInfo.td b/llvm/lib/Target/Mips/MipsInstrInfo.td index 1bc10770ad8..6082a3f9b44 100644 --- a/llvm/lib/Target/Mips/MipsInstrInfo.td +++ b/llvm/lib/Target/Mips/MipsInstrInfo.td @@ -652,6 +652,11 @@ class BRK_FT<string opstr> : InstSE<(outs), (ins uimm10:$code_1, uimm10:$code_2), !strconcat(opstr, "\t$code_1, $code_2"), [], NoItinerary, FrmOther>; +// (D)Eret +class ER_FT<string opstr> : + InstSE<(outs), (ins), + opstr, [], NoItinerary, FrmOther>; + // Sync let hasSideEffects = 1 in class SYNC_FT : @@ -958,6 +963,9 @@ def TEQ : TEQ_FT<"teq", CPURegsOpnd>, TEQ_FM<0x34>; def BREAK : BRK_FT<"break">, BRK_FM<0xd>; def SYSCALL : SYS_FT<"syscall">, SYS_FM<0xc>; +def ERET : ER_FT<"eret">, ER_FM<0x18>; +def DERET : ER_FT<"deret">, ER_FM<0x1f>; + /// Load-linked, Store-conditional let Predicates = [NotN64, HasStdEnc] in { def LL : LLBase<"ll", CPURegsOpnd, mem>, LW_FM<0x30>; |

