1 // RUN
: not llvm-mc
-triple
=aarch64
-show-encoding
-mattr
=+sve
2>&1 < %s| FileCheck
%s
3 // input should
be a 64bit scalar register
5 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: invalid operand for instruction
6 // CHECK-NEXT
: dup z0.d
, w0
7 // CHECK-
NOT: [[@LINE-
3]]:{{[0-9]+}}:
9 // wzr is
not a valid operand to dup
11 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: invalid operand for instruction
12 // CHECK-NEXT
: dup z0.s
, wzr
13 // CHECK-
NOT: [[@LINE-
3]]:{{[0-9]+}}:
15 // xzr is
not a valid operand to dup
17 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: invalid operand for instruction
18 // CHECK-NEXT
: dup z0.d
, xzr
19 // CHECK-
NOT: [[@LINE-
3]]:{{[0-9]+}}:
22 // --------------------------------------------------------------------------//
25 dup z0.
b, #0, lsl #8 // #0, lsl #8 is not valid for .b
26 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[-128, 255]
27 // CHECK-NEXT
: dup z0.
b, #0, lsl #8
28 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
31 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[-128, 255]
32 // CHECK-NEXT
: dup z0.
b, #-129
33 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
36 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[-128, 255]
37 // CHECK-NEXT
: dup z0.
b, #-1, lsl #8
38 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
41 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[-128, 255]
42 // CHECK-NEXT
: dup z0.
b, #256
43 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
46 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[-128, 255]
47 // CHECK-NEXT
: dup z0.
b, #1, lsl #8
48 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
51 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[-128, 127] or a multiple of
256 in range
[-32768, 65280]
52 // CHECK-NEXT
: dup z0.h
, #-33024
53 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
56 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[-128, 127] or a multiple of
256 in range
[-32768, 65280]
57 // CHECK-NEXT
: dup z0.h
, #-32769
58 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
60 dup z0.h
, #-129, lsl #8
61 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[-128, 127] or a multiple of
256 in range
[-32768, 65280]
62 // CHECK-NEXT
: dup z0.h
, #-129, lsl #8
63 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
66 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[-128, 127] or a multiple of
256 in range
[-32768, 65280]
67 // CHECK-NEXT
: dup z0.h
, #65281
68 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
71 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[-128, 127] or a multiple of
256 in range
[-32768, 65280]
72 // CHECK-NEXT
: dup z0.h
, #65536
73 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
75 dup z0.h
, #256, lsl #8
76 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[-128, 127] or a multiple of
256 in range
[-32768, 65280]
77 // CHECK-NEXT
: dup z0.h
, #256, lsl #8
78 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
81 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[-128, 127] or a multiple of
256 in range
[-32768, 32512]
82 // CHECK-NEXT
: dup z0.s
, #-33024
83 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
86 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[-128, 127] or a multiple of
256 in range
[-32768, 32512]
87 // CHECK-NEXT
: dup z0.s
, #-32769
88 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
90 dup z0.s
, #-129, lsl #8
91 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[-128, 127] or a multiple of
256 in range
[-32768, 32512]
92 // CHECK-NEXT
: dup z0.s
, #-129, lsl #8
93 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
96 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[-128, 127] or a multiple of
256 in range
[-32768, 32512]
97 // CHECK-NEXT
: dup z0.s
, #32513
98 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
101 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[-128, 127] or a multiple of
256 in range
[-32768, 32512]
102 // CHECK-NEXT
: dup z0.s
, #32768
103 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
105 dup z0.s
, #128, lsl #8
106 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[-128, 127] or a multiple of
256 in range
[-32768, 32512]
107 // CHECK-NEXT
: dup z0.s
, #128, lsl #8
108 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
111 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[-128, 127] or a multiple of
256 in range
[-32768, 32512]
112 // CHECK-NEXT
: dup z0.d
, #-33024
113 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
116 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[-128, 127] or a multiple of
256 in range
[-32768, 32512]
117 // CHECK-NEXT
: dup z0.d
, #-32769
118 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
120 dup z0.d
, #-129, lsl #8
121 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[-128, 127] or a multiple of
256 in range
[-32768, 32512]
122 // CHECK-NEXT
: dup z0.d
, #-129, lsl #8
123 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
126 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[-128, 127] or a multiple of
256 in range
[-32768, 32512]
127 // CHECK-NEXT
: dup z0.d
, #32513
128 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
131 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[-128, 127] or a multiple of
256 in range
[-32768, 32512]
132 // CHECK-NEXT
: dup z0.d
, #32768
133 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
135 dup z0.d
, #128, lsl #8
136 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[-128, 127] or a multiple of
256 in range
[-32768, 32512]
137 // CHECK-NEXT
: dup z0.d
, #128, lsl #8
138 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
141 // --------------------------------------------------------------------------//
142 // Immediate
not compatible with encode
/decode function.
145 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: invalid operand for instruction
146 // CHECK-NEXT
: dup z0.
b, b0
147 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
150 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: invalid operand for instruction
151 // CHECK-NEXT
: dup z0.h
, h0
152 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
155 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: invalid operand for instruction
156 // CHECK-NEXT
: dup z0.s
, s0
157 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
160 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: invalid operand for instruction
161 // CHECK-NEXT
: dup z0.d
, d0
162 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
165 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: invalid operand for instruction
166 // CHECK-NEXT
: dup z0.q
, q0
167 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
170 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: vector lane must
be an integer in range
[0, 63].
171 // CHECK-NEXT
: dup z24.
b, z17.
b[-1]
172 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
175 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: vector lane must
be an integer in range
[0, 63].
176 // CHECK-NEXT
: dup z17.
b, z5.
b[64]
177 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
180 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: vector lane must
be an integer in range
[0, 31].
181 // CHECK-NEXT
: dup z16.h
, z30.h
[-1]
182 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
185 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: vector lane must
be an integer in range
[0, 31].
186 // CHECK-NEXT
: dup z19.h
, z23.h
[32]
187 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
190 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: vector lane must
be an integer in range
[0, 15].
191 // CHECK-NEXT
: dup z1.s
, z6.s
[-1]
192 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
195 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: vector lane must
be an integer in range
[0, 15].
196 // CHECK-NEXT
: dup z24.s
, z3.s
[16]
197 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
200 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: vector lane must
be an integer in range
[0, 7].
201 // CHECK-NEXT
: dup z5.d
, z25.d
[-1]
202 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
205 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: vector lane must
be an integer in range
[0, 7].
206 // CHECK-NEXT
: dup z12.d
, z28.d
[8]
207 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
210 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: vector lane must
be an integer in range
[0, 3].
211 // CHECK-NEXT
: dup z22.q
, z7.q
[-1]
212 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
215 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: vector lane must
be an integer in range
[0, 3].
216 // CHECK-NEXT
: dup z24.q
, z21.q
[4]
217 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
220 // --------------------------------------------------------------------------//
221 // Negative tests for instructions that are incompatible with movprfx
223 movprfx z31.
b, p0
/z
, z6.
b
225 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: instruction is unpredictable when following
a movprfx
, suggest replacing movprfx with mov
226 // CHECK-NEXT
: dup z31.
b, wsp
227 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
231 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: instruction is unpredictable when following
a movprfx
, suggest replacing movprfx with mov
232 // CHECK-NEXT
: dup z31.
b, wsp
233 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
235 movprfx z21.d
, p0
/z
, z28.d
237 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: instruction is unpredictable when following
a movprfx
, suggest replacing movprfx with mov
238 // CHECK-NEXT
: dup z21.d
, #32512
239 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
243 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: instruction is unpredictable when following
a movprfx
, suggest replacing movprfx with mov
244 // CHECK-NEXT
: dup z21.d
, #32512
245 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
247 movprfx z31.d
, p0
/z
, z6.d
249 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: instruction is unpredictable when following
a movprfx
, suggest replacing movprfx with mov
250 // CHECK-NEXT
: dup z31.d
, z31.d
[7]
251 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
255 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: instruction is unpredictable when following
a movprfx
, suggest replacing movprfx with mov
256 // CHECK-NEXT
: dup z31.d
, z31.d
[7]
257 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}: