diff options
author | Akira Hatanaka <ahatanaka@mips.com> | 2011-10-03 19:28:44 +0000 |
---|---|---|
committer | Akira Hatanaka <ahatanaka@mips.com> | 2011-10-03 19:28:44 +0000 |
commit | 36787939b27d9b238e10fc4ba42cb621003a5a31 (patch) | |
tree | 392a674258303f65378b4a9038a0591c2191c622 | |
parent | ae59e8cd4d65bf5edb488f0b0d2581bda4bf0995 (diff) | |
download | external_llvm-36787939b27d9b238e10fc4ba42cb621003a5a31.zip external_llvm-36787939b27d9b238e10fc4ba42cb621003a5a31.tar.gz external_llvm-36787939b27d9b238e10fc4ba42cb621003a5a31.tar.bz2 |
Add definitions of instructions which move values between 64-bit integer
registers and 64-bit HI and LO registers. Fix encoding of the 32-bit versions
of the instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141015 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/Mips/Mips64InstrInfo.td | 23 | ||||
-rw-r--r-- | lib/Target/Mips/MipsInstrInfo.td | 4 |
2 files changed, 27 insertions, 0 deletions
diff --git a/lib/Target/Mips/Mips64InstrInfo.td b/lib/Target/Mips/Mips64InstrInfo.td index 6d89a0e..3e65f99 100644 --- a/lib/Target/Mips/Mips64InstrInfo.td +++ b/lib/Target/Mips/Mips64InstrInfo.td @@ -90,6 +90,19 @@ class LogicR_shift_rotate_reg64<bits<6> func, bits<5> _shamt, string instr_asm, let shamt = _shamt; } +// Move from Hi/Lo +let shamt = 0 in { +let rs = 0, rt = 0 in +class MoveFromLOHI64<bits<6> func, string instr_asm>: + FR<0x00, func, (outs CPU64Regs:$dst), (ins), + !strconcat(instr_asm, "\t$dst"), [], IIHiLo>; + +let rt = 0, rd = 0 in +class MoveToLOHI64<bits<6> func, string instr_asm>: + FR<0x00, func, (outs), (ins CPU64Regs:$src), + !strconcat(instr_asm, "\t$src"), [], IIHiLo>; +} + //===----------------------------------------------------------------------===// // Instruction definition //===----------------------------------------------------------------------===// @@ -126,6 +139,16 @@ let Predicates = [HasMips64r2] in { def DROTRV : LogicR_shift_rotate_reg64<0x16, 0x01, "drotrv", rotr>; } +let Defs = [HI64] in + def MTHI64 : MoveToLOHI64<0x11, "mthi">; +let Defs = [LO64] in + def MTLO64 : MoveToLOHI64<0x13, "mtlo">; + +let Uses = [HI64] in + def MFHI64 : MoveFromLOHI64<0x10, "mfhi">; +let Uses = [LO64] in + def MFLO64 : MoveFromLOHI64<0x12, "mflo">; + //===----------------------------------------------------------------------===// // Arbitrary patterns that map to one or more instructions //===----------------------------------------------------------------------===// diff --git a/lib/Target/Mips/MipsInstrInfo.td b/lib/Target/Mips/MipsInstrInfo.td index 454b636..cac64e5 100644 --- a/lib/Target/Mips/MipsInstrInfo.td +++ b/lib/Target/Mips/MipsInstrInfo.td @@ -359,13 +359,17 @@ let Defs = [HI, LO] in { } // Move from Hi/Lo +let shamt = 0 in { +let rs = 0, rt = 0 in class MoveFromLOHI<bits<6> func, string instr_asm>: FR<0x00, func, (outs CPURegs:$dst), (ins), !strconcat(instr_asm, "\t$dst"), [], IIHiLo>; +let rt = 0, rd = 0 in class MoveToLOHI<bits<6> func, string instr_asm>: FR<0x00, func, (outs), (ins CPURegs:$src), !strconcat(instr_asm, "\t$src"), [], IIHiLo>; +} class EffectiveAddress<string instr_asm> : FI<0x09, (outs CPURegs:$dst), (ins mem_ea:$addr), |