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 | 16f385f90f481195bfcf6b139ced4cee033bb887 (patch) | |
tree | 971d4f72b0bf0fca2858ffdade72ab7140fd47be /lib | |
parent | c88ac4a344bdb5b3ade5c24d67e1227c4d3a8978 (diff) | |
download | external_llvm-16f385f90f481195bfcf6b139ced4cee033bb887.zip external_llvm-16f385f90f481195bfcf6b139ced4cee033bb887.tar.gz external_llvm-16f385f90f481195bfcf6b139ced4cee033bb887.tar.bz2 |
Implement eret and deret(return from exception) instructions for Mips. Test examples are given.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186507 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/Mips/MipsInstrFormats.td | 13 | ||||
-rw-r--r-- | lib/Target/Mips/MipsInstrInfo.td | 8 |
2 files changed, 21 insertions, 0 deletions
diff --git a/lib/Target/Mips/MipsInstrFormats.td b/lib/Target/Mips/MipsInstrFormats.td index c2a5879..0ae93b4 100644 --- a/lib/Target/Mips/MipsInstrFormats.td +++ b/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/lib/Target/Mips/MipsInstrInfo.td b/lib/Target/Mips/MipsInstrInfo.td index 1bc1077..6082a3f 100644 --- a/lib/Target/Mips/MipsInstrInfo.td +++ b/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>; |