[llvm-commits] [llvm] r141015 - in /llvm/trunk/lib/Target/Mips: Mips64InstrInfo.td MipsInstrInfo.td

Akira Hatanaka ahatanaka at mips.com
Mon Oct 3 12:28:50 PDT 2011


Author: ahatanak
Date: Mon Oct  3 14:28:44 2011
New Revision: 141015

URL: http://llvm.org/viewvc/llvm-project?rev=141015&view=rev
Log:
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.


Modified:
    llvm/trunk/lib/Target/Mips/Mips64InstrInfo.td
    llvm/trunk/lib/Target/Mips/MipsInstrInfo.td

Modified: llvm/trunk/lib/Target/Mips/Mips64InstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/Mips64InstrInfo.td?rev=141015&r1=141014&r2=141015&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/Mips64InstrInfo.td (original)
+++ llvm/trunk/lib/Target/Mips/Mips64InstrInfo.td Mon Oct  3 14:28:44 2011
@@ -90,6 +90,19 @@
   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 @@
   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
 //===----------------------------------------------------------------------===//

Modified: llvm/trunk/lib/Target/Mips/MipsInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsInstrInfo.td?rev=141015&r1=141014&r2=141015&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsInstrInfo.td (original)
+++ llvm/trunk/lib/Target/Mips/MipsInstrInfo.td Mon Oct  3 14:28:44 2011
@@ -359,13 +359,17 @@
 }
 
 // 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),





More information about the llvm-commits mailing list