diff options
| author | Simon Dardis <simon.dardis@imgtec.com> | 2016-11-16 11:04:49 +0000 |
|---|---|---|
| committer | Simon Dardis <simon.dardis@imgtec.com> | 2016-11-16 11:04:49 +0000 |
| commit | 7b7cb8d9ddc095c5f1fc9159bd487b3754c03ec5 (patch) | |
| tree | fc851504e8fc52a541d1509fffc1188a45d8df5e /llvm | |
| parent | 8cb1cd9b7bb96e311e75b5427113f920ec0b6289 (diff) | |
| download | bcm5719-llvm-7b7cb8d9ddc095c5f1fc9159bd487b3754c03ec5.tar.gz bcm5719-llvm-7b7cb8d9ddc095c5f1fc9159bd487b3754c03ec5.zip | |
[mips] not instruction alias
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!
llvm-svn: 287097
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/Target/Mips/MicroMipsInstrInfo.td | 2 | ||||
| -rw-r--r-- | llvm/lib/Target/Mips/MipsInstrInfo.td | 3 | ||||
| -rw-r--r-- | llvm/test/MC/Mips/micromips/valid.s | 1 | ||||
| -rw-r--r-- | llvm/test/MC/Mips/micromips32r6/valid.s | 1 | ||||
| -rw-r--r-- | llvm/test/MC/Mips/micromips64r6/valid.s | 1 | ||||
| -rw-r--r-- | llvm/test/MC/Mips/mips1/valid.s | 2 | ||||
| -rw-r--r-- | llvm/test/MC/Mips/mips2/valid.s | 2 | ||||
| -rw-r--r-- | llvm/test/MC/Mips/mips3/valid.s | 2 | ||||
| -rw-r--r-- | llvm/test/MC/Mips/mips32/valid.s | 2 | ||||
| -rw-r--r-- | llvm/test/MC/Mips/mips32r2/valid.s | 2 | ||||
| -rw-r--r-- | llvm/test/MC/Mips/mips32r3/valid.s | 2 | ||||
| -rw-r--r-- | llvm/test/MC/Mips/mips32r5/valid.s | 2 | ||||
| -rw-r--r-- | llvm/test/MC/Mips/mips32r6/valid.s | 2 | ||||
| -rw-r--r-- | llvm/test/MC/Mips/mips4/valid.s | 2 | ||||
| -rw-r--r-- | llvm/test/MC/Mips/mips5/valid.s | 2 | ||||
| -rw-r--r-- | llvm/test/MC/Mips/mips64/valid.s | 2 | ||||
| -rw-r--r-- | llvm/test/MC/Mips/mips64r2/valid.s | 2 | ||||
| -rw-r--r-- | llvm/test/MC/Mips/mips64r3/valid.s | 2 | ||||
| -rw-r--r-- | llvm/test/MC/Mips/mips64r5/valid.s | 2 | ||||
| -rw-r--r-- | llvm/test/MC/Mips/mips64r6/valid.s | 2 |
20 files changed, 38 insertions, 0 deletions
diff --git a/llvm/lib/Target/Mips/MicroMipsInstrInfo.td b/llvm/lib/Target/Mips/MicroMipsInstrInfo.td index 66c2d8bfdc7..c55c19b3b29 100644 --- a/llvm/lib/Target/Mips/MicroMipsInstrInfo.td +++ b/llvm/lib/Target/Mips/MicroMipsInstrInfo.td @@ -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", diff --git a/llvm/lib/Target/Mips/MipsInstrInfo.td b/llvm/lib/Target/Mips/MipsInstrInfo.td index 0c2ca67128c..22060dfc70e 100644 --- a/llvm/lib/Target/Mips/MipsInstrInfo.td +++ b/llvm/lib/Target/Mips/MipsInstrInfo.td @@ -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>; diff --git a/llvm/test/MC/Mips/micromips/valid.s b/llvm/test/MC/Mips/micromips/valid.s index 7fd1f572829..4f8e5ae4032 100644 --- a/llvm/test/MC/Mips/micromips/valid.s +++ b/llvm/test/MC/Mips/micromips/valid.s @@ -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] diff --git a/llvm/test/MC/Mips/micromips32r6/valid.s b/llvm/test/MC/Mips/micromips32r6/valid.s index 3323803212b..30a30400dfc 100644 --- a/llvm/test/MC/Mips/micromips32r6/valid.s +++ b/llvm/test/MC/Mips/micromips32r6/valid.s @@ -359,6 +359,7 @@ 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] diff --git a/llvm/test/MC/Mips/micromips64r6/valid.s b/llvm/test/MC/Mips/micromips64r6/valid.s index c07d7fd081f..c103179aa73 100644 --- a/llvm/test/MC/Mips/micromips64r6/valid.s +++ b/llvm/test/MC/Mips/micromips64r6/valid.s @@ -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] diff --git a/llvm/test/MC/Mips/mips1/valid.s b/llvm/test/MC/Mips/mips1/valid.s index 93502cc6166..77c5c1f08ff 100644 --- a/llvm/test/MC/Mips/mips1/valid.s +++ b/llvm/test/MC/Mips/mips1/valid.s @@ -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) diff --git a/llvm/test/MC/Mips/mips2/valid.s b/llvm/test/MC/Mips/mips2/valid.s index 3a5fd1cb28f..c6d4205a859 100644 --- a/llvm/test/MC/Mips/mips2/valid.s +++ b/llvm/test/MC/Mips/mips2/valid.s @@ -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 diff --git a/llvm/test/MC/Mips/mips3/valid.s b/llvm/test/MC/Mips/mips3/valid.s index 69244e35d2b..1f0e22dbe3f 100644 --- a/llvm/test/MC/Mips/mips3/valid.s +++ b/llvm/test/MC/Mips/mips3/valid.s @@ -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 diff --git a/llvm/test/MC/Mips/mips32/valid.s b/llvm/test/MC/Mips/mips32/valid.s index 3a052948b73..c24abe31fbd 100644 --- a/llvm/test/MC/Mips/mips32/valid.s +++ b/llvm/test/MC/Mips/mips32/valid.s @@ -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] diff --git a/llvm/test/MC/Mips/mips32r2/valid.s b/llvm/test/MC/Mips/mips32r2/valid.s index 0ffddb0cdfe..5fc40d640ee 100644 --- a/llvm/test/MC/Mips/mips32r2/valid.s +++ b/llvm/test/MC/Mips/mips32r2/valid.s @@ -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] diff --git a/llvm/test/MC/Mips/mips32r3/valid.s b/llvm/test/MC/Mips/mips32r3/valid.s index a05df83ac2d..c9de31a62b8 100644 --- a/llvm/test/MC/Mips/mips32r3/valid.s +++ b/llvm/test/MC/Mips/mips32r3/valid.s @@ -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] diff --git a/llvm/test/MC/Mips/mips32r5/valid.s b/llvm/test/MC/Mips/mips32r5/valid.s index 3100dd401d7..31fb7439f16 100644 --- a/llvm/test/MC/Mips/mips32r5/valid.s +++ b/llvm/test/MC/Mips/mips32r5/valid.s @@ -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] diff --git a/llvm/test/MC/Mips/mips32r6/valid.s b/llvm/test/MC/Mips/mips32r6/valid.s index f127c68d2d2..c037baa1c8b 100644 --- a/llvm/test/MC/Mips/mips32r6/valid.s +++ b/llvm/test/MC/Mips/mips32r6/valid.s @@ -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. diff --git a/llvm/test/MC/Mips/mips4/valid.s b/llvm/test/MC/Mips/mips4/valid.s index c8fb99bd9de..62cd3905d4e 100644 --- a/llvm/test/MC/Mips/mips4/valid.s +++ b/llvm/test/MC/Mips/mips4/valid.s @@ -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] diff --git a/llvm/test/MC/Mips/mips5/valid.s b/llvm/test/MC/Mips/mips5/valid.s index 50f318dee00..77204f99608 100644 --- a/llvm/test/MC/Mips/mips5/valid.s +++ b/llvm/test/MC/Mips/mips5/valid.s @@ -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] diff --git a/llvm/test/MC/Mips/mips64/valid.s b/llvm/test/MC/Mips/mips64/valid.s index 6235b89e182..f34bfafa8fc 100644 --- a/llvm/test/MC/Mips/mips64/valid.s +++ b/llvm/test/MC/Mips/mips64/valid.s @@ -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] diff --git a/llvm/test/MC/Mips/mips64r2/valid.s b/llvm/test/MC/Mips/mips64r2/valid.s index 43f6b73b68e..edb157d9122 100644 --- a/llvm/test/MC/Mips/mips64r2/valid.s +++ b/llvm/test/MC/Mips/mips64r2/valid.s @@ -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] diff --git a/llvm/test/MC/Mips/mips64r3/valid.s b/llvm/test/MC/Mips/mips64r3/valid.s index e8a65abd976..6de77552025 100644 --- a/llvm/test/MC/Mips/mips64r3/valid.s +++ b/llvm/test/MC/Mips/mips64r3/valid.s @@ -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] diff --git a/llvm/test/MC/Mips/mips64r5/valid.s b/llvm/test/MC/Mips/mips64r5/valid.s index 392fe3f6566..0a3b78175a8 100644 --- a/llvm/test/MC/Mips/mips64r5/valid.s +++ b/llvm/test/MC/Mips/mips64r5/valid.s @@ -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] diff --git a/llvm/test/MC/Mips/mips64r6/valid.s b/llvm/test/MC/Mips/mips64r6/valid.s index 90b066b84af..0ed51f5a546 100644 --- a/llvm/test/MC/Mips/mips64r6/valid.s +++ b/llvm/test/MC/Mips/mips64r6/valid.s @@ -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 |

