Fix incorrect asm-printing of some NEON immediates.  Fix weak testcase so
that it checks the immediate values, not just the instructions opcodes.
Radar 8110263.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107487 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp b/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp
index b59852e..b4abb65 100644
--- a/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp
+++ b/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp
@@ -799,8 +799,8 @@
     Val = Imm8 << (8 * ByteNum);
   } else if ((OpCmode & 0xe) == 0xc) {
     // 32-bit vector elements, one byte with low bits set
-    unsigned ByteNum = (OpCmode & 0x1);
-    Val = (Imm8 << (8 * ByteNum)) | (0xffff >> (8 * (1 - ByteNum)));
+    unsigned ByteNum = 1 + (OpCmode & 0x1);
+    Val = (Imm8 << (8 * ByteNum)) | (0xffff >> (8 * (2 - ByteNum)));
   } else if (OpCmode == 0x1e) {
     // 64-bit vector elements
     for (unsigned ByteNum = 0; ByteNum < 8; ++ByteNum) {