mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-11 11:34:02 +00:00
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:
parent
ae59e8cd4d
commit
36787939b2
@ -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
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
@ -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),
|
||||
|
Loading…
x
Reference in New Issue
Block a user