• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve  2>&1 < %s| FileCheck %s
2
3lsl z18.b, z28.b, #-1
4// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 7]
5// CHECK-NEXT: lsl z18.b, z28.b, #-1
6// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
7
8lsl z1.b, z9.b, #8
9// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 7]
10// CHECK-NEXT: lsl z1.b, z9.b, #8
11// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
12
13lsl z18.b, p0/m, z28.b, #-1
14// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 7]
15// CHECK-NEXT: lsl z18.b, p0/m, z28.b, #-1
16// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
17
18lsl z1.b, p0/m, z9.b, #8
19// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 7]
20// CHECK-NEXT: lsl z1.b, p0/m, z9.b, #8
21// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
22
23lsl z21.h, z2.h, #-1
24// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 15]
25// CHECK-NEXT: lsl z21.h, z2.h, #-1
26// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
27
28lsl z14.h, z30.h, #16
29// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 15]
30// CHECK-NEXT: lsl z14.h, z30.h, #16
31// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
32
33lsl z21.h, p0/m, z2.h, #-1
34// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 15]
35// CHECK-NEXT: lsl z21.h, p0/m, z2.h, #-1
36// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
37
38lsl z14.h, p0/m, z30.h, #16
39// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 15]
40// CHECK-NEXT: lsl z14.h, p0/m, z30.h, #16
41// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
42
43lsl z6.s, z12.s, #-1
44// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 31]
45// CHECK-NEXT: lsl z6.s, z12.s, #-1
46// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
47
48lsl z23.s, z19.s, #32
49// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 31]
50// CHECK-NEXT: lsl z23.s, z19.s, #32
51// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
52
53lsl z6.s, p0/m, z12.s, #-1
54// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 31]
55// CHECK-NEXT: lsl z6.s, p0/m, z12.s, #-1
56// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
57
58lsl z23.s, p0/m, z19.s, #32
59// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 31]
60// CHECK-NEXT: lsl z23.s, p0/m, z19.s, #32
61// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
62
63lsl z3.d, z24.d, #-1
64// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 63]
65// CHECK-NEXT: lsl z3.d, z24.d, #-1
66// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
67
68lsl z25.d, z16.d, #64
69// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 63]
70// CHECK-NEXT: lsl z25.d, z16.d, #64
71// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
72
73lsl z3.d, p0/m, z24.d, #-1
74// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 63]
75// CHECK-NEXT: lsl z3.d, p0/m, z24.d, #-1
76// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
77
78lsl z25.d, p0/m, z16.d, #64
79// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 63]
80// CHECK-NEXT: lsl z25.d, p0/m, z16.d, #64
81// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
82
83
84// --------------------------------------------------------------------------//
85// Source and Destination Registers must match
86
87lsl z0.b, p0/m, z1.b, z2.b
88// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: operand must match destination register
89// CHECK-NEXT: lsl z0.b, p0/m, z1.b, z2.b
90// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
91
92lsl z0.b, p0/m, z1.b, #1
93// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: operand must match destination register
94// CHECK-NEXT: lsl z0.b, p0/m, z1.b, #1
95// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
96
97
98// --------------------------------------------------------------------------//
99// Element sizes must match
100
101lsl z0.b, z0.d, z1.d
102// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
103// CHECK-NEXT: lsl z0.b, z0.d, z1.d
104// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
105
106lsl z0.b, p0/m, z0.d, z1.d
107// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
108// CHECK-NEXT: lsl z0.b, p0/m, z0.d, z1.d
109// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
110
111lsl z0.b, p0/m, z0.b, z1.h
112// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
113// CHECK-NEXT: lsl z0.b, p0/m, z0.b, z1.h
114// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
115
116// --------------------------------------------------------------------------//
117// Predicate not in restricted predicate range
118
119lsl z0.b, p8/m, z0.b, z1.b
120// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix)
121// CHECK-NEXT: lsl z0.b, p8/m, z0.b, z1.b
122// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
123
124
125// --------------------------------------------------------------------------//
126// Negative tests for instructions that are incompatible with movprfx
127
128movprfx z31.d, p0/z, z6.d
129lsl     z31.d, z31.d, #63
130// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
131// CHECK-NEXT: lsl     z31.d, z31.d, #63
132// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
133
134movprfx z31, z6
135lsl     z31.d, z31.d, #63
136// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
137// CHECK-NEXT: lsl     z31.d, z31.d, #63
138// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
139
140movprfx z0.s, p0/z, z7.s
141lsl     z0.s, z1.s, z2.d
142// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
143// CHECK-NEXT: lsl     z0.s, z1.s, z2.d
144// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
145
146movprfx z0, z7
147lsl     z0.s, z1.s, z2.d
148// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
149// CHECK-NEXT: lsl     z0.s, z1.s, z2.d
150// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
151