]> granicus.if.org Git - llvm/commitdiff
[mips] not instruction alias
authorSimon Dardis <simon.dardis@imgtec.com>
Wed, 16 Nov 2016 11:04:49 +0000 (11:04 +0000)
committerSimon Dardis <simon.dardis@imgtec.com>
Wed, 16 Nov 2016 11:04:49 +0000 (11:04 +0000)
This patch adds the single operand form of the not alias to microMIPS and
MIPS along with additional tests.

This partially resolves PR/30381.

Thanks to Sean Bruno for reporting the issue!

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

20 files changed:
lib/Target/Mips/MicroMipsInstrInfo.td
lib/Target/Mips/MipsInstrInfo.td
test/MC/Mips/micromips/valid.s
test/MC/Mips/micromips32r6/valid.s
test/MC/Mips/micromips64r6/valid.s
test/MC/Mips/mips1/valid.s
test/MC/Mips/mips2/valid.s
test/MC/Mips/mips3/valid.s
test/MC/Mips/mips32/valid.s
test/MC/Mips/mips32r2/valid.s
test/MC/Mips/mips32r3/valid.s
test/MC/Mips/mips32r5/valid.s
test/MC/Mips/mips32r6/valid.s
test/MC/Mips/mips4/valid.s
test/MC/Mips/mips5/valid.s
test/MC/Mips/mips64/valid.s
test/MC/Mips/mips64r2/valid.s
test/MC/Mips/mips64r3/valid.s
test/MC/Mips/mips64r5/valid.s
test/MC/Mips/mips64r6/valid.s

index 66c2d8bfdc768a8697b21ce302bc4b83bbef2020..c55c19b3b294b26d2e70a0a936369f05a4aff43f 100644 (file)
@@ -1177,6 +1177,8 @@ let Predicates = [InMicroMips] in {
                       (XORi_MM GPR32Opnd:$rs, GPR32Opnd:$rs, uimm16:$imm), 0>;
   def : MipsInstAlias<"not $rt, $rs",
                       (NOR_MM GPR32Opnd:$rt, GPR32Opnd:$rs, ZERO), 0>;
+  def : MipsInstAlias<"not $rt",
+                      (NOR_MM GPR32Opnd:$rt, GPR32Opnd:$rt, ZERO), 0>;
   def : MipsInstAlias<"bnez $rs,$offset",
                       (BNE_MM GPR32Opnd:$rs, ZERO, brtarget:$offset), 0>;
   def : MipsInstAlias<"beqz $rs,$offset",
index 0c2ca67128c32fbf0947fa4b7086c0c64f511fed..22060dfc70e2c6826d63e1e96bfcb0e534df0295 100644 (file)
@@ -2348,6 +2348,9 @@ let AdditionalPredicates = [NotInMicroMips] in {
   def : MipsInstAlias<
           "not $rt, $rs",
           (NOR GPR32Opnd:$rt, GPR32Opnd:$rs, ZERO), 0>;
+  def : MipsInstAlias<
+          "not $rt",
+          (NOR GPR32Opnd:$rt, GPR32Opnd:$rt, ZERO), 0>;
   def : MipsInstAlias<"nop", (SLL ZERO, ZERO, 0), 1>;
 }
 def : MipsInstAlias<"mfc0 $rt, $rd", (MFC0 GPR32Opnd:$rt, COP0Opnd:$rd, 0), 0>;
index 7fd1f5728294ca5de0ef2890332beefdb9c709e8..4f8e5ae40325e344de90b822495780d4ac9e771e 100644 (file)
@@ -74,6 +74,7 @@ xor $3, $3, $5              # CHECK: xor $3, $3, $5         # encoding: [0x00,0x
 xori $9, $6, 17767          # CHECK: xori $9, $6, 17767     # encoding: [0x71,0x26,0x45,0x67]
 nor $9, $6, $7              # CHECK: nor $9, $6, $7         # encoding: [0x00,0xe6,0x4a,0xd0]
 not $7, $8                  # CHECK: not $7, $8             # encoding: [0x00,0x08,0x3a,0xd0]
+not $7                      # CHECK: not $7, $7             # encoding: [0x00,0x07,0x3a,0xd0]
 mul $9, $6, $7              # CHECK: mul $9, $6, $7         # encoding: [0x00,0xe6,0x4a,0x10]
 mult $9, $7                 # CHECK: mult $9, $7            # encoding: [0x00,0xe9,0x8b,0x3c]
 multu $9, $7                # CHECK: multu $9, $7           # encoding: [0x00,0xe9,0x9b,0x3c]
index 3323803212b0f91c7470efa2f9e98c6a920ff023..30a30400dfcb99f8fd3d2532f3d4f2f1fa345b57 100644 (file)
   and $3, 5                # CHECK: andi $3, $3, 5         # encoding: [0xd0,0x63,0x00,0x05]
   and $3, $4, 5            # CHECK: andi $3, $4, 5         # encoding: [0xd0,0x64,0x00,0x05]
   not $3, $4               # CHECK: not $3, $4             # encoding: [0x00,0x04,0x1a,0xd0]
+  not $3                   # CHECK: not $3, $3             # encoding: [0x00,0x03,0x1a,0xd0]
   or $3, 5                 # CHECK: ori $3, $3, 5          # encoding: [0x50,0x63,0x00,0x05]
   or $3, $4, 5             # CHECK: ori $3, $4, 5          # encoding: [0x50,0x64,0x00,0x05]
   xor $3, 5                # CHECK: xori $3, $3, 5         # encoding: [0x70,0x63,0x00,0x05]
index c07d7fd081fa51015fe152072c243611fb6de502..c103179aa7332498f7683944e78f0be66287d834 100644 (file)
@@ -293,6 +293,7 @@ a:
         andi $3, $4, 1234        # CHECK: andi $3, $4, 1234       # encoding: [0xd0,0x64,0x04,0xd2]
         nor $3, $4, $5           # CHECK: nor $3, $4, $5          # encoding: [0x00,0xa4,0x1a,0xd0]
         not $3, $4               # CHECK: not $3, $4              # encoding: [0x00,0x04,0x1a,0xd0]
+        not $3                   # CHECK: not $3, $3              # encoding: [0x00,0x03,0x1a,0xd0]
         or $3, 5                 # CHECK: ori $3, $3, 5           # encoding: [0x50,0x63,0x00,0x05]
         or $3, $4, 5             # CHECK: ori $3, $4, 5           # encoding: [0x50,0x64,0x00,0x05]
         or $3, $4, $5            # CHECK: or $3, $4, $5           # encoding: [0x00,0xa4,0x1a,0x90]
index 93502cc61668ee8b4becea9dbdc5bcf55fff493a..77c5c1f08ff2a0d21d49638c232b030c4eb5f1e9 100644 (file)
@@ -85,6 +85,8 @@ a:
         neg.s     $f1,$f15
         nop
         nor       $a3,$zero,$a3
+        not       $3, $4               # CHECK: not $3, $4             # encoding: [0x00,0x80,0x18,0x27]
+        not       $3                   # CHECK: not $3, $3             # encoding: [0x00,0x60,0x18,0x27]
         or        $12,$s0,$sp
         or        $2, 4                # CHECK: ori $2, $2, 4          # encoding: [0x34,0x42,0x00,0x04]
         sb        $s6,-19857($14)
index 3a5fd1cb28f5e02a77befea62f3c0bd684041029..c6d4205a8599b8a923cda50927db4c71bd1d9c41 100644 (file)
@@ -107,6 +107,8 @@ a:
         neg.s     $f1,$f15
         nop
         nor       $a3,$zero,$a3
+        not       $3, $4               # CHECK: not $3, $4             # encoding: [0x00,0x80,0x18,0x27]
+        not       $3                   # CHECK: not $3, $3             # encoding: [0x00,0x60,0x18,0x27]
         or        $12,$s0,$sp
         or        $2, 4                # CHECK: ori $2, $2, 4          # encoding: [0x34,0x42,0x00,0x04]
         round.w.d $f6,$f4
index 69244e35d2bdb1dc5bec13db2ad0abd0ef5ac37b..1f0e22dbe3f9e5a637fe42d1dbabeba8296a7a27 100644 (file)
@@ -167,6 +167,8 @@ a:
         neg.s     $f1,$f15
         nop
         nor       $a3,$zero,$a3
+        not       $3, $4               # CHECK: not $3, $4             # encoding: [0x00,0x80,0x18,0x27]
+        not       $3                   # CHECK: not $3, $3             # encoding: [0x00,0x60,0x18,0x27]
         or        $12,$s0,$sp
         or        $2, 4                # CHECK: ori $2, $2, 4          # encoding: [0x34,0x42,0x00,0x04]
         round.l.d $f12,$f1
index 3a052948b73de9ac8a2b509d7dc4a2292682c633..c24abe31fbd04249181149338f8b7ed99fbea3c4 100644 (file)
@@ -135,6 +135,8 @@ a:
         neg.s     $f1,$f15
         nop
         nor       $a3,$zero,$a3
+        not       $3, $4               # CHECK: not $3, $4             # encoding: [0x00,0x80,0x18,0x27]
+        not       $3                   # CHECK: not $3, $3             # encoding: [0x00,0x60,0x18,0x27]
         or        $12,$s0,$sp
         or        $2, 4                # CHECK: ori $2, $2, 4          # encoding: [0x34,0x42,0x00,0x04]
         pref      1, 8($5)             # CHECK: pref 1, 8($5)          # encoding: [0xcc,0xa1,0x00,0x08]
index 0ffddb0cdfea759b2e80709894bed770b4e45751..5fc40d640eeba2a3ba7fdc5f00d577fe8e0a7d48 100644 (file)
@@ -157,6 +157,8 @@ a:
         nmsub.s   $f1,$f24,$f19,$f4
         nop
         nor       $a3,$zero,$a3
+        not       $3, $4               # CHECK: not $3, $4              # encoding: [0x00,0x80,0x18,0x27]
+        not       $3                   # CHECK: not $3, $3              # encoding: [0x00,0x60,0x18,0x27]
         or        $12,$s0,$sp
         or        $2, 4                # CHECK: ori $2, $2, 4           # encoding: [0x34,0x42,0x00,0x04]
         pause                          # CHECK: pause # encoding:  [0x00,0x00,0x01,0x40]
index a05df83ac2d374146c6f0e8e45f3e462d436e79d..c9de31a62b8b35920d23f17a22915eb24f07405c 100644 (file)
@@ -157,6 +157,8 @@ a:
         nmsub.s   $f1,$f24,$f19,$f4
         nop
         nor       $a3,$zero,$a3
+        not       $3, $4               # CHECK: not $3, $4              # encoding: [0x00,0x80,0x18,0x27]
+        not       $3                   # CHECK: not $3, $3              # encoding: [0x00,0x60,0x18,0x27]
         or        $12,$s0,$sp
         or        $2, 4                # CHECK: ori $2, $2, 4           # encoding: [0x34,0x42,0x00,0x04]
         pause                          # CHECK: pause # encoding:  [0x00,0x00,0x01,0x40]
index 3100dd401d7bae0f3f9e181479eb4f38bfa7d2a4..31fb7439f16e190f1f80aeadae1ec28a45aa9d68 100644 (file)
@@ -158,6 +158,8 @@ a:
         nmsub.s   $f1,$f24,$f19,$f4
         nop
         nor       $a3,$zero,$a3
+        not       $3, $4               # CHECK: not $3, $4              # encoding: [0x00,0x80,0x18,0x27]
+        not       $3                   # CHECK: not $3, $3              # encoding: [0x00,0x60,0x18,0x27]
         or        $12,$s0,$sp
         or        $2, 4                # CHECK: ori $2, $2, 4           # encoding: [0x34,0x42,0x00,0x04]
         pause                          # CHECK: pause # encoding:  [0x00,0x00,0x01,0x40]
index f127c68d2d2b8efbf4f1839032a79659e50f326e..c037baa1c8bd0278720e05a74425890b122babfa 100644 (file)
@@ -136,6 +136,8 @@ a:
         neg       $2, $3         # CHECK: neg  $2, $3            # encoding: [0x00,0x03,0x10,0x22]
         negu      $2             # CHECK: negu $2, $2            # encoding: [0x00,0x02,0x10,0x23]
         negu      $2,$3          # CHECK: negu $2, $3            # encoding: [0x00,0x03,0x10,0x23]
+        not       $3, $4         # CHECK: not $3, $4             # encoding: [0x00,0x80,0x18,0x27]
+        not       $3             # CHECK: not $3, $3             # encoding: [0x00,0x60,0x18,0x27]
         pref    1, 8($5)         # CHECK: pref 1, 8($5)          # encoding: [0x7c,0xa1,0x04,0x35]
         # FIXME: Use the code generator in order to print the .set directives
         #        instead of the instruction printer.
index c8fb99bd9de935751b8f66e88b403ccc4bfc0b3d..62cd3905d4ef67846a4c72a01ecace50aeb28bc3 100644 (file)
@@ -193,6 +193,8 @@ a:
         nmsub.s   $f0, $f24, $f20, $f4    # encoding: [0x4f,0x04,0xa0,0x38]
         nop
         nor       $a3,$zero,$a3
+        not       $3, $4               # CHECK: not $3, $4             # encoding: [0x00,0x80,0x18,0x27]
+        not       $3                   # CHECK: not $3, $3             # encoding: [0x00,0x60,0x18,0x27]
         or        $12,$s0,$sp
         or        $2, 4                # CHECK: ori $2, $2, 4          # encoding: [0x34,0x42,0x00,0x04]
         pref      1, 8($5)             # CHECK: pref 1, 8($5)          # encoding: [0xcc,0xa1,0x00,0x08]
index 50f318dee0046feb2ffb8a2f0f8f838c8afb5dc5..77204f99608664e99869d93c8e108cf5f5650d4c 100644 (file)
@@ -194,6 +194,8 @@ a:
         nmsub.s   $f0, $f24, $f20, $f4    # encoding: [0x4f,0x04,0xa0,0x38]
         nop
         nor       $a3,$zero,$a3
+        not       $3, $4               # CHECK: not $3, $4             # encoding: [0x00,0x80,0x18,0x27]
+        not       $3                   # CHECK: not $3, $3             # encoding: [0x00,0x60,0x18,0x27]
         or        $12,$s0,$sp
         or        $2, 4                # CHECK: ori $2, $2, 4          # encoding: [0x34,0x42,0x00,0x04]
         pref      1, 8($5)             # CHECK: pref 1, 8($5)          # encoding: [0xcc,0xa1,0x00,0x08]
index 6235b89e182493170a40f56b5b0b0f1ec7cbe6e2..f34bfafa8fc2ffbf45ea9b41250a1670ced97e29 100644 (file)
@@ -210,6 +210,8 @@ a:
         nmsub.s   $f0, $f24, $f20, $f4    # encoding: [0x4f,0x04,0xa0,0x38]
         nop
         nor       $a3,$zero,$a3
+        not       $3, $4               # CHECK: not $3, $4             # encoding: [0x00,0x80,0x18,0x27]
+        not       $3                   # CHECK: not $3, $3             # encoding: [0x00,0x60,0x18,0x27]
         or        $12,$s0,$sp
         or        $2, 4                # CHECK: ori $2, $2, 4          # encoding: [0x34,0x42,0x00,0x04]
         pref      1, 8($5)             # CHECK: pref 1, 8($5)          # encoding: [0xcc,0xa1,0x00,0x08]
index 43f6b73b68e8b0be05e999e92ae7613e74fc39d0..edb157d9122313e63c6401fdf9d7028e3e7a4486 100644 (file)
@@ -224,6 +224,8 @@ a:
         nmsub.s   $f1,$f24,$f19,$f4
         nop
         nor       $a3,$zero,$a3
+        not       $3, $4               # CHECK: not $3, $4              # encoding: [0x00,0x80,0x18,0x27]
+        not       $3                   # CHECK: not $3, $3              # encoding: [0x00,0x60,0x18,0x27]
         or        $12,$s0,$sp
         or        $2, 4                # CHECK: ori $2, $2, 4           # encoding: [0x34,0x42,0x00,0x04]
         pause                          # CHECK: pause # encoding:  [0x00,0x00,0x01,0x40]
index e8a65abd9762124ac0192290291501a2cc269936..6de77552025056deaadc028bb11c0d96a4500f0b 100644 (file)
@@ -224,6 +224,8 @@ a:
         nmsub.s   $f1,$f24,$f19,$f4
         nop
         nor       $a3,$zero,$a3
+        not       $3, $4               # CHECK: not $3, $4              # encoding: [0x00,0x80,0x18,0x27]
+        not       $3                   # CHECK: not $3, $3              # encoding: [0x00,0x60,0x18,0x27]
         or        $12,$s0,$sp
         or        $2, 4                # CHECK: ori $2, $2, 4           # encoding: [0x34,0x42,0x00,0x04]
         pause                          # CHECK: pause # encoding:  [0x00,0x00,0x01,0x40]
index 392fe3f65666ff45c1645496c244cebe65cf1d4e..0a3b78175a84d489a3fdd0a260f7ec267b393158 100644 (file)
@@ -225,6 +225,8 @@ a:
         nmsub.s   $f1,$f24,$f19,$f4
         nop
         nor       $a3,$zero,$a3
+        not       $3, $4               # CHECK: not $3, $4              # encoding: [0x00,0x80,0x18,0x27]
+        not       $3                   # CHECK: not $3, $3              # encoding: [0x00,0x60,0x18,0x27]
         or        $12,$s0,$sp
         or        $2, 4                # CHECK: ori $2, $2, 4           # encoding: [0x34,0x42,0x00,0x04]
         pause                          # CHECK: pause # encoding:  [0x00,0x00,0x01,0x40]
index 90b066b84afcf0b335a7976c1c24d76aa9bbc750..0ed51f5a546c3653c3d58619bb04da3cd9731220 100644 (file)
@@ -190,6 +190,8 @@ a:
         neg       $2, $3         # CHECK: neg  $2, $3            # encoding: [0x00,0x03,0x10,0x22]
         negu      $2             # CHECK: negu $2, $2            # encoding: [0x00,0x02,0x10,0x23]
         negu      $2,$3          # CHECK: negu $2, $3            # encoding: [0x00,0x03,0x10,0x23]
+        not       $3, $4         # CHECK: not $3, $4             # encoding: [0x00,0x80,0x18,0x27]
+        not       $3             # CHECK: not $3, $3             # encoding: [0x00,0x60,0x18,0x27]
         or      $2, 4            # CHECK: ori $2, $2, 4          # encoding: [0x34,0x42,0x00,0x04]
         pref    1, 8($5)         # CHECK: pref 1, 8($5)          # encoding: [0x7c,0xa1,0x04,0x35]
         # FIXME: Use the code generator in order to print the .set directives