1 # RUN: llvm-mc -triple hexagon -disassemble < %s | FileCheck %s
2 # Hexagon Programmer's Reference Manual 11.5 LD
6 # CHECK: r17:16 = memd(r21+r31<<#3)
8 # CHECK: r17:16 = memd(gp+#168)
9 0x02 0x40 0x00 0x00 0x10 0xc5 0xc0 0x49
10 # CHECK: r17:16 = memd(##168)
12 # CHECK: r17:16 = memd(r21+#48)
14 # CHECK: r17:16 = memd(r21++#40:circ(m1))
16 # CHECK: r17:16 = memd(r21++I:circ(m1))
17 0x00 0x40 0x00 0x00 0x70 0xd7 0xd5 0x9b
18 # CHECK: r17:16 = memd(r21=##31)
20 # CHECK: r17:16 = memd(r21++#40)
22 # CHECK: r17:16 = memd(r21++m1)
24 # CHECK: r17:16 = memd(r21++m1:brev)
26 # Load doubleword conditionally
28 # CHECK: if (p3) r17:16 = memd(r21+r31<<#3)
30 # CHECK: if (!p3) r17:16 = memd(r21+r31<<#3)
31 0x03 0x40 0x45 0x85 0xf0 0xff 0xd5 0x32
33 # CHECK-NEXT: if (p3.new) r17:16 = memd(r21+r31<<#3)
34 0x03 0x40 0x45 0x85 0xf0 0xff 0xd5 0x33
36 # CHECK-NEXT: if (!p3.new) r17:16 = memd(r21+r31<<#3)
38 # CHECK: if (p3) r17:16 = memd(r21+#24)
39 0x03 0x40 0x45 0x85 0x70 0xd8 0xd5 0x43
41 # CHECK-NEXT: if (p3.new) r17:16 = memd(r21+#24)
43 # CHECK: if (!p3) r17:16 = memd(r21+#24)
44 0x03 0x40 0x45 0x85 0x70 0xd8 0xd5 0x47
46 # CHECK-NEXT: if (!p3.new) r17:16 = memd(r21+#24)
48 # CHECK: if (p3) r17:16 = memd(r21++#40)
50 # CHECK: if (!p3) r17:16 = memd(r21++#40)
51 0x03 0x40 0x45 0x85 0xb0 0xf6 0xd5 0x9b
53 # CHECK-NEXT: if (p3.new) r17:16 = memd(r21++#40)
54 0x03 0x40 0x45 0x85 0xb0 0xfe 0xd5 0x9b
56 # CHECK-NEXT: if (!p3.new) r17:16 = memd(r21++#40)
60 # CHECK: r17 = memb(r21+r31<<#3)
62 # CHECK: r17 = memb(gp+#21)
63 0x00 0x40 0x00 0x00 0xb1 0xc2 0x00 0x49
64 # CHECK: r17 = memb(##21)
66 # CHECK: r17 = memb(r21+#31)
68 # CHECK: r17 = memb(r21++#5:circ(m1))
70 # CHECK: r17 = memb(r21++I:circ(m1))
71 0x00 0x40 0x00 0x00 0x71 0xd7 0x15 0x9b
72 # CHECK: r17 = memb(r21=##31)
74 # CHECK: r17 = memb(r21++#5)
76 # CHECK: r17 = memb(r21++m1)
78 # CHECK: r17 = memb(r21++m1:brev)
80 # Load byte conditionally
82 # CHECK: if (p3) r17 = memb(r21+r31<<#3)
84 # CHECK: if (!p3) r17 = memb(r21+r31<<#3)
85 0x03 0x40 0x45 0x85 0xf1 0xff 0x15 0x32
87 # CHECK-NEXT: if (p3.new) r17 = memb(r21+r31<<#3)
88 0x03 0x40 0x45 0x85 0xf1 0xff 0x15 0x33
90 # CHECK-NEXT: if (!p3.new) r17 = memb(r21+r31<<#3)
92 # CHECK: if (p3) r17 = memb(r21+#44)
93 0x03 0x40 0x45 0x85 0x91 0xdd 0x15 0x43
95 # CHECK-NEXT: if (p3.new) r17 = memb(r21+#44)
97 # CHECK: if (!p3) r17 = memb(r21+#44)
98 0x03 0x40 0x45 0x85 0x91 0xdd 0x15 0x47
100 # CHECK-NEXT: if (!p3.new) r17 = memb(r21+#44)
102 # CHECK: if (p3) r17 = memb(r21++#5)
104 # CHECK: if (!p3) r17 = memb(r21++#5)
105 0x03 0x40 0x45 0x85 0xb1 0xf6 0x15 0x9b
107 # CHECK-NEXT: if (p3.new) r17 = memb(r21++#5)
108 0x03 0x40 0x45 0x85 0xb1 0xfe 0x15 0x9b
110 # CHECK-NEXT: if (!p3.new) r17 = memb(r21++#5)
112 # Load byte into shifted vector
114 # CHECK: r17:16 = memb_fifo(r21+#31)
116 # CHECK: r17:16 = memb_fifo(r21++#5:circ(m1))
118 # CHECK: r17:16 = memb_fifo(r21++I:circ(m1))
120 # Load half into shifted vector
122 # CHECK: r17:16 = memh_fifo(r21+#62)
124 # CHECK: r17:16 = memh_fifo(r21++#10:circ(m1))
126 # CHECK: r17:16 = memh_fifo(r21++I:circ(m1))
130 # CHECK: r17 = memh(r21+r31<<#3)
132 # CHECK: r17 = memh(gp+#42)
133 0x00 0x40 0x00 0x00 0x51 0xc5 0x40 0x49
134 # CHECK: r17 = memh(##42)
136 # CHECK: r17 = memh(r21+#62)
138 # CHECK: r17 = memh(r21++#10:circ(m1))
140 # CHECK: r17 = memh(r21++I:circ(m1))
141 0x00 0x40 0x00 0x00 0x71 0xd7 0x55 0x9b
142 # CHECK: r17 = memh(r21=##31)
144 # CHECK: r17 = memh(r21++#10)
146 # CHECK: r17 = memh(r21++m1)
148 # CHECK: r17 = memh(r21++m1:brev)
150 # Load halfword conditionally
152 # CHECK: if (p3) r17 = memh(r21+r31<<#3)
154 # CHECK: if (!p3) r17 = memh(r21+r31<<#3)
155 0x03 0x40 0x45 0x85 0xf1 0xff 0x55 0x32
157 # CHECK-NEXT: if (p3.new) r17 = memh(r21+r31<<#3)
158 0x03 0x40 0x45 0x85 0xf1 0xff 0x55 0x33
160 # CHECK-NEXT: if (!p3.new) r17 = memh(r21+r31<<#3)
162 # CHECK: if (p3) r17 = memh(r21++#10)
164 # CHECK: if (!p3) r17 = memh(r21++#10)
165 0x03 0x40 0x45 0x85 0xb1 0xf6 0x55 0x9b
167 # CHECK-NEXT: if (p3.new) r17 = memh(r21++#10)
168 0x03 0x40 0x45 0x85 0xb1 0xfe 0x55 0x9b
170 # CHECK-NEXT: if (!p3.new) r17 = memh(r21++#10)
172 # CHECK: if (p3) r17 = memh(r21+#62)
174 # CHECK: if (!p3) r17 = memh(r21+#62)
175 0x03 0x40 0x45 0x85 0xf1 0xdb 0x55 0x43
177 # CHECK-NEXT: if (p3.new) r17 = memh(r21+#62)
178 0x03 0x40 0x45 0x85 0xf1 0xdb 0x55 0x47
180 # CHECK-NEXT: if (!p3.new) r17 = memh(r21+#62)
184 # CHECK: r17 = memub(r21+r31<<#3)
186 # CHECK: r17 = memub(gp+#21)
187 0x00 0x40 0x00 0x00 0xb1 0xc2 0x20 0x49
188 # CHECK: r17 = memub(##21)
190 # CHECK: r17 = memub(r21+#31)
192 # CHECK: r17 = memub(r21++#5:circ(m1))
194 # CHECK: r17 = memub(r21++I:circ(m1))
195 0x00 0x40 0x00 0x00 0x71 0xd7 0x35 0x9b
196 # CHECK: r17 = memub(r21=##31)
198 # CHECK: r17 = memub(r21++#5)
200 # CHECK: r17 = memub(r21++m1)
202 # CHECK: r17 = memub(r21++m1:brev)
204 # Load unsigned byte conditionally
206 # CHECK: if (p3) r17 = memub(r21+r31<<#3)
208 # CHECK: if (!p3) r17 = memub(r21+r31<<#3)
209 0x03 0x40 0x45 0x85 0xf1 0xff 0x35 0x32
211 # CHECK-NEXT: if (p3.new) r17 = memub(r21+r31<<#3)
212 0x03 0x40 0x45 0x85 0xf1 0xff 0x35 0x33
214 # CHECK-NEXT: if (!p3.new) r17 = memub(r21+r31<<#3)
216 # CHECK: if (p3) r17 = memub(r21+#31)
217 0x03 0x40 0x45 0x85 0xf1 0xdb 0x35 0x43
219 # CHECK-NEXT: if (p3.new) r17 = memub(r21+#31)
221 # CHECK: if (!p3) r17 = memub(r21+#31)
222 0x03 0x40 0x45 0x85 0xf1 0xdb 0x35 0x47
224 # CHECK-NEXT: if (!p3.new) r17 = memub(r21+#31)
226 # CHECK: if (p3) r17 = memub(r21++#5)
228 # CHECK: if (!p3) r17 = memub(r21++#5)
229 0x03 0x40 0x45 0x85 0xb1 0xf6 0x35 0x9b
231 # CHECK-NEXT: if (p3.new) r17 = memub(r21++#5)
232 0x03 0x40 0x45 0x85 0xb1 0xfe 0x35 0x9b
234 # CHECK-NEXT: if (!p3.new) r17 = memub(r21++#5)
236 # Load unsigned halfword
238 # CHECK: r17 = memuh(r21+r31<<#3)
240 # CHECK: r17 = memuh(gp+#42)
241 0x00 0x40 0x00 0x00 0x51 0xc5 0x60 0x49
242 # CHECK: r17 = memuh(##42)
244 # CHECK: r17 = memuh(r21+#42)
246 # CHECK: r17 = memuh(r21++#10:circ(m1))
248 # CHECK: r17 = memuh(r21++I:circ(m1))
249 0x00 0x40 0x00 0x00 0x71 0xd7 0x75 0x9b
250 # CHECK: r17 = memuh(r21=##31)
252 # CHECK: r17 = memuh(r21++#10)
254 # CHECK: r17 = memuh(r21++m1)
256 # CHECK: r17 = memuh(r21++m1:brev)
258 # Load unsigned halfword conditionally
260 # CHECK: if (p3) r17 = memuh(r21+r31<<#3)
262 # CHECK: if (!p3) r17 = memuh(r21+r31<<#3)
263 0x03 0x40 0x45 0x85 0xf1 0xff 0x75 0x32
265 # CHECK-NEXT: if (p3.new) r17 = memuh(r21+r31<<#3)
266 0x03 0x40 0x45 0x85 0xf1 0xff 0x75 0x33
268 # CHECK-NEXT: if (!p3.new) r17 = memuh(r21+r31<<#3)
270 # CHECK: if (p3) r17 = memuh(r21+#42)
272 # CHECK: if (!p3) r17 = memuh(r21+#42)
273 0x03 0x40 0x45 0x85 0xb1 0xda 0x75 0x43
275 # CHECK-NEXT: if (p3.new) r17 = memuh(r21+#42)
276 0x03 0x40 0x45 0x85 0xb1 0xda 0x75 0x47
278 # CHECK-NEXT: if (!p3.new) r17 = memuh(r21+#42)
280 # CHECK: if (p3) r17 = memuh(r21++#10)
282 # CHECK: if (!p3) r17 = memuh(r21++#10)
283 0x03 0x40 0x45 0x85 0xb1 0xf6 0x75 0x9b
285 # CHECK-NEXT: if (p3.new) r17 = memuh(r21++#10)
286 0x03 0x40 0x45 0x85 0xb1 0xfe 0x75 0x9b
288 # CHECK-NEXT: if (!p3.new) r17 = memuh(r21++#10)
292 # CHECK: r17 = memw(r21+r31<<#3)
294 # CHECK: r17 = memw(gp+#84)
295 0x01 0x40 0x00 0x00 0x91 0xc2 0x80 0x49
296 # CHECK: r17 = memw(##84)
298 # CHECK: r17 = memw(r21+#84)
300 # CHECK: r17 = memw(r21++#20:circ(m1))
302 # CHECK: r17 = memw(r21++I:circ(m1))
303 0x00 0x40 0x00 0x00 0x71 0xd7 0x95 0x9b
304 # CHECK: r17 = memw(r21=##31)
306 # CHECK: r17 = memw(r21++#20)
308 # CHECK: r17 = memw(r21++m1)
310 # CHECK: r17 = memw(r21++m1:brev)
312 # Load word conditionally
314 # CHECK: if (p3) r17 = memw(r21+r31<<#3)
316 # CHECK: if (!p3) r17 = memw(r21+r31<<#3)
317 0x03 0x40 0x45 0x85 0xf1 0xff 0x95 0x32
319 # CHECK-NEXT: if (p3.new) r17 = memw(r21+r31<<#3)
320 0x03 0x40 0x45 0x85 0xf1 0xff 0x95 0x33
322 # CHECK-NEXT: if (!p3.new) r17 = memw(r21+r31<<#3)
324 # CHECK: if (p3) r17 = memw(r21+#84)
326 # CHECK: if (!p3) r17 = memw(r21+#84)
327 0x03 0x40 0x45 0x85 0xb1 0xda 0x95 0x43
329 # CHECK-NEXT: if (p3.new) r17 = memw(r21+#84)
330 0x03 0x40 0x45 0x85 0xb1 0xda 0x95 0x47
332 # CHECK-NEXT: if (!p3.new) r17 = memw(r21+#84)
334 # CHECK: if (p3) r17 = memw(r21++#20)
336 # CHECK: if (!p3) r17 = memw(r21++#20)
337 0x03 0x40 0x45 0x85 0xb1 0xf6 0x95 0x9b
339 # CHECK-NEXT: if (p3.new) r17 = memw(r21++#20)
340 0x03 0x40 0x45 0x85 0xb1 0xfe 0x95 0x9b
342 # CHECK-NEXT: if (!p3.new) r17 = memw(r21++#20)
344 # Deallocate stack frame
346 # CHECK: deallocframe
348 # Deallocate stack frame and return
350 # CHECK: dealloc_return
351 0x03 0x40 0x45 0x85 0x1e 0xcb 0x1e 0x96
353 # CHECK-NEXT: if (p3.new) dealloc_return:nt
355 # CHECK: if (p3) dealloc_return
356 0x03 0x40 0x45 0x85 0x1e 0xdb 0x1e 0x96
358 # CHECK-NEXT: if (p3.new) dealloc_return:t
359 0x03 0x40 0x45 0x85 0x1e 0xeb 0x1e 0x96
361 # CHECK-NEXT: if (!p3.new) dealloc_return:nt
363 # CHECK: if (!p3) dealloc_return
364 0x03 0x40 0x45 0x85 0x1e 0xfb 0x1e 0x96
366 # CHECK-NEXT: if (!p3.new) dealloc_return:t
368 # Load and unpack bytes to halfwords
370 # CHECK: r17 = membh(r21+#62)
372 # CHECK: r17 = memubh(r21+#62)
374 # CHECK: r17:16 = memubh(r21+#124)
376 # CHECK: r17:16 = membh(r21+#124)
378 # CHECK: r17 = membh(r21++#10:circ(m1))
380 # CHECK: r17 = membh(r21++I:circ(m1))
382 # CHECK: r17 = memubh(r21++#10:circ(m1))
384 # CHECK: r17 = memubh(r21++I:circ(m1))
386 # CHECK: r17:16 = membh(r21++#20:circ(m1))
388 # CHECK: r17:16 = membh(r21++I:circ(m1))
390 # CHECK: r17:16 = memubh(r21++#20:circ(m1))
392 # CHECK: r17:16 = memubh(r21++I:circ(m1))
393 0x00 0x40 0x00 0x00 0x71 0xd7 0x35 0x9a
394 # CHECK: r17 = membh(r21=##31)
396 # CHECK: r17 = membh(r21++#10)
397 0x00 0x40 0x00 0x00 0x71 0xd7 0x75 0x9a
398 # CHECK: r17 = memubh(r21=##31)
400 # CHECK: r17 = memubh(r21++#10)
401 0x00 0x40 0x00 0x00 0x70 0xd7 0xb5 0x9a
402 # CHECK: r17:16 = memubh(r21=##31)
404 # CHECK: r17:16 = memubh(r21++#20)
405 0x00 0x40 0x00 0x00 0x70 0xd7 0xf5 0x9a
406 # CHECK: r17:16 = membh(r21=##31)
408 # CHECK: r17:16 = membh(r21++#20)
409 0x00 0x40 0x00 0x00 0xf1 0xf7 0x35 0x9c
410 # CHECK: r17 = membh(r21<<#3+##31)
412 # CHECK: r17 = membh(r21++m1)
413 0x00 0x40 0x00 0x00 0xf1 0xf7 0x75 0x9c
414 # CHECK: r17 = memubh(r21<<#3+##31)
416 # CHECK: r17 = memubh(r21++m1)
417 0x00 0x40 0x00 0x00 0xf0 0xf7 0xf5 0x9c
418 # CHECK: r17:16 = membh(r21<<#3+##31)
420 # CHECK: r17:16 = membh(r21++m1)
421 0x00 0x40 0x00 0x00 0xf0 0xf7 0xb5 0x9c
422 # CHECK: r17:16 = memubh(r21<<#3+##31)
424 # CHECK: r17 = membh(r21++m1)
426 # CHECK: r17 = memubh(r21++m1)
428 # CHECK: r17:16 = membh(r21++m1)
430 # CHECK: r17:16 = memubh(r21++m1)
432 # CHECK: r17 = membh(r21++m1:brev)
434 # CHECK: r17 = memubh(r21++m1:brev)
436 # CHECK: r17:16 = memubh(r21++m1:brev)
438 # CHECK: r17:16 = membh(r21++m1:brev)