]> granicus.if.org Git - llvm/commitdiff
[mips] correct operand range for DINSM instruction
authorPetar Jovanovic <petar.jovanovic@imgtec.com>
Wed, 13 Sep 2017 14:09:13 +0000 (14:09 +0000)
committerPetar Jovanovic <petar.jovanovic@imgtec.com>
Wed, 13 Sep 2017 14:09:13 +0000 (14:09 +0000)
This patch corrects the definition of the DINSM instruction.
Specification for DINSM instruction for Mips64 says that size operand should
be 2 <= size <= 64, but it is defined as uimm5_inssize_plus1 which gives
range of 1 .. 32.

Patch by Aleksandar Beserminji.

Differential Revision: https://reviews.llvm.org/D37683

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313149 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Mips/Mips64InstrInfo.td
test/MC/Mips/mips64r2/valid.s
test/MC/Mips/mips64r6/valid.s

index f367ff03a96b399a1e434830d44e2b7a445e087a..5082e4bab622a97c762eba6d2185aae2ac3236da 100644 (file)
@@ -331,7 +331,7 @@ let AdditionalPredicates = [NotInMicroMips] in {
              EXT_FM<7>, ISA_MIPS64R2;
   def DINSU : InsBase<"dinsu", GPR64Opnd, uimm5_plus32, uimm5_inssize_plus1>,
               EXT_FM<6>, ISA_MIPS64R2;
-  def DINSM : InsBase<"dinsm", GPR64Opnd, uimm5, uimm5_inssize_plus1>,
+  def DINSM : InsBase<"dinsm", GPR64Opnd, uimm5, uimm_range_2_64>,
               EXT_FM<5>, ISA_MIPS64R2;
 }
 
index 0826391fcaaff938f8ff071ff4db1bc23586d2e5..4f6258e11f4e030d3bd528f622a22dd5b4c2e4f3 100644 (file)
@@ -106,6 +106,7 @@ a:
         deret
         di        $s8                  # CHECK: di  $fp        # encoding: [0x41,0x7e,0x60,0x00]
         di                             # CHECK: di             # encoding: [0x41,0x60,0x60,0x00]
+        dinsm     $2,$3,4,34           # CHECK: dinsm $2, $3, 4, 34    # encoding: [0x7c,0x62,0x29,0x05]
         ddiv      $zero,$k0,$s3
         ddivu     $zero,$s0,$s1
         div       $zero,$25,$11
index e04725c2329657405a24f918abe1875d17fec872..f6cf6d45bee853ec8ace8409231f51a00809c24e 100644 (file)
@@ -114,6 +114,7 @@ a:
         ddivu   $2,$3,$4         # CHECK: ddivu $2, $3, $4 # encoding: [0x00,0x64,0x10,0x9f]
         di                       # CHECK: di               # encoding: [0x41,0x60,0x60,0x00]
         di      $s8              # CHECK: di  $fp          # encoding: [0x41,0x7e,0x60,0x00]
+        dinsm   $2,$3,4,34       # CHECK: dinsm $2, $3, 4, 34    # encoding: [0x7c,0x62,0x29,0x05]
         div     $2,$3,$4         # CHECK: div $2, $3, $4   # encoding: [0x00,0x64,0x10,0x9a]
         divu    $2,$3,$4         # CHECK: divu $2, $3, $4  # encoding: [0x00,0x64,0x10,0x9b]
         dlsa    $2, $3, $4, 3    # CHECK: dlsa $2, $3, $4, 3 # encoding: [0x00,0x64,0x10,0x95]