1// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2  2>&1 < %s| FileCheck %s
2
3
4// ------------------------------------------------------------------------- //
5// z register out of range for index
6
7sqdmullt z0.s, z1.h, z8.h[0]
8// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
9// CHECK-NEXT: sqdmullt z0.s, z1.h, z8.h[0]
10// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
11
12sqdmullt z0.d, z1.s, z16.s[0]
13// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
14// CHECK-NEXT: sqdmullt z0.d, z1.s, z16.s[0]
15// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
16
17// ------------------------------------------------------------------------- //
18// Index out of bounds
19
20sqdmullt z0.s, z1.h, z7.h[-1]
21// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: vector lane must be an integer in range [0, 7].
22// CHECK-NEXT: sqdmullt z0.s, z1.h, z7.h[-1]
23// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
24
25sqdmullt z0.s, z1.h, z7.h[8]
26// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: vector lane must be an integer in range [0, 7].
27// CHECK-NEXT: sqdmullt z0.s, z1.h, z7.h[8]
28// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
29
30sqdmullt z0.d, z1.s, z15.s[-1]
31// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: vector lane must be an integer in range [0, 3].
32// CHECK-NEXT: sqdmullt z0.d, z1.s, z15.s[-1]
33// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
34
35sqdmullt z0.d, z1.s, z15.s[4]
36// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: vector lane must be an integer in range [0, 3].
37// CHECK-NEXT: sqdmullt z0.d, z1.s, z15.s[4]
38// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
39
40// ------------------------------------------------------------------------- //
41// Invalid element width
42
43sqdmullt z0.b, z0.b, z0.b
44// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
45// CHECK-NEXT: sqdmullt z0.b, z0.b, z0.b
46// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
47
48sqdmullt z0.h, z0.h, z0.h
49// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
50// CHECK-NEXT: sqdmullt z0.h, z0.h, z0.h
51// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
52
53sqdmullt z0.s, z0.s, z0.s
54// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
55// CHECK-NEXT: sqdmullt z0.s, z0.s, z0.s
56// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
57
58sqdmullt z0.d, z0.d, z0.d
59// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
60// CHECK-NEXT: sqdmullt z0.d, z0.d, z0.d
61// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
62
63sqdmullt z0.s, z1.b, z2.b[0]
64// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
65// CHECK-NEXT: sqdmullt z0.s, z1.b, z2.b[0]
66// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
67
68sqdmullt z0.s, z1.s, z2.s[0]
69// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
70// CHECK-NEXT: sqdmullt z0.s, z1.s, z2.s[0]
71// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
72
73sqdmullt z0.s, z1.d, z2.d[0]
74// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
75// CHECK-NEXT: sqdmullt z0.s, z1.d, z2.d[0]
76// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
77
78sqdmullt z0.d, z1.b, z2.b[0]
79// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
80// CHECK-NEXT: sqdmullt z0.d, z1.b, z2.b[0]
81// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
82
83sqdmullt z0.d, z1.h, z2.h[0]
84// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
85// CHECK-NEXT: sqdmullt z0.d, z1.h, z2.h[0]
86// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
87
88sqdmullt z0.d, z1.d, z2.d[0]
89// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
90// CHECK-NEXT: sqdmullt z0.d, z1.d, z2.d[0]
91// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
92
93// --------------------------------------------------------------------------//
94// Negative tests for instructions that are incompatible with movprfx
95
96movprfx z31.d, p0/z, z6.d
97sqdmullt z31.d, z31.s, z15.s[1]
98// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
99// CHECK-NEXT: sqdmullt z31.d, z31.s, z15.s[1]
100// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
101
102movprfx z31, z6
103sqdmullt z31.d, z31.s, z15.s[1]
104// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
105// CHECK-NEXT: sqdmullt z31.d, z31.s, z15.s[1]
106// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
107