OLD | NEW |
---|---|
(Empty) | |
1 ; Tests assembly of ldrex and strex instructions | |
2 | |
3 ; REQUIRES: allow_dump | |
4 | |
5 ; Compile using standalone assembler. | |
6 ; RUN: %p2i --filetype=asm -i %s --target=arm32 --args -Om1 \ | |
7 ; RUN: | FileCheck %s --check-prefix=ASM | |
8 | |
9 ; Show bytes in assembled standalone code. | |
10 ; RUN: %p2i --filetype=asm -i %s --target=arm32 --assemble --disassemble \ | |
11 ; RUN: --args -Om1 | FileCheck %s --check-prefix=DIS | |
12 | |
13 ; Compile using integrated assembler. | |
14 ; RUN: %p2i --filetype=iasm -i %s --target=arm32 --args -Om1 \ | |
15 ; RUN: | FileCheck %s --check-prefix=IASM | |
16 | |
17 ; Show bytes in assembled integrated code. | |
18 ; RUN: %p2i --filetype=iasm -i %s --target=arm32 --assemble --disassemble \ | |
19 ; RUN: --args -Om1 | FileCheck %s --check-prefix=DIS | |
20 | |
21 declare i8 @llvm.nacl.atomic.rmw.i8(i32, i8*, i8, i32) | |
22 | |
23 declare i16 @llvm.nacl.atomic.rmw.i16(i32, i16*, i16, i32) | |
24 | |
25 declare i32 @llvm.nacl.atomic.rmw.i32(i32, i32*, i32, i32) #0 | |
26 | |
27 declare i64 @llvm.nacl.atomic.rmw.i64(i32, i64*, i64, i32) #0 | |
28 | |
29 define internal i32 @testI8Form(i32 %ptr, i32 %a) { | |
30 ; ASM-LABEL:testI8Form: | |
31 ; DIS-LABEL:00000000 <testI8Form>: | |
32 ; IASM-LABEL:testI8Form: | |
33 | |
34 entry: | |
35 ; ASM-NEXT:.LtestI8Form$entry: | |
36 ; IASM-NEXT:.LtestI8Form$entry: | |
37 | |
38 ; ASM-NEXT: sub sp, sp, #28 | |
39 ; DIS-NEXT: 0: e24dd01c | |
40 ; IASM-NEXT: .byte 0x1c | |
41 ; IASM-NEXT: .byte 0xd0 | |
42 ; IASM-NEXT: .byte 0x4d | |
43 ; IASM-NEXT: .byte 0xe2 | |
44 | |
45 ; ASM-NEXT: str r0, [sp, #24] | |
46 ; ASM-NEXT: # [sp, #24] = def.pseudo | |
47 ; DIS-NEXT: 4: e58d0018 | |
48 ; IASM-NEXT: .byte 0x18 | |
49 ; IASM-NEXT: .byte 0x0 | |
50 ; IASM-NEXT: .byte 0x8d | |
51 ; IASM-NEXT: .byte 0xe5 | |
52 | |
53 ; ASM-NEXT: str r1, [sp, #20] | |
54 ; ASM-NEXT: # [sp, #20] = def.pseudo | |
55 ; DIS-NEXT: 8: e58d1014 | |
56 ; IASM-NEXT: .byte 0x14 | |
57 ; IASM-NEXT: .byte 0x10 | |
58 ; IASM-NEXT: .byte 0x8d | |
59 ; IASM-NEXT: .byte 0xe5 | |
60 | |
61 %ptr.asptr = inttoptr i32 %ptr to i8* | |
62 %a.arg_trunc = trunc i32 %a to i8 | |
63 | |
64 ; ASM-NEXT: ldr r0, [sp, #20] | |
65 ; DIS-NEXT: c: e59d0014 | |
66 ; IASM-NEXT: .byte 0x14 | |
67 ; IASM-NEXT: .byte 0x0 | |
68 ; IASM-NEXT: .byte 0x9d | |
69 ; IASM-NEXT: .byte 0xe5 | |
70 | |
71 ; ASM-NEXT: strb r0, [sp, #16] | |
72 ; DIS-NEXT: 10: e5cd0010 | |
73 ; ASM-NEXT: # [sp, #16] = def.pseudo | |
74 ; IASM-NEXT: .byte 0x10 | |
75 ; IASM-NEXT: .byte 0x0 | |
76 ; IASM-NEXT: .byte 0xcd | |
77 ; IASM-NEXT: .byte 0xe5 | |
78 | |
79 %v = call i8 @llvm.nacl.atomic.rmw.i8(i32 1, i8* %ptr.asptr, i8 %a.arg_trunc, i32 6) | |
80 | |
81 ; ASM-NEXT: ldrb r0, [sp, #16] | |
82 ; DIS-NEXT: 14: e5dd0010 | |
83 ; IASM-NEXT: .byte 0x10 | |
84 ; IASM-NEXT: .byte 0x0 | |
85 ; IASM-NEXT: .byte 0xdd | |
86 ; IASM-NEXT: .byte 0xe5 | |
87 | |
88 ; ASM-NEXT: strb r0, [sp, #4] | |
89 ; ASM-NEXT: # [sp, #4] = def.pseudo | |
90 ; DIS-NEXT: 18: e5cd0004 | |
91 ; IASM-NEXT: .byte 0x4 | |
92 ; IASM-NEXT: .byte 0x0 | |
93 ; IASM-NEXT: .byte 0xcd | |
94 ; IASM-NEXT: .byte 0xe5 | |
95 | |
96 ; ASM-NEXT: ldr r0, [sp, #24] | |
97 ; DIS-NEXT: 1c: e59d0018 | |
98 ; IASM-NEXT: .byte 0x18 | |
99 ; IASM-NEXT: .byte 0x0 | |
100 ; IASM-NEXT: .byte 0x9d | |
101 ; IASM-NEXT: .byte 0xe5 | |
102 | |
103 ; ASM-NEXT: str r0, [sp] | |
104 ; ASM-NEXT: # [sp] = def.pseudo | |
105 ; DIS-NEXT: 20: e58d0000 | |
106 ; IASM-NEXT: .byte 0x0 | |
107 ; IASM-NEXT: .byte 0x0 | |
108 ; IASM-NEXT: .byte 0x8d | |
109 ; IASM-NEXT: .byte 0xe5 | |
110 | |
111 ; ASM-NEXT: dmb sy | |
112 ; DIS-NEXT: 24: f57ff05f | |
113 ; IASM-NEXT: .byte 0x5f | |
114 ; IASM-NEXT: .byte 0xf0 | |
115 ; IASM-NEXT: .byte 0x7f | |
116 ; IASM-NEXT: .byte 0xf5 | |
117 | |
118 ; ASM-NEXT:.LtestI8Form$local$__0: | |
119 ; IASM-NEXT:.LtestI8Form$local$__0: | |
120 | |
121 ; ASM-NEXT: ldr r0, [sp] | |
122 ; DIS-NEXT: 28: e59d0000 | |
123 ; IASM-NEXT: .byte 0x0 | |
124 ; IASM-NEXT: .byte 0x0 | |
125 ; IASM-NEXT: .byte 0x9d | |
126 ; IASM-NEXT: .byte 0xe5 | |
127 | |
128 ; ASM-NEXT: ldrb r1, [sp, #4] | |
129 ; DIS-NEXT: 2c: e5dd1004 | |
130 ; IASM-NEXT: .byte 0x4 | |
131 ; IASM-NEXT: .byte 0x10 | |
132 ; IASM-NEXT: .byte 0xdd | |
133 ; IASM-NEXT: .byte 0xe5 | |
134 | |
135 ; ASM-NEXT: uxtb r1, r1 | |
136 ; DIS-NEXT: 30: e6ef1071 | |
137 ; IASM-NEXT: .byte 0x71 | |
138 ; IASM-NEXT: .byte 0x10 | |
139 ; IASM-NEXT: .byte 0xef | |
140 ; IASM-NEXT: .byte 0xe6 | |
141 | |
142 ; ***** Example of ldrexb ***** | |
143 ; ASM-NEXT: ldrexb r2, [r0] | |
144 ; DIS-NEXT: 34: e1d02f9f | |
145 ; IASM-NEXT: .byte 0x9f | |
146 ; IASM-NEXT: .byte 0x2f | |
147 ; IASM-NEXT: .byte 0xd0 | |
148 ; IASM-NEXT: .byte 0xe1 | |
149 | |
150 ; ASM-NEXT: add r1, r2, r1 | |
151 ; ASM-NEXT: # r3 = def.pseudo | |
152 ; DIS-NEXT: 38: e0821001 | |
153 ; IASM-NEXT: .byte 0x1 | |
154 ; IASM-NEXT: .byte 0x10 | |
155 ; IASM-NEXT: .byte 0x82 | |
156 ; IASM-NEXT: .byte 0xe0 | |
157 | |
158 ; ***** Example of strexb ***** | |
159 ; ASM-NEXT: strexb r3, r1, [r0] | |
160 ; DIS-NEXT: 3c: e1c03f91 | |
161 ; IASM-NEXT: .byte 0x91 | |
162 ; IASM-NEXT: .byte 0x3f | |
163 ; IASM-NEXT: .byte 0xc0 | |
164 ; IASM-NEXT: .byte 0xe1 | |
165 | |
166 %retval = zext i8 %v to i32 | |
167 ret i32 %retval | |
168 } | |
169 | |
170 define internal i32 @testI16Form(i32 %ptr, i32 %a) { | |
171 ; ASM-LABEL:testI16Form: | |
172 ; DIS-LABEL:00000070 <testI16Form>: | |
173 ; IASM-LABEL:testI16Form: | |
174 | |
175 entry: | |
176 ; ASM-NEXT:.LtestI16Form$entry: | |
177 ; IASM-NEXT:.LtestI16Form$entry: | |
178 | |
179 ; ASM-NEXT: sub sp, sp, #28 | |
180 ; DIS-NEXT: 70: e24dd01c | |
181 ; IASM-NEXT: .byte 0x1c | |
182 ; IASM-NEXT: .byte 0xd0 | |
183 ; IASM-NEXT: .byte 0x4d | |
184 ; IASM-NEXT: .byte 0xe2 | |
185 | |
186 ; ASM-NEXT: str r0, [sp, #24] | |
187 ; ASM-NEXT: # [sp, #24] = def.pseudo | |
188 ; DIS-NEXT: 74: e58d0018 | |
189 ; IASM-NEXT: .byte 0x18 | |
190 ; IASM-NEXT: .byte 0x0 | |
191 ; IASM-NEXT: .byte 0x8d | |
192 ; IASM-NEXT: .byte 0xe5 | |
193 | |
194 ; ASM-NEXT: str r1, [sp, #20] | |
195 ; ASM-NEXT: # [sp, #20] = def.pseudo | |
196 ; DIS-NEXT: 78: e58d1014 | |
197 ; IASM-NEXT: .byte 0x14 | |
198 ; IASM-NEXT: .byte 0x10 | |
199 ; IASM-NEXT: .byte 0x8d | |
200 ; IASM-NEXT: .byte 0xe5 | |
201 | |
202 %ptr.asptr = inttoptr i32 %ptr to i16* | |
203 %a.arg_trunc = trunc i32 %a to i16 | |
204 | |
205 ; ASM-NEXT: ldr r0, [sp, #20] | |
206 ; DIS-NEXT: 7c: e59d0014 | |
207 ; IASM-NEXT: .byte 0x14 | |
208 ; IASM-NEXT: .byte 0x0 | |
209 ; IASM-NEXT: .byte 0x9d | |
210 ; IASM-NEXT: .byte 0xe5 | |
211 | |
212 ; ASM-NEXT: strh r0, [sp, #16] | |
213 ; ASM-NEXT: # [sp, #16] = def.pseudo | |
214 ; DIS-NEXT: 80: e1cd01b0 | |
215 ; IASM-NEXT: .byte 0xb0 | |
216 ; IASM-NEXT: .byte 0x1 | |
217 ; IASM-NEXT: .byte 0xcd | |
218 ; IASM-NEXT: .byte 0xe1 | |
219 | |
220 %v = call i16 @llvm.nacl.atomic.rmw.i16(i32 1, i16* %ptr.asptr, i16 %a.arg_tru nc, i32 6) | |
John
2015/12/11 16:59:09
80-col? same for the others.
Jim Stichnoth
2015/12/11 17:24:57
We generally haven't enforced 80-col on .ll tests.
Karl
2015/12/11 18:05:08
LLVM IR is free-style, not line based. Fixing by w
| |
221 | |
222 ; ASM-NEXT: ldrh r0, [sp, #16] | |
223 ; DIS-NEXT: 84: e1dd01b0 | |
224 ; IASM-NEXT: .byte 0xb0 | |
225 ; IASM-NEXT: .byte 0x1 | |
226 ; IASM-NEXT: .byte 0xdd | |
227 ; IASM-NEXT: .byte 0xe1 | |
228 | |
229 ; ASM-NEXT: strh r0, [sp, #4] | |
230 ; ASM-NEXT: # [sp, #4] = def.pseudo | |
231 ; DIS-NEXT: 88: e1cd00b4 | |
232 ; IASM-NEXT: .byte 0xb4 | |
233 ; IASM-NEXT: .byte 0x0 | |
234 ; IASM-NEXT: .byte 0xcd | |
235 ; IASM-NEXT: .byte 0xe1 | |
236 | |
237 ; ASM-NEXT: ldr r0, [sp, #24] | |
238 ; DIS-NEXT: 8c: e59d0018 | |
239 ; IASM-NEXT: .byte 0x18 | |
240 ; IASM-NEXT: .byte 0x0 | |
241 ; IASM-NEXT: .byte 0x9d | |
242 ; IASM-NEXT: .byte 0xe5 | |
243 | |
244 ; ASM-NEXT: str r0, [sp] | |
245 ; ASM-NEXT: # [sp] = def.pseudo | |
246 ; DIS-NEXT: 90: e58d0000 | |
247 ; IASM-NEXT: .byte 0x0 | |
248 ; IASM-NEXT: .byte 0x0 | |
249 ; IASM-NEXT: .byte 0x8d | |
250 ; IASM-NEXT: .byte 0xe5 | |
251 | |
252 ; ASM-NEXT: dmb sy | |
253 ; DIS-NEXT: 94: f57ff05f | |
254 ; IASM-NEXT: .byte 0x5f | |
255 ; IASM-NEXT: .byte 0xf0 | |
256 ; IASM-NEXT: .byte 0x7f | |
257 ; IASM-NEXT: .byte 0xf5 | |
258 | |
259 ; ASM-NEXT:.LtestI16Form$local$__0: | |
260 ; IASM-NEXT:.LtestI16Form$local$__0: | |
261 | |
262 ; ASM-NEXT: ldr r0, [sp] | |
263 ; DIS-NEXT: 98: e59d0000 | |
264 ; IASM-NEXT: .byte 0x0 | |
265 ; IASM-NEXT: .byte 0x0 | |
266 ; IASM-NEXT: .byte 0x9d | |
267 ; IASM-NEXT: .byte 0xe5 | |
268 | |
269 ; ASM-NEXT: ldrh r1, [sp, #4] | |
270 ; DIS-NEXT: 9c: e1dd10b4 | |
271 ; IASM-NEXT: .byte 0xb4 | |
272 ; IASM-NEXT: .byte 0x10 | |
273 ; IASM-NEXT: .byte 0xdd | |
274 ; IASM-NEXT: .byte 0xe1 | |
275 | |
276 ; ASM-NEXT: uxth r1, r1 | |
277 ; DIS-NEXT: a0: e6ff1071 | |
278 ; IASM-NEXT: .byte 0x71 | |
279 ; IASM-NEXT: .byte 0x10 | |
280 ; IASM-NEXT: .byte 0xff | |
281 ; IASM-NEXT: .byte 0xe6 | |
282 | |
283 ; ***** Example of ldrexh ***** | |
284 ; ASM-NEXT: ldrexh r2, [r0] | |
285 ; DIS-NEXT: a4: e1f02f9f | |
286 ; IASM-NEXT: .byte 0x9f | |
287 ; IASM-NEXT: .byte 0x2f | |
288 ; IASM-NEXT: .byte 0xf0 | |
289 ; IASM-NEXT: .byte 0xe1 | |
290 | |
291 ; ASM-NEXT: add r1, r2, r1 | |
292 ; ASM-NEXT: # r3 = def.pseudo | |
293 ; DIS-NEXT: a8: e0821001 | |
294 ; IASM-NEXT: .byte 0x1 | |
295 ; IASM-NEXT: .byte 0x10 | |
296 ; IASM-NEXT: .byte 0x82 | |
297 ; IASM-NEXT: .byte 0xe0 | |
298 | |
299 ; ***** Example of strexh ***** | |
300 ; ASM-NEXT: strexh r3, r1, [r0] | |
301 ; DIS-NEXT: ac: e1e03f91 | |
302 ; IASM-NEXT: .byte 0x91 | |
303 ; IASM-NEXT: .byte 0x3f | |
304 ; IASM-NEXT: .byte 0xe0 | |
305 ; IASM-NEXT: .byte 0xe1 | |
306 | |
307 %retval = zext i16 %v to i32 | |
308 ret i32 %retval | |
309 } | |
310 | |
311 define internal i32 @testI32Form(i32 %ptr, i32 %a) { | |
312 ; ASM-LABEL:testI32Form: | |
313 ; DIS-LABEL:000000e0 <testI32Form>: | |
314 ; IASM-LABEL:testI32Form: | |
315 | |
316 entry: | |
317 ; ASM-NEXT:.LtestI32Form$entry: | |
318 ; IASM-NEXT:.LtestI32Form$entry: | |
319 | |
320 ; ASM-NEXT: sub sp, sp, #20 | |
321 ; DIS-NEXT: e0: e24dd014 | |
322 ; IASM-NEXT: .byte 0x14 | |
323 ; IASM-NEXT: .byte 0xd0 | |
324 ; IASM-NEXT: .byte 0x4d | |
325 ; IASM-NEXT: .byte 0xe2 | |
326 | |
327 ; ASM-NEXT: str r0, [sp, #16] | |
328 ; ASM-NEXT: # [sp, #16] = def.pseudo | |
329 ; DIS-NEXT: e4: e58d0010 | |
330 ; IASM-NEXT: .byte 0x10 | |
331 ; IASM-NEXT: .byte 0x0 | |
332 ; IASM-NEXT: .byte 0x8d | |
333 ; IASM-NEXT: .byte 0xe5 | |
334 | |
335 ; ASM-NEXT: str r1, [sp, #12] | |
336 ; ASM-NEXT: # [sp, #12] = def.pseudo | |
337 ; DIS-NEXT: e8: e58d100c | |
338 ; IASM-NEXT: .byte 0xc | |
339 ; IASM-NEXT: .byte 0x10 | |
340 ; IASM-NEXT: .byte 0x8d | |
341 ; IASM-NEXT: .byte 0xe5 | |
342 | |
343 %ptr.asptr = inttoptr i32 %ptr to i32* | |
344 %v = call i32 @llvm.nacl.atomic.rmw.i32(i32 1, i32* %ptr.asptr, i32 %a, i32 6) | |
345 | |
346 ; ASM-NEXT: ldr r0, [sp, #12] | |
347 ; DIS-NEXT: ec: e59d000c | |
348 ; IASM-NEXT: .byte 0xc | |
349 ; IASM-NEXT: .byte 0x0 | |
350 ; IASM-NEXT: .byte 0x9d | |
351 ; IASM-NEXT: .byte 0xe5 | |
352 | |
353 ; ASM-NEXT: str r0, [sp, #4] | |
354 ; ASM-NEXT: # [sp, #4] = def.pseudo | |
355 ; DIS-NEXT: f0: e58d0004 | |
356 ; IASM-NEXT: .byte 0x4 | |
357 ; IASM-NEXT: .byte 0x0 | |
358 ; IASM-NEXT: .byte 0x8d | |
359 ; IASM-NEXT: .byte 0xe5 | |
360 | |
361 ; ASM-NEXT: ldr r0, [sp, #16] | |
362 ; DIS-NEXT: f4: e59d0010 | |
363 ; IASM-NEXT: .byte 0x10 | |
364 ; IASM-NEXT: .byte 0x0 | |
365 ; IASM-NEXT: .byte 0x9d | |
366 ; IASM-NEXT: .byte 0xe5 | |
367 | |
368 ; ASM-NEXT: str r0, [sp] | |
369 ; ASM-NEXT: # [sp] = def.pseudo | |
370 ; DIS-NEXT: f8: e58d0000 | |
371 ; IASM-NEXT: .byte 0x0 | |
372 ; IASM-NEXT: .byte 0x0 | |
373 ; IASM-NEXT: .byte 0x8d | |
374 ; IASM-NEXT: .byte 0xe5 | |
375 | |
376 ; ASM-NEXT: dmb sy | |
377 ; DIS-NEXT: fc: f57ff05f | |
378 ; IASM-NEXT: .byte 0x5f | |
379 ; IASM-NEXT: .byte 0xf0 | |
380 ; IASM-NEXT: .byte 0x7f | |
381 ; IASM-NEXT: .byte 0xf5 | |
382 | |
383 ; ASM-NEXT:.LtestI32Form$local$__0: | |
384 ; IASM-NEXT:.LtestI32Form$local$__0: | |
385 | |
386 ; ASM-NEXT: ldr r0, [sp] | |
387 ; DIS-NEXT: 100: e59d0000 | |
388 ; IASM-NEXT: .byte 0x0 | |
389 ; IASM-NEXT: .byte 0x0 | |
390 ; IASM-NEXT: .byte 0x9d | |
391 ; IASM-NEXT: .byte 0xe5 | |
392 | |
393 ; ASM-NEXT: ldr r1, [sp, #4] | |
394 ; DIS-NEXT: 104: e59d1004 | |
395 ; IASM-NEXT: .byte 0x4 | |
396 ; IASM-NEXT: .byte 0x10 | |
397 ; IASM-NEXT: .byte 0x9d | |
398 ; IASM-NEXT: .byte 0xe5 | |
399 | |
400 ; ***** Example of ldrex ***** | |
401 ; ASM-NEXT: ldrex r2, [r0] | |
402 ; DIS-NEXT: 108: e1902f9f | |
403 ; IASM-NEXT: .byte 0x9f | |
404 ; IASM-NEXT: .byte 0x2f | |
405 ; IASM-NEXT: .byte 0x90 | |
406 ; IASM-NEXT: .byte 0xe1 | |
407 | |
408 ; ASM-NEXT: add r1, r2, r1 | |
409 ; ASM-NEXT: # r3 = def.pseudo | |
410 ; DIS-NEXT: 10c: e0821001 | |
411 ; IASM-NEXT: .byte 0x1 | |
412 ; IASM-NEXT: .byte 0x10 | |
413 ; IASM-NEXT: .byte 0x82 | |
414 ; IASM-NEXT: .byte 0xe0 | |
415 | |
416 ; ***** Example of strex ***** | |
417 ; ASM-NEXT: strex r3, r1, [r0] | |
418 ; DIS-NEXT: 110: e1803f91 | |
419 ; IASM-NEXT: .byte 0x91 | |
420 ; IASM-NEXT: .byte 0x3f | |
421 ; IASM-NEXT: .byte 0x80 | |
422 ; IASM-NEXT: .byte 0xe1 | |
423 | |
424 ret i32 %v | |
425 } | |
426 | |
427 define internal i64 @testI64Form(i32 %ptr, i64 %a) { | |
428 ; ASM-LABEL:testI64Form: | |
429 ; DIS-LABEL:00000130 <testI64Form>: | |
430 ; IASM-LABEL:testI64Form: | |
431 | |
432 entry: | |
433 ; ASM-NEXT:.LtestI64Form$entry: | |
434 ; IASM-NEXT:.LtestI64Form$entry: | |
435 | |
436 ; ASM-NEXT: push {r4, r5} | |
437 ; DIS-NEXT: 130: e92d0030 | |
438 ; IASM-NEXT: .byte 0x30 | |
439 ; IASM-NEXT: .byte 0x0 | |
440 ; IASM-NEXT: .byte 0x2d | |
441 ; IASM-NEXT: .byte 0xe9 | |
442 | |
443 ; ASM-NEXT: sub sp, sp, #32 | |
444 ; DIS-NEXT: 134: e24dd020 | |
445 ; IASM-NEXT: .byte 0x20 | |
446 ; IASM-NEXT: .byte 0xd0 | |
447 ; IASM-NEXT: .byte 0x4d | |
448 ; IASM-NEXT: .byte 0xe2 | |
449 | |
450 ; ASM-NEXT: str r0, [sp, #28] | |
451 ; ASM-NEXT: # [sp, #28] = def.pseudo | |
452 ; DIS-NEXT: 138: e58d001c | |
453 ; IASM-NEXT: .byte 0x1c | |
454 ; IASM-NEXT: .byte 0x0 | |
455 ; IASM-NEXT: .byte 0x8d | |
456 ; IASM-NEXT: .byte 0xe5 | |
457 | |
458 ; ASM-NEXT: mov r0, r2 | |
459 ; DIS-NEXT: 13c: e1a00002 | |
460 ; IASM-NEXT: .byte 0x2 | |
461 ; IASM-NEXT: .byte 0x0 | |
462 ; IASM-NEXT: .byte 0xa0 | |
463 ; IASM-NEXT: .byte 0xe1 | |
464 | |
465 ; ASM-NEXT: str r0, [sp, #24] | |
466 ; ASM-NEXT: # [sp, #24] = def.pseudo | |
467 ; DIS-NEXT: 140: e58d0018 | |
468 ; IASM-NEXT: .byte 0x18 | |
469 ; IASM-NEXT: .byte 0x0 | |
470 ; IASM-NEXT: .byte 0x8d | |
471 ; IASM-NEXT: .byte 0xe5 | |
472 | |
473 ; ASM-NEXT: mov r0, r3 | |
474 ; DIS-NEXT: 144: e1a00003 | |
475 ; IASM-NEXT: .byte 0x3 | |
476 ; IASM-NEXT: .byte 0x0 | |
477 ; IASM-NEXT: .byte 0xa0 | |
478 ; IASM-NEXT: .byte 0xe1 | |
479 | |
480 ; ASM-NEXT: str r0, [sp, #20] | |
481 ; ASM-NEXT: # [sp, #20] = def.pseudo | |
482 ; ASM-NEXT: # [sp] = def.pseudo | |
483 ; DIS-NEXT: 148: e58d0014 | |
484 ; IASM-NEXT: .byte 0x14 | |
485 ; IASM-NEXT: .byte 0x0 | |
486 ; IASM-NEXT: .byte 0x8d | |
487 ; IASM-NEXT: .byte 0xe5 | |
488 | |
489 %ptr.asptr = inttoptr i32 %ptr to i64* | |
490 %v = call i64 @llvm.nacl.atomic.rmw.i64(i32 1, i64* %ptr.asptr, i64 %a, i32 6) | |
491 | |
492 ; ASM-NEXT: ldr r0, [sp, #24] | |
493 ; DIS-NEXT: 14c: e59d0018 | |
494 ; IASM-NEXT: .byte 0x18 | |
495 ; IASM-NEXT: .byte 0x0 | |
496 ; IASM-NEXT: .byte 0x9d | |
497 ; IASM-NEXT: .byte 0xe5 | |
498 | |
499 ; ASM-NEXT: str r0, [sp, #8] | |
500 ; ASM-NEXT: # [sp, #8] = def.pseudo | |
501 ; DIS-NEXT: 150: e58d0008 | |
502 ; IASM-NEXT: .byte 0x8 | |
503 ; IASM-NEXT: .byte 0x0 | |
504 ; IASM-NEXT: .byte 0x8d | |
505 ; IASM-NEXT: .byte 0xe5 | |
506 | |
507 ; ASM-NEXT: ldr r0, [sp, #20] | |
508 ; DIS-NEXT: 154: e59d0014 | |
509 ; IASM-NEXT: .byte 0x14 | |
510 ; IASM-NEXT: .byte 0x0 | |
511 ; IASM-NEXT: .byte 0x9d | |
512 ; IASM-NEXT: .byte 0xe5 | |
513 | |
514 ; ASM-NEXT: str r0, [sp, #4] | |
515 ; ASM-NEXT: # [sp, #4] = def.pseudo | |
516 ; DIS-NEXT: 158: e58d0004 | |
517 ; IASM-NEXT: .byte 0x4 | |
518 ; IASM-NEXT: .byte 0x0 | |
519 ; IASM-NEXT: .byte 0x8d | |
520 ; IASM-NEXT: .byte 0xe5 | |
521 | |
522 ; ASM-NEXT: ldr r0, [sp, #28] | |
523 ; DIS-NEXT: 15c: e59d001c | |
524 ; IASM-NEXT: .byte 0x1c | |
525 ; IASM-NEXT: .byte 0x0 | |
526 ; IASM-NEXT: .byte 0x9d | |
527 ; IASM-NEXT: .byte 0xe5 | |
528 | |
529 ; ASM-NEXT: str r0, [sp] | |
530 ; ASM-NEXT: # [sp] = def.pseudo | |
531 ; DIS-NEXT: 160: e58d0000 | |
532 ; IASM-NEXT: .byte 0x0 | |
533 ; IASM-NEXT: .byte 0x0 | |
534 ; IASM-NEXT: .byte 0x8d | |
535 ; IASM-NEXT: .byte 0xe5 | |
536 | |
537 ; ASM-NEXT: dmb sy | |
538 ; DIS-NEXT: 164: f57ff05f | |
539 ; IASM-NEXT: .byte 0x5f | |
540 ; IASM-NEXT: .byte 0xf0 | |
541 ; IASM-NEXT: .byte 0x7f | |
542 ; IASM-NEXT: .byte 0xf5 | |
543 | |
544 ; ASM-NEXT:.LtestI64Form$local$__0: | |
545 ; IASM-NEXT:.LtestI64Form$local$__0: | |
546 | |
547 ; ASM-NEXT: ldr r0, [sp] | |
548 ; ASM-NEXT: # r2, r3 = def.pseudo [sp] | |
549 ; DIS-NEXT: 168: e59d0000 | |
550 ; IASM-NEXT: .byte 0x0 | |
551 ; IASM-NEXT: .byte 0x0 | |
552 ; IASM-NEXT: .byte 0x9d | |
553 ; IASM-NEXT: .byte 0xe5 | |
554 | |
555 ; ASM-NEXT: ldr r1, [sp, #8] | |
556 ; DIS-NEXT: 16c: e59d1008 | |
557 ; IASM-NEXT: .byte 0x8 | |
558 ; IASM-NEXT: .byte 0x10 | |
559 ; IASM-NEXT: .byte 0x9d | |
560 ; IASM-NEXT: .byte 0xe5 | |
561 | |
562 ; ASM-NEXT: mov r2, r1 | |
563 ; DIS-NEXT: 170: e1a02001 | |
564 ; IASM-NEXT: .byte 0x1 | |
565 ; IASM-NEXT: .byte 0x20 | |
566 ; IASM-NEXT: .byte 0xa0 | |
567 ; IASM-NEXT: .byte 0xe1 | |
568 | |
569 ; ASM-NEXT: ldr r1, [sp, #4] | |
570 ; DIS-NEXT: 174: e59d1004 | |
571 ; IASM-NEXT: .byte 0x4 | |
572 ; IASM-NEXT: .byte 0x10 | |
573 ; IASM-NEXT: .byte 0x9d | |
574 ; IASM-NEXT: .byte 0xe5 | |
575 | |
576 ; ASM-NEXT: mov r3, r1 | |
577 ; DIS-NEXT: 178: e1a03001 | |
578 ; IASM-NEXT: .byte 0x1 | |
579 ; IASM-NEXT: .byte 0x30 | |
580 ; IASM-NEXT: .byte 0xa0 | |
581 ; IASM-NEXT: .byte 0xe1 | |
582 | |
583 ; ***** Example of ldrexd ***** | |
584 ; ASM-NEXT: ldrexd r4, r5, [r0] | |
585 ; ASM-NEXT: # r4 = def.pseudo r4, r5 | |
586 ; ASM-NEXT: # r5 = def.pseudo r4, r5 | |
587 ; ASM-NEXT: # r2, r3 = def.pseudo r2, r3 | |
588 ; DIS-NEXT: 17c: e1b04f9f | |
589 ; IASM-NEXT: .byte 0x9f | |
590 ; IASM-NEXT: .byte 0x4f | |
591 ; IASM-NEXT: .byte 0xb0 | |
592 ; IASM-NEXT: .byte 0xe1 | |
593 | |
594 ; ASM-NEXT: adds r2, r4, r2 | |
595 ; DIS-NEXT: 180: e0942002 | |
596 ; IASM-NEXT: .byte 0x2 | |
597 ; IASM-NEXT: .byte 0x20 | |
598 ; IASM-NEXT: .byte 0x94 | |
599 ; IASM-NEXT: .byte 0xe0 | |
600 | |
601 ; ASM-NEXT: adc r3, r5, r3 | |
602 ; ASM-NEXT: # r1 = def.pseudo | |
603 ; DIS-NEXT: 184: e0a53003 | |
604 ; IASM-NEXT: .byte 0x3 | |
605 ; IASM-NEXT: .byte 0x30 | |
606 ; IASM-NEXT: .byte 0xa5 | |
607 ; IASM-NEXT: .byte 0xe0 | |
608 | |
609 ; ***** Example of strexd ***** | |
610 ; ASM-NEXT: strexd r1, r2, r3, [r0] | |
611 ; DIS-NEXT: 188: e1a01f92 | |
612 ; IASM-NEXT: .byte 0x92 | |
613 ; IASM-NEXT: .byte 0x1f | |
614 ; IASM-NEXT: .byte 0xa0 | |
615 ; IASM-NEXT: .byte 0xe1 | |
616 | |
617 ret i64 %v | |
618 } | |
OLD | NEW |