[InstCombine] Signed saturation patterns
[llvm-core.git] / test / MC / Hexagon / instructions / ld.s
blob5d18e6a304926ee2239a894de7628eaab81e3065
1 # RUN: llvm-mc -triple hexagon -filetype=obj -o - %s | llvm-objdump -d - | FileCheck %s
2 # Hexagon Programmer's Reference Manual 11.5 LD
4 # Load doubleword
5 # CHECK: 90 ff d5 3a
6 r17:16 = memd(r21 + r31<<#3)
7 # CHECK: b0 c2 c0 49
8 r17:16 = memd(gp+#168)
9 # CHECK: 02 40 00 00
10 # CHECK-NEXT: 10 c5 c0 49
11 r17:16 = memd(##168)
12 # CHECK: d0 c0 d5 91
13 r17:16 = memd(r21 + #48)
14 # CHECK: b0 e0 d5 99
15 r17:16 = memd(r21 ++ #40:circ(m1))
16 # CHECK: 10 e2 d5 99
17 r17:16 = memd(r21 ++ I:circ(m1))
18 # CHECK: 00 40 00 00
19 # CHECK-NEXT: 70 d7 d5 9b
20 r17:16 = memd(r21 = ##31)
21 # CHECK: b0 c0 d5 9b
22 r17:16 = memd(r21++#40)
23 # CHECK: 10 e0 d5 9d
24 r17:16 = memd(r21++m1)
25 # CHECK: 10 e0 d5 9f
26 r17:16 = memd(r21 ++ m1:brev)
28 # Load doubleword conditionally
29 # CHECK: f0 ff d5 30
30 if (p3) r17:16 = memd(r21+r31<<#3)
31 # CHECK: f0 ff d5 31
32 if (!p3) r17:16 = memd(r21+r31<<#3)
33 # CHECK: 03 40 45 85
34 # CHECK-NEXT: f0 ff d5 32
35 { p3 = r5
36 if (p3.new) r17:16 = memd(r21+r31<<#3) }
37 # CHECK: 03 40 45 85
38 # CHECK-NEXT: f0 ff d5 33
39 { p3 = r5
40 if (!p3.new) r17:16 = memd(r21+r31<<#3) }
41 # CHECK: 70 d8 d5 41
42 if (p3) r17:16 = memd(r21 + #24)
43 # CHECK: 03 40 45 85
44 # CHECK-NEXT: 70 d8 d5 43
45 { p3 = r5
46 if (p3.new) r17:16 = memd(r21 + #24) }
47 # CHECK: 70 d8 d5 45
48 if (!p3) r17:16 = memd(r21 + #24)
49 # CHECK: 03 40 45 85
50 # CHECK-NEXT: 70 d8 d5 47
51 { p3 = r5
52 if (!p3.new) r17:16 = memd(r21 + #24) }
53 # CHECK: b0 e6 d5 9b
54 if (p3) r17:16 = memd(r21++#40)
55 # CHECK: b0 ee d5 9b
56 if (!p3) r17:16 = memd(r21++#40)
57 # CHECK: 03 40 45 85
58 # CHECK-NEXT: b0 f6 d5 9b
59 { p3 = r5
60 if (p3.new) r17:16 = memd(r21++#40) }
61 # CHECK: 03 40 45 85
62 # CHECK-NEXT: b0 fe d5 9b
63 { p3 = r5
64 if (!p3.new) r17:16 = memd(r21++#40) }
66 # Load byte
67 # CHECK: 91 ff 15 3a
68 r17 = memb(r21 + r31<<#3)
69 # CHECK: b1 c2 00 49
70 r17 = memb(gp+#21)
71 # CHECK: 00 40 00 00
72 # CHECK-NEXT: b1 c2 00 49
73 r17 = memb(##21)
74 # CHECK: f1 c3 15 91
75 r17 = memb(r21 + #31)
76 # CHECK: b1 e0 15 99
77 r17 = memb(r21 ++ #5:circ(m1))
78 # CHECK: 11 e2 15 99
79 r17 = memb(r21 ++ I:circ(m1))
80 # CHECK: 00 40 00 00
81 # CHECK-NEXT: 71 d7 15 9b
82 r17 = memb(r21 = ##31)
83 # CHECK: b1 c0 15 9b
84 r17 = memb(r21++#5)
85 # CHECK: 11 e0 15 9d
86 r17 = memb(r21++m1)
87 # CHECK: 11 e0 15 9f
88 r17 = memb(r21 ++ m1:brev)
90 # Load byte conditionally
91 # CHECK: f1 ff 15 30
92 if (p3) r17 = memb(r21+r31<<#3)
93 # CHECK: f1 ff 15 31
94 if (!p3) r17 = memb(r21+r31<<#3)
95 # CHECK: 03 40 45 85
96 # CHECK-NEXT: f1 ff 15 32
97 { p3 = r5
98 if (p3.new) r17 = memb(r21+r31<<#3) }
99 # CHECK: 03 40 45 85
100 # CHECK-NEXT: f1 ff 15 33
101 { p3 = r5
102 if (!p3.new) r17 = memb(r21+r31<<#3) }
103 # CHECK: 91 dd 15 41
104 if (p3) r17 = memb(r21 + #44)
105 # CHECK: 03 40 45 85
106 # CHECK-NEXT: 91 dd 15 43
107 { p3 = r5
108 if (p3.new) r17 = memb(r21 + #44) }
109 # CHECK: 91 dd 15 45
110 if (!p3) r17 = memb(r21 + #44)
111 # CHECK: 03 40 45 85
112 # CHECK-NEXT: 91 dd 15 47
113 { p3 = r5
114 if (!p3.new) r17 = memb(r21 + #44) }
115 # CHECK: b1 e6 15 9b
116 if (p3) r17 = memb(r21++#5)
117 # CHECK: b1 ee 15 9b
118 if (!p3) r17 = memb(r21++#5)
119 # CHECK: 03 40 45 85
120 # CHECK-NEXT: b1 f6 15 9b
121 { p3 = r5
122 if (p3.new) r17 = memb(r21++#5) }
123 # CHECK: 03 40 45 85
124 # CHECK-NEXT: b1 fe 15 9b
125 { p3 = r5
126 if (!p3.new) r17 = memb(r21++#5) }
128 # Load byte into shifted vector
129 # CHECK: f0 c3 95 90
130 r17:16 = memb_fifo(r21 + #31)
131 # CHECK: b0 e0 95 98
132 r17:16 = memb_fifo(r21 ++ #5:circ(m1))
133 # CHECK: 10 e2 95 98
134 r17:16 = memb_fifo(r21 ++ I:circ(m1))
136 # Load half into shifted vector
137 # CHECK: f0 c3 55 90
138 r17:16 = memh_fifo(r21 + #62)
139 # CHECK: b0 e0 55 98
140 r17:16 = memh_fifo(r21 ++ #10:circ(m1))
141 # CHECK: 10 e2 55 98
142 r17:16 = memh_fifo(r21 ++ I:circ(m1))
144 # Load halfword
145 # CHECK: 91 ff 55 3a
146 r17 = memh(r21 + r31<<#3)
147 # CHECK: b1 c2 40 49
148 r17 = memh(gp+#42)
149 # CHECK: 00 40 00 00
150 # CHECK-NEXT: 51 c5 40 49
151 r17 = memh(##42)
152 # CHECK: f1 c3 55 91
153 r17 = memh(r21 + #62)
154 # CHECK: b1 e0 55 99
155 r17 = memh(r21 ++ #10:circ(m1))
156 # CHECK: 11 e2 55 99
157 r17 = memh(r21 ++ I:circ(m1))
158 # CHECK: 00 40 00 00
159 # CHECK-NEXT: 71 d7 55 9b
160 r17 = memh(r21 = ##31)
161 # CHECK: b1 c0 55 9b
162 r17 = memh(r21++#10)
163 # CHECK: 11 e0 55 9d
164 r17 = memh(r21++m1)
165 # CHECK: 11 e0 55 9f
166 r17 = memh(r21 ++ m1:brev)
168 # Load halfword conditionally
169 # CHECK: f1 ff 55 30
170 if (p3) r17 = memh(r21+r31<<#3)
171 # CHECK: f1 ff 55 31
172 if (!p3) r17 = memh(r21+r31<<#3)
173 # CHECK: 03 40 45 85
174 # CHECK-NEXT: f1 ff 55 32
175 { p3 = r5
176 if (p3.new) r17 = memh(r21+r31<<#3) }
177 # CHECK: 03 40 45 85
178 # CHECK-NEXT: f1 ff 55 33
179 { p3 = r5
180 if (!p3.new) r17 = memh(r21+r31<<#3) }
181 # CHECK: b1 e6 55 9b
182 if (p3) r17 = memh(r21++#10)
183 # CHECK: b1 ee 55 9b
184 if (!p3) r17 = memh(r21++#10)
185 # CHECK: 03 40 45 85
186 # CHECK-NEXT: b1 f6 55 9b
187 { p3 = r5
188 if (p3.new) r17 = memh(r21++#10) }
189 # CHECK: 03 40 45 85
190 # CHECK-NEXT: b1 fe 55 9b
191 { p3 = r5
192 if (!p3.new) r17 = memh(r21++#10) }
193 # CHECK: f1 db 55 41
194 if (p3) r17 = memh(r21 + #62)
195 # CHECK: f1 db 55 45
196 if (!p3) r17 = memh(r21 + #62)
197 # CHECK: 03 40 45 85
198 # CHECK-NEXT: f1 db 55 43
199 { p3 = r5
200 if (p3.new) r17 = memh(r21 + #62) }
201 # CHECK: 03 40 45 85
202 # CHECK-NEXT: f1 db 55 47
203 { p3 = r5
204 if (!p3.new) r17 = memh(r21 + #62) }
206 # Load unsigned byte
207 # CHECK: 91 ff 35 3a
208 r17 = memub(r21 + r31<<#3)
209 # CHECK: b1 c2 20 49
210 r17 = memub(gp+#21)
211 # CHECK: 00 40 00 00
212 # CHECK-NEXT: b1 c2 20 49
213 r17 = memub(##21)
214 # CHECK: f1 c3 35 91
215 r17 = memub(r21 + #31)
216 # CHECK: b1 e0 35 99
217 r17 = memub(r21 ++ #5:circ(m1))
218 # CHECK: 11 e2 35 99
219 r17 = memub(r21 ++ I:circ(m1))
220 # CHECK: 00 40 00 00
221 # CHECK-NEXT: 71 d7 35 9b
222 r17 = memub(r21 = ##31)
223 # CHECK: b1 c0 35 9b
224 r17 = memub(r21++#5)
225 # CHECK: 11 e0 35 9d
226 r17 = memub(r21++m1)
227 # CHECK: 11 e0 35 9f
228 r17 = memub(r21 ++ m1:brev)
230 # Load unsigned byte conditionally
231 # CHECK: f1 ff 35 30
232 if (p3) r17 = memub(r21+r31<<#3)
233 # CHECK: f1 ff 35 31
234 if (!p3) r17 = memub(r21+r31<<#3)
235 # CHECK: 03 40 45 85
236 # CHECK-NEXT: f1 ff 35 32
237 { p3 = r5
238 if (p3.new) r17 = memub(r21+r31<<#3) }
239 # CHECK: 03 40 45 85
240 # CHECK-NEXT: f1 ff 35 33
241 { p3 = r5
242 if (!p3.new) r17 = memub(r21+r31<<#3) }
243 # CHECK: f1 db 35 41
244 if (p3) r17 = memub(r21 + #31)
245 # CHECK: 03 40 45 85
246 # CHECK-NEXT: f1 db 35 43
247 { p3 = r5
248 if (p3.new) r17 = memub(r21 + #31) }
249 # CHECK: f1 db 35 45
250 if (!p3) r17 = memub(r21 + #31)
251 # CHECK: 03 40 45 85
252 # CHECK-NEXT: f1 db 35 47
253 { p3 = r5
254 if (!p3.new) r17 = memub(r21 + #31) }
255 # CHECK: b1 e6 35 9b
256 if (p3) r17 = memub(r21++#5)
257 # CHECK: b1 ee 35 9b
258 if (!p3) r17 = memub(r21++#5)
259 # CHECK: 03 40 45 85
260 # CHECK-NEXT: b1 f6 35 9b
261 { p3 = r5
262 if (p3.new) r17 = memub(r21++#5) }
263 # CHECK: 03 40 45 85
264 # CHECK-NEXT: b1 fe 35 9b
265 { p3 = r5
266 if (!p3.new) r17 = memub(r21++#5) }
268 # Load unsigned halfword
269 # CHECK: 91 ff 75 3a
270 r17 = memuh(r21 + r31<<#3)
271 # CHECK: b1 c2 60 49
272 r17 = memuh(gp+#42)
273 # CHECK: 00 40 00 00
274 # CHECK-NEXT: 51 c5 60 49
275 r17 = memuh(##42)
276 # CHECK: b1 c2 75 91
277 r17 = memuh(r21 + #42)
278 # CHECK: b1 e0 75 99
279 r17 = memuh(r21 ++ #10:circ(m1))
280 # CHECK: 11 e2 75 99
281 r17 = memuh(r21 ++ I:circ(m1))
282 # CHECK: 00 40 00 00
283 # CHECK-NEXT: 71 d7 75 9b
284 r17 = memuh(r21 = ##31)
285 # CHECK: b1 c0 75 9b
286 r17 = memuh(r21++#10)
287 # CHECK: 11 e0 75 9d
288 r17 = memuh(r21++m1)
289 # CHECK: 11 e0 75 9f
290 r17 = memuh(r21 ++ m1:brev)
292 # Load unsigned halfword conditionally
293 # CHECK: f1 ff 75 30
294 if (p3) r17 = memuh(r21+r31<<#3)
295 # CHECK: f1 ff 75 31
296 if (!p3) r17 = memuh(r21+r31<<#3)
297 # CHECK: 03 40 45 85
298 # CHECK-NEXT: f1 ff 75 32
299 { p3 = r5
300 if (p3.new) r17 = memuh(r21+r31<<#3) }
301 # CHECK: 03 40 45 85
302 # CHECK-NEXT: f1 ff 75 33
303 { p3 = r5
304 if (!p3.new) r17 = memuh(r21+r31<<#3) }
305 # CHECK: b1 da 75 41
306 if (p3) r17 = memuh(r21 + #42)
307 # CHECK: b1 da 75 45
308 if (!p3) r17 = memuh(r21 + #42)
309 # CHECK: 03 40 45 85
310 # CHECK-NEXT: b1 da 75 43
311 { p3 = r5
312 if (p3.new) r17 = memuh(r21 + #42) }
313 # CHECK: 03 40 45 85
314 # CHECK-NEXT: b1 da 75 47
315 { p3 = r5
316 if (!p3.new) r17 = memuh(r21 + #42) }
317 # CHECK: b1 e6 75 9b
318 if (p3) r17 = memuh(r21++#10)
319 # CHECK: b1 ee 75 9b
320 if (!p3) r17 = memuh(r21++#10)
321 # CHECK: 03 40 45 85
322 # CHECK-NEXT: b1 f6 75 9b
323 { p3 = r5
324 if (p3.new) r17 = memuh(r21++#10) }
325 # CHECK: 03 40 45 85
326 # CHECK-NEXT: b1 fe 75 9b
327 { p3 = r5
328 if (!p3.new) r17 = memuh(r21++#10) }
330 # Load word
331 # CHECK: 91 ff 95 3a
332 r17 = memw(r21 + r31<<#3)
333 # CHECK: b1 c2 80 49
334 r17 = memw(gp+#84)
335 # CHECK: 01 40 00 00
336 # CHECK-NEXT: 91 c2 80 49
337 r17 = memw(##84)
338 # CHECK: b1 c2 95 91
339 r17 = memw(r21 + #84)
340 # CHECK: b1 e0 95 99
341 r17 = memw(r21 ++ #20:circ(m1))
342 # CHECK: 11 e2 95 99
343 r17 = memw(r21 ++ I:circ(m1))
344 # CHECK: 00 40 00 00
345 # CHECK-NEXT: 71 d7 95 9b
346 r17 = memw(r21 = ##31)
347 # CHECK: b1 c0 95 9b
348 r17 = memw(r21++#20)
349 # CHECK: 11 e0 95 9d
350 r17 = memw(r21++m1)
351 # CHECK: 11 e0 95 9f
352 r17 = memw(r21 ++ m1:brev)
354 # Load word conditionally
355 # CHECK: f1 ff 95 30
356 if (p3) r17 = memw(r21+r31<<#3)
357 # CHECK: f1 ff 95 31
358 if (!p3) r17 = memw(r21+r31<<#3)
359 # CHECK: 03 40 45 85
360 # CHECK-NEXT: f1 ff 95 32
361 { p3 = r5
362 if (p3.new) r17 = memw(r21+r31<<#3) }
363 # CHECK: 03 40 45 85
364 # CHECK-NEXT: f1 ff 95 33
365 { p3 = r5
366 if (!p3.new) r17 = memw(r21+r31<<#3) }
367 # CHECK: b1 da 95 41
368 if (p3) r17 = memw(r21 + #84)
369 # CHECK: b1 da 95 45
370 if (!p3) r17 = memw(r21 + #84)
371 # CHECK: 03 40 45 85
372 # CHECK-NEXT: b1 da 95 43
373 { p3 = r5
374 if (p3.new) r17 = memw(r21 + #84) }
375 # CHECK: 03 40 45 85
376 # CHECK-NEXT: b1 da 95 47
377 { p3 = r5
378 if (!p3.new) r17 = memw(r21 + #84) }
379 # CHECK: b1 e6 95 9b
380 if (p3) r17 = memw(r21++#20)
381 # CHECK: b1 ee 95 9b
382 if (!p3) r17 = memw(r21++#20)
383 # CHECK: 03 40 45 85
384 # CHECK-NEXT: b1 f6 95 9b
385 { p3 = r5
386 if (p3.new) r17 = memw(r21++#20) }
387 # CHECK: 03 40 45 85
388 # CHECK-NEXT: b1 fe 95 9b
389 { p3 = r5
390 if (!p3.new) r17 = memw(r21++#20) }
392 # Deallocate stack frame
393 # CHECK: 1e c0 1e 90
394 deallocframe
396 # Deallocate stack frame and return
397 # CHECK: 1e c0 1e 96
398 dealloc_return
399 # CHECK: 03 40 45 85
400 # CHECK-NEXT: 1e cb 1e 96
401 { p3 = r5
402 if (p3.new) dealloc_return:nt }
403 # CHECK: 1e d3 1e 96
404 if (p3) dealloc_return
405 # CHECK: 03 40 45 85
406 # CHECK-NEXT: 1e db 1e 96
407 { p3 = r5
408 if (p3.new) dealloc_return:t }
409 # CHECK: 03 40 45 85
410 # CHECK-NEXT: 1e eb 1e 96
411 { p3 = r5
412 if (!p3.new) dealloc_return:nt }
413 # CHECK: 1e f3 1e 96
414 if (!p3) dealloc_return
415 # CHECK: 03 40 45 85
416 # CHECK-NEXT: 1e fb 1e 96
417 { p3 = r5
418 if (!p3.new) dealloc_return:t }
420 # Load and unpack bytes to halfwords
421 # CHECK: f1 c3 35 90
422 r17 = membh(r21 + #62)
423 # CHECK: f1 c3 75 90
424 r17 = memubh(r21 + #62)
425 # CHECK: f0 c3 b5 90
426 r17:16 = memubh(r21 + #124)
427 # CHECK: f0 c3 f5 90
428 r17:16 = membh(r21 + #124)
429 # CHECK: b1 e0 35 98
430 r17 = membh(r21 ++ #10:circ(m1))
431 # CHECK: 11 e2 35 98
432 r17 = membh(r21 ++ I:circ(m1))
433 # CHECK: b1 e0 75 98
434 r17 = memubh(r21 ++ #10:circ(m1))
435 # CHECK: 11 e2 75 98
436 r17 = memubh(r21 ++ I:circ(m1))
437 # CHECK: b0 e0 f5 98
438 r17:16 = membh(r21 ++ #20:circ(m1))
439 # CHECK: 10 e2 f5 98
440 r17:16 = membh(r21 ++ I:circ(m1))
441 # CHECK: b0 e0 b5 98
442 r17:16 = memubh(r21 ++ #20:circ(m1))
443 # CHECK: 10 e2 b5 98
444 r17:16 = memubh(r21 ++ I:circ(m1))
445 # CHECK: 00 40 00 00
446 # CHECK-NEXT: 71 d7 35 9a
447 r17 = membh(r21 = ##31)
448 # CHECK: b1 c0 35 9a
449 r17 = membh(r21++#10)
450 # CHECK: 00 40 00 00
451 # CHECK-NEXT: 71 d7 75 9a
452 r17 = memubh(r21 = ##31)
453 # CHECK: b1 c0 75 9a
454 r17 = memubh(r21++#10)
455 # CHECK: 00 40 00 00
456 # CHECK-NEXT: 70 d7 b5 9a
457 r17:16 = memubh(r21 = ##31)
458 # CHECK: b0 c0 b5 9a
459 r17:16 = memubh(r21++#20)
460 # CHECK: 00 40 00 00
461 # CHECK-NEXT: 70 d7 f5 9a
462 r17:16 = membh(r21 = ##31)
463 # CHECK: b0 c0 f5 9a
464 r17:16 = membh(r21++#20)
465 # CHECK: 00 40 00 00
466 # CHECK-NEXT: f1 f7 35 9c
467 r17 = membh(r21<<#3 + ##31)
468 # CHECK: 11 e0 35 9c
469 r17 = membh(r21++m1)
470 # CHECK: 00 40 00 00
471 # CHECK-NEXT: f1 f7 75 9c
472 r17 = memubh(r21<<#3 + ##31)
473 # CHECK: 11 e0 75 9c
474 r17 = memubh(r21++m1)
475 # CHECK: 00 40 00 00
476 # CHECK-NEXT: f0 f7 f5 9c
477 r17:16 = membh(r21<<#3 + ##31)
478 # CHECK: 10 e0 f5 9c
479 r17:16 = membh(r21++m1)
480 # CHECK: 00 40 00 00
481 # CHECK-NEXT: f0 f7 b5 9c
482 r17:16 = memubh(r21<<#3 + ##31)
483 # CHECK: 11 e0 35 9c
484 r17 = membh(r21++m1)
485 # CHECK: 11 e0 75 9c
486 r17 = memubh(r21++m1)
487 # CHECK: 10 e0 f5 9c
488 r17:16 = membh(r21++m1)
489 # CHECK: 10 e0 b5 9c
490 r17:16 = memubh(r21++m1)
491 # CHECK: 11 e0 35 9e
492 r17 = membh(r21 ++ m1:brev)
493 # CHECK: 11 e0 75 9e
494 r17 = memubh(r21 ++ m1:brev)
495 # CHECK: 10 e0 b5 9e
496 r17:16 = memubh(r21 ++ m1:brev)
497 # CHECK: 10 e0 f5 9e
498 r17:16 = membh(r21 ++ m1:brev)