1 // RUN
: not llvm-mc
-triple
=aarch64
-show-encoding
-mattr
=+sve
2>&1 < %s| FileCheck
%s
3 // Register z32 does
not exist.
5 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: invalid operand
6 // CHECK-NEXT
: sub z3.h
, z26.h
, z32.h
7 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
9 // Invalid element kind.
10 sub z4.h
, z27.h
, z31.x
11 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: invalid vector kind qualifier
12 // CHECK-NEXT
: sub z4.h
, z27.h
, z31.x
13 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
15 // Element size specifiers should match.
17 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: invalid element width
18 // CHECK-NEXT
: sub z0.h
, z8.h
, z8.
b
19 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
21 // Invalid predicate suffix
'/a'
22 sub z29.d
, p7
/a, z29.d
, z8.d
23 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: expecting
'm' or 'z' predication
24 // CHECK-NEXT
: sub z29.d
, p7
/a, z29.d
, z8.d
25 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
27 // Missing predicate suffix
28 sub z29.d
, p7
, z29.d
, z8.d
29 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: invalid operand
30 // CHECK-NEXT
: sub 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 sub z26.
b, p8
/m
, z26.
b, z27.
b
37 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: invalid restricted predicate register
, expected p0.
.p7 (without element suffix)
38 // CHECK-NEXT
: sub z26.
b, p8
/m
, z26.
b, z27.
b
39 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
41 sub z14.h
, p8
/m
, z14.h
, z18.h
42 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: invalid restricted predicate register
, expected p0.
.p7 (without element suffix)
43 // CHECK-NEXT
: sub z14.h
, p8
/m
, z14.h
, z18.h
44 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
46 sub z30.s
, p8
/m
, z30.s
, z23.s
47 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: invalid restricted predicate register
, expected p0.
.p7 (without element suffix)
48 // CHECK-NEXT
: sub z30.s
, p8
/m
, z30.s
, z23.s
49 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
51 sub z29.d
, p8
/m
, z29.d
, z3.d
52 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: invalid restricted predicate register
, expected p0.
.p7 (without element suffix)
53 // CHECK-NEXT
: sub z29.d
, p8
/m
, z29.d
, z3.d
54 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
56 // --------------------------------------------------------------------------//
57 // Source
and Destination Registers must match
59 sub z25.
b, p4
/m
, z26.
b, z2.
b
60 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: operand must match destination register
61 // CHECK-NEXT
: sub z25.
b, p4
/m
, z26.
b, z2.
b
62 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
64 sub z29.h
, p6
/m
, z30.h
, z20.h
65 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: operand must match destination register
66 // CHECK-NEXT
: sub z29.h
, p6
/m
, z30.h
, z20.h
67 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
69 sub z14.s
, p2
/m
, z15.s
, z21.s
70 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: operand must match destination register
71 // CHECK-NEXT
: sub z14.s
, p2
/m
, z15.s
, z21.s
72 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
74 sub z2.d
, p5
/m
, z3.d
, z11.d
75 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: operand must match destination register
76 // CHECK-NEXT
: sub z2.d
, p5
/m
, z3.d
, z11.d
77 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
80 // --------------------------------------------------------------------------//
83 sub 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
: sub 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
: sub z0.
b, z0.
b, #-1
91 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
93 sub 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
: sub 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
: sub 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
: sub z0.h
, z0.h
, #-1
106 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
108 sub 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
: sub z0.h
, z0.h
, #256, lsl #8
111 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
113 sub 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
: sub 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
: sub z0.s
, z0.s
, #-1
121 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
123 sub 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
: sub z0.s
, z0.s
, #256, lsl #8
126 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
128 sub 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
: sub 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
: sub z0.d
, z0.d
, #-1
136 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
138 sub 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
: sub z0.d
, z0.d
, #256, lsl #8
141 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
143 sub 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
: sub 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 sub 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
: sub z31.d
, z31.d
, #65280
156 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
158 movprfx z31.s
, p0
/z
, z6.s
159 sub z31.s
, z31.s
, z31.s
160 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: instruction is unpredictable when following
a movprfx
, suggest replacing movprfx with mov
161 // CHECK-NEXT
: sub z31.s
, z31.s
, z31.s
162 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
165 sub z31.s
, z31.s
, z31.s
166 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: instruction is unpredictable when following
a movprfx
, suggest replacing movprfx with mov
167 // CHECK-NEXT
: sub z31.s
, z31.s
, z31.s
168 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}: