[PATCH] D15009: [mips][microMIPS] Implement ldpc instruction

Zoran Jovanovic via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 26 03:02:00 PST 2015


zoran.jovanovic created this revision.
zoran.jovanovic added reviewers: dsanders, hvarga, zbuljan.
zoran.jovanovic added a subscriber: llvm-commits.
Herald added a subscriber: dsanders.

http://reviews.llvm.org/D15009

Files:
  lib/Target/Mips/MicroMips64r6InstrFormats.td
  lib/Target/Mips/MicroMips64r6InstrInfo.td
  lib/Target/Mips/Mips64r6InstrInfo.td
  test/MC/Disassembler/Mips/micromips64r6/valid.txt
  test/MC/Mips/micromips64r6/valid.s

Index: test/MC/Mips/micromips64r6/valid.s
===================================================================
--- test/MC/Mips/micromips64r6/valid.s
+++ test/MC/Mips/micromips64r6/valid.s
@@ -21,6 +21,7 @@
         dextm $9, $6, 3, 7       # CHECK: dextm $9, $6, 3, 7  # encoding: [0x59,0x26,0x30,0xe4]
         dextu $9, $6, 3, 7       # CHECK: dextu $9, $6, 3, 7  # encoding: [0x59,0x26,0x30,0xd4]
         dalign $4, $2, $3, 5     # CHECK: dalign $4, $2, $3, 5  # encoding: [0x58,0x43,0x25,0x1c]
+        ldpc $2, 16              # CHECK: ldpc $2, 16         # encoding: [0x78,0x58,0x00,0x04]
         lw $3, 32($gp)           # CHECK: lw $3, 32($gp)        # encoding: [0x65,0x88]
         lw $3, 24($sp)           # CHECK: lw $3, 24($sp)        # encoding: [0x48,0x66]
         lw16 $4, 8($17)          # CHECK: lw16 $4, 8($17)       # encoding: [0x6a,0x12]
Index: test/MC/Disassembler/Mips/micromips64r6/valid.txt
===================================================================
--- test/MC/Disassembler/Mips/micromips64r6/valid.txt
+++ test/MC/Disassembler/Mips/micromips64r6/valid.txt
@@ -131,6 +131,7 @@
 0x60 0x25 0xa6 0x08 # CHECK: cachee 1, 8($5)
 0x00 0x64 0xf1 0x7c # CHECK: wrpgpr $3, $4
 0x00 0x64 0x7b 0x3c # CHECK: wsbh $3, $4
+0x78 0x58 0x00 0x04 # CHECK: ldpc    $2, 16
 0x65 0x88 # CHECK: lw $3, 32($gp)
 0x48 0x66 # CHECK: lw $3, 24($sp)
 0x6a 0x12 # CHECK: lw16 $4, 8($17)
Index: lib/Target/Mips/Mips64r6InstrInfo.td
===================================================================
--- lib/Target/Mips/Mips64r6InstrInfo.td
+++ lib/Target/Mips/Mips64r6InstrInfo.td
@@ -99,7 +99,7 @@
 def DMUHU: DMUHU_ENC, DMUHU_DESC, ISA_MIPS64R6;
 def DMUL_R6: DMUL_R6_ENC, DMUL_R6_DESC, ISA_MIPS64R6;
 def DMULU: DMULU_ENC, DMULU_DESC, ISA_MIPS64R6;
-def LDPC: LDPC_ENC, LDPC_DESC, ISA_MIPS64R6;
+def LDPC: R6MMR6Rel, LDPC_ENC, LDPC_DESC, ISA_MIPS64R6;
 def LLD_R6 : LLD_R6_ENC, LLD_R6_DESC, ISA_MIPS32R6;
 def SCD_R6 : SCD_R6_ENC, SCD_R6_DESC, ISA_MIPS32R6;
 let DecoderNamespace = "Mips32r6_64r6_GP64" in {
Index: lib/Target/Mips/MicroMips64r6InstrInfo.td
===================================================================
--- lib/Target/Mips/MicroMips64r6InstrInfo.td
+++ lib/Target/Mips/MicroMips64r6InstrInfo.td
@@ -28,6 +28,7 @@
 class DMOD_MM64R6_ENC : POOL32A_DIVMOD_FM_MMR6<"dmod", 0b101011000>;
 class DDIVU_MM64R6_ENC : POOL32A_DIVMOD_FM_MMR6<"ddivu", 0b110011000>;
 class DMODU_MM64R6_ENC : POOL32A_DIVMOD_FM_MMR6<"dmodu", 0b111011000>;
+class LDPC_MMR646_ENC : PCREL18_FM_MMR6<0b110>;
 
 //===----------------------------------------------------------------------===//
 //
@@ -86,6 +87,8 @@
 class DDIVU_MM64R6_DESC : ArithLogicR<"ddivu", GPR32Opnd>;
 class DMODU_MM64R6_DESC : ArithLogicR<"dmodu", GPR32Opnd>;
 
+class LDPC_MM64R6_DESC : PCREL_MMR6_DESC_BASE<"ldpc", GPR64Opnd, simm19_lsl2>;
+
 //===----------------------------------------------------------------------===//
 //
 // Instruction Definitions
@@ -112,4 +115,6 @@
                      ISA_MICROMIPS64R6;
   def DMODU_MM64R6 : R6MMR6Rel, DMODU_MM64R6_DESC, DMODU_MM64R6_ENC,
                      ISA_MICROMIPS64R6;
+  def LDPC_MM64R6 :  R6MMR6Rel, LDPC_MMR646_ENC, LDPC_MM64R6_DESC,
+                     ISA_MICROMIPS64R6;
 }
Index: lib/Target/Mips/MicroMips64r6InstrFormats.td
===================================================================
--- lib/Target/Mips/MicroMips64r6InstrFormats.td
+++ lib/Target/Mips/MicroMips64r6InstrFormats.td
@@ -84,3 +84,15 @@
   let Inst{10-9}  = 0b00;
   let Inst{8-0}  = funct;
 }
+
+class PCREL18_FM_MMR6<bits<3> funct> : MipsR6Inst {
+  bits<5> rt;
+  bits<18> imm;
+
+  bits<32> Inst;
+
+  let Inst{31-26} = 0b011110;
+  let Inst{25-21} = rt;
+  let Inst{20-18} = funct;
+  let Inst{17-0} = imm;
+}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15009.41224.patch
Type: text/x-patch
Size: 3736 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151126/29c503ba/attachment.bin>


More information about the llvm-commits mailing list