Q registers are encoded in fields of the same length as D registers. As Q registers...
authorMihai Popa <mihail.popa@gmail.com>
Mon, 20 May 2013 14:42:43 +0000 (14:42 +0000)
committerMihai Popa <mihail.popa@gmail.com>
Mon, 20 May 2013 14:42:43 +0000 (14:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182279 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/Disassembler/ARMDisassembler.cpp
test/MC/Disassembler/ARM/invalid-VQADD-arm.txt

index c562cf7a7171020cf9dacd3d160390ba33f33424..aa59c98296cf1930d65c4b5d6ebd1877b7005cae 100644 (file)
@@ -1048,7 +1048,7 @@ static const uint16_t QPRDecoderTable[] = {
 
 static DecodeStatus DecodeQPRRegisterClass(MCInst &Inst, unsigned RegNo,
                                    uint64_t Address, const void *Decoder) {
-  if (RegNo > 31)
+  if (RegNo > 31 || (RegNo & 1) != 0)
     return MCDisassembler::Fail;
   RegNo >>= 1;
 
index f961c64f7d9988dd91800ee1cd73ac3c04ac65ce..e8e5d6fa21cdaa11dde38c564f70e99b48bfbfca 100644 (file)
@@ -1,5 +1,4 @@
-# RUN: llvm-mc --disassemble %s -triple=armv7-unknown-unknwon -mcpu=cortex-a8 2>&1 | grep "invalid instruction encoding"
-# XFAIL: *
+# RUN: llvm-mc --disassemble %s -triple=armv7-unknown-unknwon -mcpu=cortex-a8 2>&1 | FileCheck %s
 
 # Opcode=1225 Name=VQADDsv16i8 Format=ARM_FORMAT_N3Reg(37)
 #  31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10  9  8  7  6  5  4  3  2  1  0 
@@ -9,3 +8,4 @@
 #
 # Qm -> bit[0] == 0, otherwise UNDEFINED
 0xdb 0xe0 0x40 0xf2
+# CHECK: invalid instruction encoding