summaryrefslogtreecommitdiffstats
path: root/llvm/test/MC/Mips/msa
diff options
context:
space:
mode:
authorDaniel Sanders <daniel.sanders@imgtec.com>2015-11-06 12:22:31 +0000
committerDaniel Sanders <daniel.sanders@imgtec.com>2015-11-06 12:22:31 +0000
commitea4f653d18e74439f0abefe5861d05fea9ddf5d0 (patch)
tree2495edb31781be386dad08dbf3873d7d3585c77a /llvm/test/MC/Mips/msa
parent52da7af4d2ae4b559de3a8bfdffdfa01581e67bd (diff)
downloadbcm5719-llvm-ea4f653d18e74439f0abefe5861d05fea9ddf5d0.tar.gz
bcm5719-llvm-ea4f653d18e74439f0abefe5861d05fea9ddf5d0.zip
[mips][ias] Range check uimm2 operands and fix a bug this revealed.
Summary: The bug was that the MIPS32R6/MIPS64R6/microMIPS32R6 versions of LSA and DLSA (unlike the MSA version) failed to account for the off-by-one encoding of the immediate. The range is actually 1..4 rather than 0..3. Reviewers: vkalintiris Subscribers: atanasyan, dsanders, llvm-commits Differential Revision: http://reviews.llvm.org/D14015 llvm-svn: 252295
Diffstat (limited to 'llvm/test/MC/Mips/msa')
-rw-r--r--llvm/test/MC/Mips/msa/invalid-64.s6
-rw-r--r--llvm/test/MC/Mips/msa/invalid.s2
2 files changed, 7 insertions, 1 deletions
diff --git a/llvm/test/MC/Mips/msa/invalid-64.s b/llvm/test/MC/Mips/msa/invalid-64.s
index cf1bff5596b..456ae21814d 100644
--- a/llvm/test/MC/Mips/msa/invalid-64.s
+++ b/llvm/test/MC/Mips/msa/invalid-64.s
@@ -1,11 +1,15 @@
# Instructions that are invalid
#
-# RUN: not llvm-mc %s -triple=mips-unknown-linux -mcpu=mips32r2 -mattr=+msa \
+# RUN: not llvm-mc %s -triple=mips-unknown-linux -mcpu=mips64r2 -mattr=+msa \
# RUN: -show-encoding 2>%t1
# RUN: FileCheck %s < %t1
.set noat
+ dlsa $2, $3, $4, 0 # CHECK: :[[@LINE]]:25: error: expected immediate in range 1 .. 4
+ dlsa $2, $3, $4, 5 # CHECK: :[[@LINE]]:25: error: expected immediate in range 1 .. 4
insve.b $w25[3], $w9[1] # CHECK: :[[@LINE]]:26: error: expected '0'
insve.h $w24[2], $w2[1] # CHECK: :[[@LINE]]:26: error: expected '0'
insve.w $w0[2], $w13[1] # CHECK: :[[@LINE]]:26: error: expected '0'
insve.d $w3[0], $w18[1] # CHECK: :[[@LINE]]:26: error: expected '0'
+ lsa $2, $3, $4, 0 # CHECK: :[[@LINE]]:25: error: expected immediate in range 1 .. 4
+ lsa $2, $3, $4, 5 # CHECK: :[[@LINE]]:25: error: expected immediate in range 1 .. 4
diff --git a/llvm/test/MC/Mips/msa/invalid.s b/llvm/test/MC/Mips/msa/invalid.s
index cf1bff5596b..0875efba877 100644
--- a/llvm/test/MC/Mips/msa/invalid.s
+++ b/llvm/test/MC/Mips/msa/invalid.s
@@ -9,3 +9,5 @@
insve.h $w24[2], $w2[1] # CHECK: :[[@LINE]]:26: error: expected '0'
insve.w $w0[2], $w13[1] # CHECK: :[[@LINE]]:26: error: expected '0'
insve.d $w3[0], $w18[1] # CHECK: :[[@LINE]]:26: error: expected '0'
+ lsa $2, $3, $4, 0 # CHECK: :[[@LINE]]:25: error: expected immediate in range 1 .. 4
+ lsa $2, $3, $4, 5 # CHECK: :[[@LINE]]:25: error: expected immediate in range 1 .. 4
OpenPOWER on IntegriCloud