[InstCombine] Signed saturation patterns
[llvm-complete.git] / test / MC / AArch64 / SVE / dup-diagnostics.s
blobf97ac83aae099600f8b9b62070075c01eb421f71
1 // RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve 2>&1 < %s| FileCheck %s
3 // input should be a 64bit scalar register
4 dup z0.d, w0
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
10 dup z0.s, wzr
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
16 dup z0.d, xzr
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 // --------------------------------------------------------------------------//
23 // Invalid immediates
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]+}}:
30 dup z0.b, #-129
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]+}}:
35 dup z0.b, #-1, lsl #8
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]+}}:
40 dup z0.b, #256
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]+}}:
45 dup z0.b, #1, lsl #8
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]+}}:
50 dup z0.h, #-33024
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]+}}:
55 dup z0.h, #-32769
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]+}}:
65 dup z0.h, #65281
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]+}}:
70 dup z0.h, #65536
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]+}}:
80 dup z0.s, #-33024
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]+}}:
85 dup z0.s, #-32769
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]+}}:
95 dup z0.s, #32513
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]+}}:
100 dup z0.s, #32768
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]+}}:
110 dup z0.d, #-33024
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]+}}:
115 dup z0.d, #-32769
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]+}}:
125 dup z0.d, #32513
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]+}}:
130 dup z0.d, #32768
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.
144 dup z0.b, b0
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]+}}:
149 dup z0.h, h0
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]+}}:
154 dup z0.s, s0
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]+}}:
159 dup z0.d, d0
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]+}}:
164 dup z0.q, q0
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]+}}:
169 dup z24.b, z17.b[-1]
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]+}}:
174 dup z17.b, z5.b[64]
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]+}}:
179 dup z16.h, z30.h[-1]
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]+}}:
184 dup z19.h, z23.h[32]
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]+}}:
189 dup z1.s, z6.s[-1]
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]+}}:
194 dup z24.s, z3.s[16]
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]+}}:
199 dup z5.d, z25.d[-1]
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]+}}:
204 dup z12.d, z28.d[8]
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]+}}:
209 dup z22.q, z7.q[-1]
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]+}}:
214 dup z24.q, z21.q[4]
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
224 dup z31.b, wsp
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]+}}:
229 movprfx z31, z6
230 dup z31.b, wsp
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
236 dup z21.d, #32512
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]+}}:
241 movprfx z21, z28
242 dup z21.d, #32512
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
248 dup z31.d, z31.d[7]
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]+}}:
253 movprfx z31, z6
254 dup z31.d, z31.d[7]
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]+}}: