[mips] Add instruction alias (negu).
authorMatheus Almeida <matheus.almeida@imgtec.com>
Wed, 30 Apr 2014 16:53:49 +0000 (16:53 +0000)
committerMatheus Almeida <matheus.almeida@imgtec.com>
Wed, 30 Apr 2014 16:53:49 +0000 (16:53 +0000)
Summary: negu $reg is equivalent to negu $reg, $reg.

Reviewers: dsanders

Reviewed By: dsanders

Differential Revision: http://reviews.llvm.org/D3510

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

lib/Target/Mips/MipsInstrInfo.td
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/mips4/valid.s
test/MC/Mips/mips5/valid.s
test/MC/Mips/mips64/valid.s
test/MC/Mips/mips64r2/valid.s

index 62cb7c335919fafa5a5699caef6c8ea368e9179f..a1c49c0ccf9f6d78aab8f2135dea444cfadd5165 100644 (file)
@@ -1215,6 +1215,8 @@ def : InstAlias<"not $rt, $rs",
                 (NOR GPR32Opnd:$rt, GPR32Opnd:$rs, ZERO), 0>;
 def : InstAlias<"neg $rt, $rs",
                 (SUB GPR32Opnd:$rt, ZERO, GPR32Opnd:$rs), 1>;
+def : InstAlias<"negu $rt",
+                (SUBu GPR32Opnd:$rt, ZERO, GPR32Opnd:$rt), 0>;
 def : InstAlias<"negu $rt, $rs",
                 (SUBu GPR32Opnd:$rt, ZERO, GPR32Opnd:$rs), 1>;
 def : InstAlias<"slt $rs, $rt, $imm",
index 33968f9fe96aa4fb769ef8896842500aa16577e9..baf698cba550d244cc52ffb13533678038e18976 100644 (file)
@@ -58,6 +58,8 @@
        mult    $sp,$v0
        multu   $gp,$k0
        multu   $t1,$s2
+       negu    $2                   # CHECK: negu $2, $2            # encoding: [0x00,0x02,0x10,0x23]
+       negu    $2,$3                # CHECK: negu $2, $3            # encoding: [0x00,0x03,0x10,0x23]
        neg.d   $f27,$f18
        neg.s   $f1,$f15
        nop
index 7772a001a3ca088b62b3f25888b17c47c4489dc3..112b1ac385fa7c51f77683fe5238c68ceadd9042 100644 (file)
@@ -65,6 +65,8 @@
        mult    $sp,$v0
        multu   $gp,$k0
        multu   $t1,$s2
+       negu    $2                   # CHECK: negu $2, $2            # encoding: [0x00,0x02,0x10,0x23]
+       negu    $2,$3                # CHECK: negu $2, $3            # encoding: [0x00,0x03,0x10,0x23]
        neg.d   $f27,$f18
        neg.s   $f1,$f15
        nop
index ba37441ee6edbe2588adf276de8cfbae44e44c50..34f1919fc6f878daf53c1736305647b7e8f70ab3 100644 (file)
        mult    $sp,$v0
        multu   $gp,$k0
        multu   $t1,$s2
+       negu    $2                   # CHECK: negu $2, $2            # encoding: [0x00,0x02,0x10,0x23]
+       negu    $2,$3                # CHECK: negu $2, $3            # encoding: [0x00,0x03,0x10,0x23]
        neg.d   $f27,$f18
        neg.s   $f1,$f15
        nop
index e13edc1d7e5c2216c404d842a4531b2a6a4a4a83..52e5c2610e54ae0e1908e09f0fee9e034ec28a24 100644 (file)
@@ -89,6 +89,8 @@
        mult    $sp,$v0
        multu   $gp,$k0
        multu   $t1,$s2
+       negu    $2                   # CHECK: negu $2, $2            # encoding: [0x00,0x02,0x10,0x23]
+       negu    $2,$3                # CHECK: negu $2, $3            # encoding: [0x00,0x03,0x10,0x23]
        neg.d   $f27,$f18
        neg.s   $f1,$f15
        nop
index b30485c881948fbe1f6488bbded8051f5b34c286..31c8174e40d061a5ab6c8d7604507402031b9e66 100644 (file)
        mult    $sp,$v0
        multu   $gp,$k0
        multu   $t1,$s2
+       negu    $2                   # CHECK: negu $2, $2            # encoding: [0x00,0x02,0x10,0x23]
+       negu    $2,$3                # CHECK: negu $2, $3            # encoding: [0x00,0x03,0x10,0x23]
        neg.d   $f27,$f18
        neg.s   $f1,$f15
        nmadd.d $f18,$f9,$f14,$f19
index 2b002b9179dfd32a3381bd5e0d22249506fb0750..054e0e2271c7f72874d7ea6331cbb3dc953ce205 100644 (file)
        mult    $sp,$v0
        multu   $gp,$k0
        multu   $t1,$s2
+       negu    $2                   # CHECK: negu $2, $2            # encoding: [0x00,0x02,0x10,0x23]
+       negu    $2,$3                # CHECK: negu $2, $3            # encoding: [0x00,0x03,0x10,0x23]
        neg.d   $f27,$f18
        neg.s   $f1,$f15
        nop
index a65514b76943b137c09b0e2323a0bf56e5901e75..cbf7513407e45cd3c26126e3161cf00ee73c1f27 100644 (file)
        mult    $sp,$v0
        multu   $gp,$k0
        multu   $t1,$s2
+       negu    $2                   # CHECK: negu $2, $2            # encoding: [0x00,0x02,0x10,0x23]
+       negu    $2,$3                # CHECK: negu $2, $3            # encoding: [0x00,0x03,0x10,0x23]
        neg.d   $f27,$f18
        neg.s   $f1,$f15
        nop
index 04c2f5b6f9a151cbb0e63fc2d8e7a390e553db41..72203868352e2f70424dfd112779223e69178079 100644 (file)
        mult    $sp,$v0
        multu   $gp,$k0
        multu   $t1,$s2
+       negu    $2                   # CHECK: negu $2, $2            # encoding: [0x00,0x02,0x10,0x23]
+       negu    $2,$3                # CHECK: negu $2, $3            # encoding: [0x00,0x03,0x10,0x23]
        neg.d   $f27,$f18
        neg.s   $f1,$f15
        nop
index 99f19f68a446869c57850f45d82c227df87c8a72..f64f42bb36be8ccf0bebd736782e44ff9e8c56d7 100644 (file)
        mult    $sp,$v0
        multu   $gp,$k0
        multu   $t1,$s2
+       negu    $2                   # CHECK: negu $2, $2            # encoding: [0x00,0x02,0x10,0x23]
+       negu    $2,$3                # CHECK: negu $2, $3            # encoding: [0x00,0x03,0x10,0x23]
        neg.d   $f27,$f18
        neg.s   $f1,$f15
        nmadd.s $f0,$f5,$f25,$f12