Silence -Wunused-variable in release builds.
[llvm/stm8.git] / test / MC / ARM / arm_instructions.s
blob66fc87f3de06b12c20a953bfe73ad9fcbe6294c3
1 @ RUN: llvm-mc -mcpu=cortex-a8 -triple arm-unknown-unknown -show-encoding %s | FileCheck %s
3 @ CHECK: nop
4 @ CHECK: encoding: [0x00,0xf0,0x20,0xe3]
5 nop
7 @ CHECK: nopeq
8 @ CHECK: encoding: [0x00,0xf0,0x20,0x03]
9 nopeq
11 @ CHECK: trap
12 @ CHECK: encoding: [0xfe,0xde,0xff,0xe7]
13 trap
15 @ CHECK: bx lr
16 @ CHECK: encoding: [0x1e,0xff,0x2f,0xe1]
17 bx lr
19 @ CHECK: vqdmull.s32 q8, d17, d16
20 @ CHECK: encoding: [0xa0,0x0d,0xe1,0xf2]
21 vqdmull.s32 q8, d17, d16
23 @ CHECK: ldmia r2, {r1, r3, r4, r5, r6, sp} @ encoding: [0x7a,0x20,0x92,0xe8]
24 @ CHECK: ldmia r2, {r1, r3, r4, r5, r6, sp} @ encoding: [0x7a,0x20,0x92,0xe8]
25 @ CHECK: ldmib r2, {r1, r3, r4, r5, r6, sp} @ encoding: [0x7a,0x20,0x92,0xe9]
26 @ CHECK: ldmda r2, {r1, r3, r4, r5, r6, sp} @ encoding: [0x7a,0x20,0x12,0xe8]
27 @ CHECK: ldmdb r2, {r1, r3, r4, r5, r6, sp} @ encoding: [0x7a,0x20,0x12,0xe9]
28 @ CHECK: ldmia r2, {r1, r3, r4, r5, r6, sp} @ encoding: [0x7a,0x20,0x92,0xe8]
29 ldm r2, {r1,r3-r6,sp}
30 ldmia r2, {r1,r3-r6,sp}
31 ldmib r2, {r1,r3-r6,sp}
32 ldmda r2, {r1,r3-r6,sp}
33 ldmdb r2, {r1,r3-r6,sp}
34 ldmfd r2, {r1,r3-r6,sp}
36 @ CHECK: stmia r2, {r1, r3, r4, r5, r6, sp} @ encoding: [0x7a,0x20,0x82,0xe8]
37 @ CHECK: stmia r2, {r1, r3, r4, r5, r6, sp} @ encoding: [0x7a,0x20,0x82,0xe8]
38 @ CHECK: stmib r2, {r1, r3, r4, r5, r6, sp} @ encoding: [0x7a,0x20,0x82,0xe9]
39 @ CHECK: stmda r2, {r1, r3, r4, r5, r6, sp} @ encoding: [0x7a,0x20,0x02,0xe8]
40 @ CHECK: stmdb r2, {r1, r3, r4, r5, r6, sp} @ encoding: [0x7a,0x20,0x02,0xe9]
41 @ CHECK: stmdb r2, {r1, r3, r4, r5, r6, sp} @ encoding: [0x7a,0x20,0x02,0xe9]
42 stm r2, {r1,r3-r6,sp}
43 stmia r2, {r1,r3-r6,sp}
44 stmib r2, {r1,r3-r6,sp}
45 stmda r2, {r1,r3-r6,sp}
46 stmdb r2, {r1,r3-r6,sp}
47 stmfd r2, {r1,r3-r6,sp}
49 @ CHECK: ldmia r2!, {r1, r3, r4, r5, r6, sp} @ encoding: [0x7a,0x20,0xb2,0xe8]
50 @ CHECK: ldmib r2!, {r1, r3, r4, r5, r6, sp} @ encoding: [0x7a,0x20,0xb2,0xe9]
51 @ CHECK: ldmda r2!, {r1, r3, r4, r5, r6, sp} @ encoding: [0x7a,0x20,0x32,0xe8]
52 @ CHECK: ldmdb r2!, {r1, r3, r4, r5, r6, sp} @ encoding: [0x7a,0x20,0x32,0xe9]
53 ldmia r2!, {r1,r3-r6,sp}
54 ldmib r2!, {r1,r3-r6,sp}
55 ldmda r2!, {r1,r3-r6,sp}
56 ldmdb r2!, {r1,r3-r6,sp}
58 @ CHECK: stmia r2!, {r1, r3, r4, r5, r6, sp} @ encoding: [0x7a,0x20,0xa2,0xe8]
59 @ CHECK: stmib r2!, {r1, r3, r4, r5, r6, sp} @ encoding: [0x7a,0x20,0xa2,0xe9]
60 @ CHECK: stmda r2!, {r1, r3, r4, r5, r6, sp} @ encoding: [0x7a,0x20,0x22,0xe8]
61 @ CHECK: stmdb r2!, {r1, r3, r4, r5, r6, sp} @ encoding: [0x7a,0x20,0x22,0xe9]
62 stmia r2!, {r1,r3-r6,sp}
63 stmib r2!, {r1,r3-r6,sp}
64 stmda r2!, {r1,r3-r6,sp}
65 stmdb r2!, {r1,r3-r6,sp}
67 @ CHECK: and r1, r2, r3 @ encoding: [0x03,0x10,0x02,0xe0]
68 and r1,r2,r3
70 @ FIXME: This is wrong, we are dropping the 's' for now.
71 @ CHECK-FIXME: ands r1, r2, r3 @ encoding: [0x03,0x10,0x12,0xe0]
72 ands r1,r2,r3
74 @ CHECK: eor r1, r2, r3 @ encoding: [0x03,0x10,0x22,0xe0]
75 eor r1,r2,r3
77 @ FIXME: This is wrong, we are dropping the 's' for now.
78 @ CHECK-FIXME: eors r1, r2, r3 @ encoding: [0x03,0x10,0x32,0xe0]
79 eors r1,r2,r3
81 @ CHECK: sub r1, r2, r3 @ encoding: [0x03,0x10,0x42,0xe0]
82 sub r1,r2,r3
84 @ FIXME: This is wrong, we are dropping the 's' for now.
85 @ CHECK-FIXME: subs r1, r2, r3 @ encoding: [0x03,0x10,0x52,0xe0]
86 subs r1,r2,r3
88 @ CHECK: add r1, r2, r3 @ encoding: [0x03,0x10,0x82,0xe0]
89 add r1,r2,r3
91 @ FIXME: This is wrong, we are dropping the 's' for now.
92 @ CHECK-FIXME: adds r1, r2, r3 @ encoding: [0x03,0x10,0x92,0xe0]
93 adds r1,r2,r3
95 @ CHECK: adc r1, r2, r3 @ encoding: [0x03,0x10,0xa2,0xe0]
96 adc r1,r2,r3
98 @ CHECK: sbc r1, r2, r3 @ encoding: [0x03,0x10,0xc2,0xe0]
99 sbc r1,r2,r3
101 @ CHECK: orr r1, r2, r3 @ encoding: [0x03,0x10,0x82,0xe1]
102 orr r1,r2,r3
104 @ FIXME: This is wrong, we are dropping the 's' for now.
105 @ CHECK-FIXME: orrs r1, r2, r3 @ encoding: [0x03,0x10,0x92,0xe1]
106 orrs r1,r2,r3
108 @ CHECK: bic r1, r2, r3 @ encoding: [0x03,0x10,0xc2,0xe1]
109 bic r1,r2,r3
111 @ FIXME: This is wrong, we are dropping the 's' for now.
112 @ CHECK-FIXME: bics r1, r2, r3 @ encoding: [0x03,0x10,0xd2,0xe1]
113 bics r1,r2,r3
115 @ CHECK: mov r1, r2 @ encoding: [0x02,0x10,0xa0,0xe1]
116 mov r1,r2
118 @ CHECK: mvn r1, r2 @ encoding: [0x02,0x10,0xe0,0xe1]
119 mvn r1,r2
121 @ FIXME: This is wrong, we are dropping the 's' for now.
122 @ CHECK-FIXME: mvns r1, r2 @ encoding: [0x02,0x10,0xf0,0xe1]
123 mvns r1,r2
125 @ CHECK: rsb r1, r2, r3 @ encoding: [0x03,0x10,0x62,0xe0]
126 rsb r1,r2,r3
128 @ CHECK: rsc r1, r2, r3 @ encoding: [0x03,0x10,0xe2,0xe0]
129 rsc r1,r2,r3
131 @ FIXME: This is broken, CCOut operands don't work correctly when their presence
132 @ may depend on flags.
133 @ CHECK-FIXME:: mlas r1, r2, r3, r4 @ encoding: [0x92,0x43,0x31,0xe0]
134 @ mlas r1,r2,r3,r4
136 @ CHECK: bfi r0, r0, #5, #7 @ encoding: [0x90,0x02,0xcb,0xe7]
137 bfi r0, r0, #5, #7
139 @ CHECK: bkpt #10 @ encoding: [0x7a,0x00,0x20,0xe1]
140 bkpt #10
142 @ CHECK: isb @ encoding: [0x6f,0xf0,0x7f,0xf5]
144 @ CHECK: mrs r8, cpsr @ encoding: [0x00,0x80,0x0f,0xe1]
145 mrs r8, cpsr
147 @ CHECK: mcr p7, #1, r5, c1, c1, #4 @ encoding: [0x91,0x57,0x21,0xee]
148 mcr p7, #1, r5, c1, c1, #4
149 @ CHECK: mrc p14, #0, r1, c1, c2, #4 @ encoding: [0x92,0x1e,0x11,0xee]
150 mrc p14, #0, r1, c1, c2, #4
151 @ CHECK: mcrr p7, #1, r5, r4, c1 @ encoding: [0x11,0x57,0x44,0xec]
152 mcrr p7, #1, r5, r4, c1
153 @ CHECK: mrrc p7, #1, r5, r4, c1 @ encoding: [0x11,0x57,0x54,0xec]
154 mrrc p7, #1, r5, r4, c1
156 @ CHECK: mcr2 p7, #1, r5, c1, c1, #4 @ encoding: [0x91,0x57,0x21,0xfe]
157 mcr2 p7, #1, r5, c1, c1, #4
158 @ CHECK: mrc2 p14, #0, r1, c1, c2, #4 @ encoding: [0x92,0x1e,0x11,0xfe]
159 mrc2 p14, #0, r1, c1, c2, #4
160 @ CHECK: mcrr2 p7, #1, r5, r4, c1 @ encoding: [0x11,0x57,0x44,0xfc]
161 mcrr2 p7, #1, r5, r4, c1
162 @ CHECK: mrrc2 p7, #1, r5, r4, c1 @ encoding: [0x11,0x57,0x54,0xfc]
163 mrrc2 p7, #1, r5, r4, c1
165 @ CHECK: cdp p7, #1, c1, c1, c1, #4 @ encoding: [0x81,0x17,0x11,0xee]
166 cdp p7, #1, c1, c1, c1, #4
167 @ CHECK: cdp2 p7, #1, c1, c1, c1, #4 @ encoding: [0x81,0x17,0x11,0xfe]
168 cdp2 p7, #1, c1, c1, c1, #4
170 @ CHECK: clrex @ encoding: [0x1f,0xf0,0x7f,0xf5]
171 clrex
173 @ CHECK: clz r9, r0 @ encoding: [0x10,0x9f,0x6f,0xe1]
174 clz r9, r0
176 @ CHECK: qadd r1, r2, r3 @ encoding: [0x52,0x10,0x03,0xe1]
177 qadd r1, r2, r3
179 @ CHECK: qsub r1, r2, r3 @ encoding: [0x52,0x10,0x23,0xe1]
180 qsub r1, r2, r3
182 @ CHECK: qdadd r1, r2, r3 @ encoding: [0x52,0x10,0x43,0xe1]
183 qdadd r1, r2, r3
185 @ CHECK: qdsub r1, r2, r3 @ encoding: [0x52,0x10,0x63,0xe1]
186 qdsub r1, r2, r3
188 @ CHECK: wfe @ encoding: [0x02,0xf0,0x20,0xe3]
191 @ CHECK: wfi @ encoding: [0x03,0xf0,0x20,0xe3]
194 @ CHECK: yield @ encoding: [0x01,0xf0,0x20,0xe3]
195 yield
197 @ CHECK: nop @ encoding: [0x00,0xf0,0x20,0xe3]
200 @ CHECK: dmb sy @ encoding: [0x5f,0xf0,0x7f,0xf5]
201 dmb sy
203 @ CHECK: dmb st @ encoding: [0x5e,0xf0,0x7f,0xf5]
204 dmb st
206 @ CHECK: dmb ish @ encoding: [0x5b,0xf0,0x7f,0xf5]
207 dmb ish
209 @ CHECK: dmb ishst @ encoding: [0x5a,0xf0,0x7f,0xf5]
210 dmb ishst
212 @ CHECK: dmb nsh @ encoding: [0x57,0xf0,0x7f,0xf5]
213 dmb nsh
215 @ CHECK: dmb nshst @ encoding: [0x56,0xf0,0x7f,0xf5]
216 dmb nshst
218 @ CHECK: dmb osh @ encoding: [0x53,0xf0,0x7f,0xf5]
219 dmb osh
221 @ CHECK: dmb oshst @ encoding: [0x52,0xf0,0x7f,0xf5]
222 dmb oshst
224 @ CHECK: dsb sy @ encoding: [0x4f,0xf0,0x7f,0xf5]
225 dsb sy
227 @ CHECK: dsb st @ encoding: [0x4e,0xf0,0x7f,0xf5]
228 dsb st
230 @ CHECK: dsb ish @ encoding: [0x4b,0xf0,0x7f,0xf5]
231 dsb ish
233 @ CHECK: dsb ishst @ encoding: [0x4a,0xf0,0x7f,0xf5]
234 dsb ishst
236 @ CHECK: dsb nsh @ encoding: [0x47,0xf0,0x7f,0xf5]
237 dsb nsh
239 @ CHECK: dsb nshst @ encoding: [0x46,0xf0,0x7f,0xf5]
240 dsb nshst
242 @ CHECK: dsb osh @ encoding: [0x43,0xf0,0x7f,0xf5]
243 dsb osh
245 @ CHECK: dsb oshst @ encoding: [0x42,0xf0,0x7f,0xf5]
246 dsb oshst
248 @ CHECK: cpsie aif @ encoding: [0xc0,0x01,0x08,0xf1]
249 cpsie aif
251 @ CHECK: cps #15 @ encoding: [0x0f,0x00,0x02,0xf1]
252 cps #15
254 @ CHECK: cpsie if, #10 @ encoding: [0xca,0x00,0x0a,0xf1]
255 cpsie if, #10
257 @ CHECK: msr cpsr_fc, r0 @ encoding: [0x00,0xf0,0x29,0xe1]
258 msr apsr, r0
260 @ CHECK: msr cpsr_s, r0 @ encoding: [0x00,0xf0,0x24,0xe1]
261 msr apsr_g, r0
263 @ CHECK: msr cpsr_f, r0 @ encoding: [0x00,0xf0,0x28,0xe1]
264 msr apsr_nzcvq, r0
266 @ CHECK: msr cpsr_fs, r0 @ encoding: [0x00,0xf0,0x2c,0xe1]
267 msr apsr_nzcvqg, r0
269 @ CHECK: msr cpsr_fc, r0 @ encoding: [0x00,0xf0,0x29,0xe1]
270 msr cpsr_fc, r0
272 @ CHECK: msr cpsr_c, r0 @ encoding: [0x00,0xf0,0x21,0xe1]
273 msr cpsr_c, r0
275 @ CHECK: msr cpsr_x, r0 @ encoding: [0x00,0xf0,0x22,0xe1]
276 msr cpsr_x, r0
278 @ CHECK: msr cpsr_fc, r0 @ encoding: [0x00,0xf0,0x29,0xe1]
279 msr cpsr_fc, r0
281 @ CHECK: msr cpsr_fc, r0 @ encoding: [0x00,0xf0,0x29,0xe1]
282 msr cpsr_all, r0
284 @ CHECK: msr cpsr_fsx, r0 @ encoding: [0x00,0xf0,0x2e,0xe1]
285 msr cpsr_fsx, r0
287 @ CHECK: msr spsr_fc, r0 @ encoding: [0x00,0xf0,0x69,0xe1]
288 msr spsr_fc, r0
290 @ CHECK: msr spsr_fsxc, r0 @ encoding: [0x00,0xf0,0x6f,0xe1]
291 msr spsr_fsxc, r0
293 @ CHECK: msr cpsr_fsxc, r0 @ encoding: [0x00,0xf0,0x2f,0xe1]
294 msr cpsr_fsxc, r0
296 @ CHECK: add r1, r2, r3, lsl r4 @ encoding: [0x13,0x14,0x82,0xe0]
297 add r1, r2, r3, lsl r4
299 @ CHECK: strexb r0, r1, [r2] @ encoding: [0x91,0x0f,0xc2,0xe1]
300 strexb r0, r1, [r2]
302 @ CHECK: strexh r0, r1, [r2] @ encoding: [0x91,0x0f,0xe2,0xe1]
303 strexh r0, r1, [r2]
305 @ CHECK: strex r0, r1, [r2] @ encoding: [0x91,0x0f,0x82,0xe1]
306 strex r0, r1, [r2]
308 @ CHECK: strexd r0, r2, r3, [r1] @ encoding: [0x92,0x0f,0xa1,0xe1]
309 strexd r0, r2, r3, [r1]
311 @ CHECK: ldrexb r0, [r0] @ encoding: [0x9f,0x0f,0xd0,0xe1]
312 ldrexb r0, [r0]
314 @ CHECK: ldrexh r0, [r0] @ encoding: [0x9f,0x0f,0xf0,0xe1]
315 ldrexh r0, [r0]
317 @ CHECK: ldrex r0, [r0] @ encoding: [0x9f,0x0f,0x90,0xe1]
318 ldrex r0, [r0]
320 @ CHECK: ldrexd r0, r1, [r0] @ encoding: [0x9f,0x0f,0xb0,0xe1]
321 ldrexd r0, r1, [r0]
323 @ CHECK: ssat16 r0, #7, r0 @ encoding: [0x30,0x0f,0xa6,0xe6]
324 ssat16 r0, #7, r0