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