]> granicus.if.org Git - llvm/commitdiff
[ARM] Fix for indexed dot product instruction descriptions
authorSjoerd Meijer <sjoerd.meijer@arm.com>
Mon, 18 Sep 2017 14:17:57 +0000 (14:17 +0000)
committerSjoerd Meijer <sjoerd.meijer@arm.com>
Mon, 18 Sep 2017 14:17:57 +0000 (14:17 +0000)
The indexed dot product instructions only accept the lower 16 D-registers as
the indexed register, but we were e.g. incorrectly accepting:

vudot.u8 d16,d16,d18[0]

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313531 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMInstrNEON.td
test/MC/ARM/armv8.2a-dotprod-error.s

index 9c729bd2c9f2e58f98f716d942c2846865ed1bee..86c90efce2c89e1a49bb5df750658135a9bad938 100644 (file)
@@ -4710,7 +4710,7 @@ def VSDOTQ : N3Vnp<0b11000, 0b10, 0b1101, 0b1, 0b0,
 // Indexed dot product instructions:
 class DOTI<string opc, string dt, bit Q, bit U, RegisterClass Ty> :
   N3Vnp<0b11100, 0b10, 0b1101, Q, U,
-       (outs Ty:$Vd), (ins Ty:$Vn, DPR:$Vm, VectorIndex32:$lane),
+       (outs Ty:$Vd), (ins Ty:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
        N3RegFrm, IIC_VDOTPROD, opc, dt, []> {
   bit lane;
   let Inst{5} = lane;
index 424fa5a12c9961d967a135a8b8e7bf7938437a1c..c8497c30a00afe7f3a1d16781c58a6a7a12288a5 100644 (file)
@@ -3,12 +3,34 @@
 // RUN: not llvm-mc -triple thumb -mattr=+dotprod -show-encoding < %s 2> %t
 // RUN: FileCheck --check-prefix=CHECK-ERROR < %t %s
 
+// Only indices 0 an 1 should be accepted:
+
 vudot.u8 d0, d1, d2[2]
 vsdot.s8 d0, d1, d2[2]
 vudot.u8 q0, q1, d4[2]
 vsdot.s8 q0, q1, d4[2]
 
 // CHECK-ERROR: error: invalid operand for instruction
+// CHECK-ERROR: vudot.u8 d0, d1, d2[2]
+// CHECK-ERROR:                    ^
+// CHECK-ERROR: error: invalid operand for instruction
+// CHECK-ERROR: vsdot.s8 d0, d1, d2[2]
+// CHECK-ERROR:                    ^
+// CHECK-ERROR: error: invalid operand for instruction
+// CHECK-ERROR: vudot.u8 q0, q1, d4[2]
+// CHECK-ERROR:                    ^
 // CHECK-ERROR: error: invalid operand for instruction
+// CHECK-ERROR: vsdot.s8 q0, q1, d4[2]
+// CHECK-ERROR:                    ^
+
+// Only the lower 16 D-registers should be accepted:
+
+vudot.u8 q0, q1, d16[0]
+vsdot.s8 q0, q1, d16[0]
+
 // CHECK-ERROR: error: invalid operand for instruction
+// CHECK-ERROR: vudot.u8 q0, q1, d16[0]
+// CHECK-ERROR:                     ^
 // CHECK-ERROR: error: invalid operand for instruction
+// CHECK-ERROR: vsdot.s8 q0, q1, d16[0]
+// CHECK-ERROR:                     ^