1 // RUN
: not llvm-mc
-triple
=aarch64
-show-encoding
-mattr
=+sve
2>&1 < %s| FileCheck
%s
3 // Register z32 does
not exist.
4 add z22.h
, z10.h
, z32.h
5 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: invalid operand
6 // CHECK-NEXT
: add z22.h
, z10.h
, z32.h
7 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
9 // Invalid element kind.
10 add z20.h
, z2.h
, z31.x
11 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: invalid vector kind qualifier
12 // CHECK-NEXT
: add z20.h
, z2.h
, z31.x
13 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
15 // Element size specifiers should match.
16 add z27.h
, z11.h
, z27.
b
17 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: invalid element width
18 // CHECK-NEXT
: add z27.h
, z11.h
, z27.
b
19 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
21 // Invalid predicate suffix
'/a'
22 add z29.d
, p7
/a, z29.d
, z8.d
23 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: expecting
'm' or 'z' predication
24 // CHECK-NEXT
: add z29.d
, p7
/a, z29.d
, z8.d
25 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
27 // Missing predicate suffix
28 add z29.d
, p7
, z29.d
, z8.d
29 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: invalid operand
30 // CHECK-NEXT
: add z29.d
, p7
, z29.d
, z8.d
31 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
33 // --------------------------------------------------------------------------//
34 // error
: invalid restricted predicate register
, expected p0.
.p7 (without element suffix)
36 add z22.
b, p8
/m
, z22.
b, z11.
b
37 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: invalid restricted predicate register
, expected p0.
.p7 (without element suffix)
38 // CHECK-NEXT
: add z22.
b, p8
/m
, z22.
b, z11.
b
39 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
41 add z22.h
, p8
/m
, z22.h
, z6.h
42 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: invalid restricted predicate register
, expected p0.
.p7 (without element suffix)
43 // CHECK-NEXT
: add z22.h
, p8
/m
, z22.h
, z6.h
44 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
46 add z30.s
, p8
/m
, z30.s
, z13.s
47 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: invalid restricted predicate register
, expected p0.
.p7 (without element suffix)
48 // CHECK-NEXT
: add z30.s
, p8
/m
, z30.s
, z13.s
49 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
51 add z29.d
, p8
/m
, z29.d
, z8.d
52 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: invalid restricted predicate register
, expected p0.
.p7 (without element suffix)
53 // CHECK-NEXT
: add z29.d
, p8
/m
, z29.d
, z8.d
54 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
56 // --------------------------------------------------------------------------//
57 // Source
and Destination Registers must match
59 add z19.
b, p4
/m
, z20.
b, z13.
b
60 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: operand must match destination register
61 // CHECK-NEXT
: add z19.
b, p4
/m
, z20.
b, z13.
b
62 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
64 add z9.h
, p3
/m
, z10.h
, z28.h
65 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: operand must match destination register
66 // CHECK-NEXT
: add z9.h
, p3
/m
, z10.h
, z28.h
67 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
69 add z5.s
, p3
/m
, z6.s
, z18.s
70 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: operand must match destination register
71 // CHECK-NEXT
: add z5.s
, p3
/m
, z6.s
, z18.s
72 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
74 add z9.d
, p4
/m
, z10.d
, z7.d
75 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: operand must match destination register
76 // CHECK-NEXT
: add z9.d
, p4
/m
, z10.d
, z7.d
77 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
80 // --------------------------------------------------------------------------//
83 add z0.
b, z0.
b, #0, lsl #8 // #0, lsl #8 is not valid for .b
84 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[0, 255] with
a shift amount of
0
85 // CHECK-NEXT
: add z0.
b, z0.
b, #0, lsl #8
86 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
89 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[0, 255] with
a shift amount of
0
90 // CHECK-NEXT
: add z0.
b, z0.
b, #-1
91 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
93 add z0.
b, z0.
b, #1, lsl #8
94 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[0, 255] with
a shift amount of
0
95 // CHECK-NEXT
: add z0.
b, z0.
b, #1, lsl #8
96 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
99 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[0, 255] with
a shift amount of
0
100 // CHECK-NEXT
: add z0.
b, z0.
b, #256
101 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
104 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[0, 255] or a multiple of
256 in range
[256, 65280]
105 // CHECK-NEXT
: add z0.h
, z0.h
, #-1
106 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
108 add z0.h
, z0.h
, #256, lsl #8
109 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[0, 255] or a multiple of
256 in range
[256, 65280]
110 // CHECK-NEXT
: add z0.h
, z0.h
, #256, lsl #8
111 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
113 add z0.h
, z0.h
, #65536
114 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[0, 255] or a multiple of
256 in range
[256, 65280]
115 // CHECK-NEXT
: add z0.h
, z0.h
, #65536
116 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
119 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[0, 255] or a multiple of
256 in range
[256, 65280]
120 // CHECK-NEXT
: add z0.s
, z0.s
, #-1
121 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
123 add z0.s
, z0.s
, #256, lsl #8
124 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[0, 255] or a multiple of
256 in range
[256, 65280]
125 // CHECK-NEXT
: add z0.s
, z0.s
, #256, lsl #8
126 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
128 add z0.s
, z0.s
, #65536
129 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[0, 255] or a multiple of
256 in range
[256, 65280]
130 // CHECK-NEXT
: add z0.s
, z0.s
, #65536
131 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
134 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[0, 255] or a multiple of
256 in range
[256, 65280]
135 // CHECK-NEXT
: add z0.d
, z0.d
, #-1
136 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
138 add z0.d
, z0.d
, #256, lsl #8
139 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[0, 255] or a multiple of
256 in range
[256, 65280]
140 // CHECK-NEXT
: add z0.d
, z0.d
, #256, lsl #8
141 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
143 add z0.d
, z0.d
, #65536
144 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[0, 255] or a multiple of
256 in range
[256, 65280]
145 // CHECK-NEXT
: add z0.d
, z0.d
, #65536
146 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
149 // --------------------------------------------------------------------------//
150 // Negative tests for instructions that are incompatible with movprfx
152 movprfx z31.d
, p0
/z
, z6.d
153 add z31.d
, z31.d
, #65280
154 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: instruction is unpredictable when following
a predicated movprfx
, suggest using unpredicated movprfx
155 // CHECK-NEXT
: add z31.d
, z31.d
, #65280
156 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
158 movprfx z23.s
, p0
/z
, z30.s
159 add z23.s
, z13.s
, z8.s
160 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: instruction is unpredictable when following
a movprfx
, suggest replacing movprfx with mov
161 // CHECK-NEXT
: add z23.s
, z13.s
, z8.s
162 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
165 add z23.s
, z13.s
, z8.s
166 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: instruction is unpredictable when following
a movprfx
, suggest replacing movprfx with mov
167 // CHECK-NEXT
: add z23.s
, z13.s
, z8.s
168 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}: