[AMDGPU] Assembler: fix row_bcast parsing
authorSam Kolton <Sam.Kolton@amd.com>
Thu, 14 Jul 2016 14:50:35 +0000 (14:50 +0000)
committerSam Kolton <Sam.Kolton@amd.com>
Thu, 14 Jul 2016 14:50:35 +0000 (14:50 +0000)
Summary: This change fix bug 28538

Reviewers: tstellarAMD, vpykhtin

Subscribers: arsenm, kzhuravl

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

llvm-svn: 275422

llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
llvm/test/MC/AMDGPU/regression/bug28538.s [new file with mode: 0644]

index efa57c8..efcf1b2 100644 (file)
@@ -2554,6 +2554,8 @@ AMDGPUAsmParser::parseDPPCtrl(OperandVector &Operands) {
           Int = 0x142;
         } else if (Int == 31) {
           Int = 0x143;
+        } else {
+          return MatchOperand_ParseFail;
         }
       } else {
         return MatchOperand_ParseFail;
diff --git a/llvm/test/MC/AMDGPU/regression/bug28538.s b/llvm/test/MC/AMDGPU/regression/bug28538.s
new file mode 100644 (file)
index 0000000..82b2d27
--- /dev/null
@@ -0,0 +1,12 @@
+// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOCIVI --check-prefix=NOVI
+// RUN: not llvm-mc -arch=amdgcn -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOSI --check-prefix=NOSICI
+// RUN: not llvm-mc -arch=amdgcn -mcpu=SI -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOSI --check-prefix=NOSICI
+// RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOSICI
+
+// NOSICI: error:
+// NOVI: error: failed parsing operand
+v_mov_b32 v0, v0 row_bcast:0
+
+// NOSICI: error:
+// NOVI: error: failed parsing operand
+v_mov_b32 v0, v0 row_bcast:13