1 // RUN
: not llvm-mc
-triple
=aarch64
-show-encoding
-mattr
=+sve
2>&1 < %s| FileCheck
%s
3 // Invalid element kind.
4 subr z0.h
, p0
/m
, z0.h
, z0.x
5 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: invalid vector kind qualifier
6 // CHECK-NEXT
: subr z0.h
, p0
/m
, z0.h
, z0.x
7 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
9 // Element size specifiers should match.
10 subr z0.h
, p0
/m
, z0.h
, z0.
b
11 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: invalid element width
12 // CHECK-NEXT
: subr z0.h
, p0
/m
, z0.h
, z0.
b
13 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
15 // Invalid predicate suffix
'/a'
16 subr z0.d
, p7
/a, z0.d
, z0.d
17 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: expecting
'm' or 'z' predication
18 // CHECK-NEXT
: subr z0.d
, p7
/a, z0.d
, z0.d
19 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
21 // Missing predicate suffix
22 subr z0.d
, p7
, z0.d
, z0.d
23 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: invalid operand
24 // CHECK-NEXT
: subr z0.d
, p7
, z0.d
, z0.d
25 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
27 // --------------------------------------------------------------------------//
28 // error
: invalid restricted predicate register
, expected p0.
.p7 (without element suffix)
30 subr z26.
b, p8
/m
, z26.
b, z27.
b
31 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: invalid restricted predicate register
, expected p0.
.p7 (without element suffix)
32 // CHECK-NEXT
: subr z26.
b, p8
/m
, z26.
b, z27.
b
33 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
35 subr z14.h
, p8
/m
, z14.h
, z18.h
36 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: invalid restricted predicate register
, expected p0.
.p7 (without element suffix)
37 // CHECK-NEXT
: subr z14.h
, p8
/m
, z14.h
, z18.h
38 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
40 subr z30.s
, p8
/m
, z30.s
, z23.s
41 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: invalid restricted predicate register
, expected p0.
.p7 (without element suffix)
42 // CHECK-NEXT
: subr z30.s
, p8
/m
, z30.s
, z23.s
43 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
45 subr z29.d
, p8
/m
, z29.d
, z3.d
46 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: invalid restricted predicate register
, expected p0.
.p7 (without element suffix)
47 // CHECK-NEXT
: subr z29.d
, p8
/m
, z29.d
, z3.d
48 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
50 // --------------------------------------------------------------------------//
51 // Source
and Destination Registers must match
53 subr z25.
b, p4
/m
, z26.
b, z2.
b
54 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: operand must match destination register
55 // CHECK-NEXT
: subr z25.
b, p4
/m
, z26.
b, z2.
b
56 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
58 subr z29.h
, p6
/m
, z30.h
, z20.h
59 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: operand must match destination register
60 // CHECK-NEXT
: subr z29.h
, p6
/m
, z30.h
, z20.h
61 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
63 subr z14.s
, p2
/m
, z15.s
, z21.s
64 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: operand must match destination register
65 // CHECK-NEXT
: subr z14.s
, p2
/m
, z15.s
, z21.s
66 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
68 subr z2.d
, p5
/m
, z3.d
, z11.d
69 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: operand must match destination register
70 // CHECK-NEXT
: subr z2.d
, p5
/m
, z3.d
, z11.d
71 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
74 // --------------------------------------------------------------------------//
77 subr z0.
b, z0.
b, #0, lsl #8 // #0, lsl #8 is not valid for .b
78 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[0, 255] with
a shift amount of
0
79 // CHECK-NEXT
: subr z0.
b, z0.
b, #0, lsl #8
80 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
83 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[0, 255] with
a shift amount of
0
84 // CHECK-NEXT
: subr z0.
b, z0.
b, #-1
85 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
87 subr z0.
b, z0.
b, #1, lsl #8
88 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[0, 255] with
a shift amount of
0
89 // CHECK-NEXT
: subr z0.
b, z0.
b, #1, lsl #8
90 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
93 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[0, 255] with
a shift amount of
0
94 // CHECK-NEXT
: subr z0.
b, z0.
b, #256
95 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
98 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[0, 255] or a multiple of
256 in range
[256, 65280]
99 // CHECK-NEXT
: subr z0.h
, z0.h
, #-1
100 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
102 subr z0.h
, z0.h
, #256, lsl #8
103 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[0, 255] or a multiple of
256 in range
[256, 65280]
104 // CHECK-NEXT
: subr z0.h
, z0.h
, #256, lsl #8
105 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
107 subr z0.h
, z0.h
, #65536
108 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[0, 255] or a multiple of
256 in range
[256, 65280]
109 // CHECK-NEXT
: subr z0.h
, z0.h
, #65536
110 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
113 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[0, 255] or a multiple of
256 in range
[256, 65280]
114 // CHECK-NEXT
: subr z0.s
, z0.s
, #-1
115 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
117 subr z0.s
, z0.s
, #256, lsl #8
118 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[0, 255] or a multiple of
256 in range
[256, 65280]
119 // CHECK-NEXT
: subr z0.s
, z0.s
, #256, lsl #8
120 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
122 subr z0.s
, z0.s
, #65536
123 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[0, 255] or a multiple of
256 in range
[256, 65280]
124 // CHECK-NEXT
: subr z0.s
, z0.s
, #65536
125 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
128 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[0, 255] or a multiple of
256 in range
[256, 65280]
129 // CHECK-NEXT
: subr z0.d
, z0.d
, #-1
130 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
132 subr z0.d
, z0.d
, #256, lsl #8
133 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[0, 255] or a multiple of
256 in range
[256, 65280]
134 // CHECK-NEXT
: subr z0.d
, z0.d
, #256, lsl #8
135 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
137 subr z0.d
, z0.d
, #65536
138 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[0, 255] or a multiple of
256 in range
[256, 65280]
139 // CHECK-NEXT
: subr z0.d
, z0.d
, #65536
140 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
143 // --------------------------------------------------------------------------//
144 // Negative tests for instructions that are incompatible with movprfx
146 movprfx z31.d
, p0
/z
, z6.d
147 subr z31.d
, z31.d
, #65280
148 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: instruction is unpredictable when following
a predicated movprfx
, suggest using unpredicated movprfx
149 // CHECK-NEXT
: subr z31.d
, z31.d
, #65280
150 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}: