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
This commit is contained in:
Akira Hatanaka 2011-10-03 19:28:44 +00:00
parent ae59e8cd4d
commit 36787939b2
2 changed files with 27 additions and 0 deletions

View File

@ -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
//===----------------------------------------------------------------------===//

View File

@ -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),