Heuristic: If the number of operands in the alias are more than the number of
[llvm/stm8.git] / test / MC / ARM / arm_instructions.s
blobf7894411ec56854b6c17dbe959c41456b50df942
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: ldmib r2, {r1, r3, r4, r5, r6, sp} @ encoding: [0x7a,0x20,0x92,0xe9]
25 @ CHECK: ldmda r2, {r1, r3, r4, r5, r6, sp} @ encoding: [0x7a,0x20,0x12,0xe8]
26 @ CHECK: ldmdb r2, {r1, r3, r4, r5, r6, sp} @ encoding: [0x7a,0x20,0x12,0xe9]
27 ldmia r2, {r1,r3-r6,sp}
28 ldmib r2, {r1,r3-r6,sp}
29 ldmda r2, {r1,r3-r6,sp}
30 ldmdb r2, {r1,r3-r6,sp}
32 @ CHECK: stmia r2, {r1, r3, r4, r5, r6, sp} @ encoding: [0x7a,0x20,0x82,0xe8]
33 @ CHECK: stmib r2, {r1, r3, r4, r5, r6, sp} @ encoding: [0x7a,0x20,0x82,0xe9]
34 @ CHECK: stmda r2, {r1, r3, r4, r5, r6, sp} @ encoding: [0x7a,0x20,0x02,0xe8]
35 @ CHECK: stmdb r2, {r1, r3, r4, r5, r6, sp} @ encoding: [0x7a,0x20,0x02,0xe9]
36 stmia r2, {r1,r3-r6,sp}
37 stmib r2, {r1,r3-r6,sp}
38 stmda r2, {r1,r3-r6,sp}
39 stmdb r2, {r1,r3-r6,sp}
41 @ CHECK: ldmia r2!, {r1, r3, r4, r5, r6, sp} @ encoding: [0x7a,0x20,0xb2,0xe8]
42 @ CHECK: ldmib r2!, {r1, r3, r4, r5, r6, sp} @ encoding: [0x7a,0x20,0xb2,0xe9]
43 @ CHECK: ldmda r2!, {r1, r3, r4, r5, r6, sp} @ encoding: [0x7a,0x20,0x32,0xe8]
44 @ CHECK: ldmdb r2!, {r1, r3, r4, r5, r6, sp} @ encoding: [0x7a,0x20,0x32,0xe9]
45 ldmia r2!, {r1,r3-r6,sp}
46 ldmib r2!, {r1,r3-r6,sp}
47 ldmda r2!, {r1,r3-r6,sp}
48 ldmdb r2!, {r1,r3-r6,sp}
50 @ CHECK: stmia r2!, {r1, r3, r4, r5, r6, sp} @ encoding: [0x7a,0x20,0xa2,0xe8]
51 @ CHECK: stmib r2!, {r1, r3, r4, r5, r6, sp} @ encoding: [0x7a,0x20,0xa2,0xe9]
52 @ CHECK: stmda r2!, {r1, r3, r4, r5, r6, sp} @ encoding: [0x7a,0x20,0x22,0xe8]
53 @ CHECK: stmdb r2!, {r1, r3, r4, r5, r6, sp} @ encoding: [0x7a,0x20,0x22,0xe9]
54 stmia r2!, {r1,r3-r6,sp}
55 stmib r2!, {r1,r3-r6,sp}
56 stmda r2!, {r1,r3-r6,sp}
57 stmdb r2!, {r1,r3-r6,sp}
59 @ CHECK: and r1, r2, r3 @ encoding: [0x03,0x10,0x02,0xe0]
60 and r1,r2,r3
62 @ FIXME: This is wrong, we are dropping the 's' for now.
63 @ CHECK-FIXME: ands r1, r2, r3 @ encoding: [0x03,0x10,0x12,0xe0]
64 ands r1,r2,r3
66 @ CHECK: eor r1, r2, r3 @ encoding: [0x03,0x10,0x22,0xe0]
67 eor r1,r2,r3
69 @ FIXME: This is wrong, we are dropping the 's' for now.
70 @ CHECK-FIXME: eors r1, r2, r3 @ encoding: [0x03,0x10,0x32,0xe0]
71 eors r1,r2,r3
73 @ CHECK: sub r1, r2, r3 @ encoding: [0x03,0x10,0x42,0xe0]
74 sub r1,r2,r3
76 @ FIXME: This is wrong, we are dropping the 's' for now.
77 @ CHECK-FIXME: subs r1, r2, r3 @ encoding: [0x03,0x10,0x52,0xe0]
78 subs r1,r2,r3
80 @ CHECK: add r1, r2, r3 @ encoding: [0x03,0x10,0x82,0xe0]
81 add r1,r2,r3
83 @ FIXME: This is wrong, we are dropping the 's' for now.
84 @ CHECK-FIXME: adds r1, r2, r3 @ encoding: [0x03,0x10,0x92,0xe0]
85 adds r1,r2,r3
87 @ CHECK: adc r1, r2, r3 @ encoding: [0x03,0x10,0xa2,0xe0]
88 adc r1,r2,r3
90 @ CHECK: sbc r1, r2, r3 @ encoding: [0x03,0x10,0xc2,0xe0]
91 sbc r1,r2,r3
93 @ CHECK: orr r1, r2, r3 @ encoding: [0x03,0x10,0x82,0xe1]
94 orr r1,r2,r3
96 @ FIXME: This is wrong, we are dropping the 's' for now.
97 @ CHECK-FIXME: orrs r1, r2, r3 @ encoding: [0x03,0x10,0x92,0xe1]
98 orrs r1,r2,r3
100 @ CHECK: bic r1, r2, r3 @ encoding: [0x03,0x10,0xc2,0xe1]
101 bic r1,r2,r3
103 @ FIXME: This is wrong, we are dropping the 's' for now.
104 @ CHECK-FIXME: bics r1, r2, r3 @ encoding: [0x03,0x10,0xd2,0xe1]
105 bics r1,r2,r3
107 @ CHECK: mov r1, r2 @ encoding: [0x02,0x10,0xa0,0xe1]
108 mov r1,r2
110 @ CHECK: mvn r1, r2 @ encoding: [0x02,0x10,0xe0,0xe1]
111 mvn r1,r2
113 @ FIXME: This is wrong, we are dropping the 's' for now.
114 @ CHECK-FIXME: mvns r1, r2 @ encoding: [0x02,0x10,0xf0,0xe1]
115 mvns r1,r2
117 @ CHECK: rsb r1, r2, r3 @ encoding: [0x03,0x10,0x62,0xe0]
118 rsb r1,r2,r3
120 @ CHECK: rsc r1, r2, r3 @ encoding: [0x03,0x10,0xe2,0xe0]
121 rsc r1,r2,r3
123 @ FIXME: This is broken, CCOut operands don't work correctly when their presence
124 @ may depend on flags.
125 @ CHECK-FIXME:: mlas r1, r2, r3, r4 @ encoding: [0x92,0x43,0x31,0xe0]
126 @ mlas r1,r2,r3,r4
128 @ CHECK: bfi r0, r0, #5, #7 @ encoding: [0x90,0x02,0xcb,0xe7]
129 bfi r0, r0, #5, #7
131 @ CHECK: bkpt #10 @ encoding: [0x7a,0x00,0x20,0xe1]
132 bkpt #10
134 @ CHECK: isb @ encoding: [0x6f,0xf0,0x7f,0xf5]
136 @ CHECK: mrs r8, cpsr @ encoding: [0x00,0x80,0x0f,0xe1]
137 mrs r8, cpsr
139 @ CHECK: mcr p7, #1, r5, c1, c1, #4 @ encoding: [0x91,0x57,0x21,0xee]
140 mcr p7, #1, r5, c1, c1, #4
141 @ CHECK: mrc p14, #0, r1, c1, c2, #4 @ encoding: [0x92,0x1e,0x11,0xee]
142 mrc p14, #0, r1, c1, c2, #4
143 @ CHECK: mcrr p7, #1, r5, r4, c1 @ encoding: [0x11,0x57,0x44,0xec]
144 mcrr p7, #1, r5, r4, c1
145 @ CHECK: mrrc p7, #1, r5, r4, c1 @ encoding: [0x11,0x57,0x54,0xec]
146 mrrc p7, #1, r5, r4, c1
148 @ CHECK: mcr2 p7, #1, r5, c1, c1, #4 @ encoding: [0x91,0x57,0x21,0xfe]
149 mcr2 p7, #1, r5, c1, c1, #4
150 @ CHECK: mrc2 p14, #0, r1, c1, c2, #4 @ encoding: [0x92,0x1e,0x11,0xfe]
151 mrc2 p14, #0, r1, c1, c2, #4
152 @ CHECK: mcrr2 p7, #1, r5, r4, c1 @ encoding: [0x11,0x57,0x44,0xfc]
153 mcrr2 p7, #1, r5, r4, c1
154 @ CHECK: mrrc2 p7, #1, r5, r4, c1 @ encoding: [0x11,0x57,0x54,0xfc]
155 mrrc2 p7, #1, r5, r4, c1
157 @ CHECK: cdp p7, #1, c1, c1, c1, #4 @ encoding: [0x81,0x17,0x11,0xee]
158 cdp p7, #1, c1, c1, c1, #4
159 @ CHECK: cdp2 p7, #1, c1, c1, c1, #4 @ encoding: [0x81,0x17,0x11,0xfe]
160 cdp2 p7, #1, c1, c1, c1, #4
162 @ CHECK: clrex @ encoding: [0x1f,0xf0,0x7f,0xf5]
163 clrex
165 @ CHECK: clz r9, r0 @ encoding: [0x10,0x9f,0x6f,0xe1]
166 clz r9, r0
168 @ CHECK: qadd r1, r2, r3 @ encoding: [0x52,0x10,0x03,0xe1]
169 qadd r1, r2, r3
171 @ CHECK: qsub r1, r2, r3 @ encoding: [0x52,0x10,0x23,0xe1]
172 qsub r1, r2, r3
174 @ CHECK: qdadd r1, r2, r3 @ encoding: [0x52,0x10,0x43,0xe1]
175 qdadd r1, r2, r3
177 @ CHECK: qdsub r1, r2, r3 @ encoding: [0x52,0x10,0x63,0xe1]
178 qdsub r1, r2, r3
180 @ CHECK: wfe @ encoding: [0x02,0xf0,0x20,0xe3]
183 @ CHECK: wfi @ encoding: [0x03,0xf0,0x20,0xe3]
186 @ CHECK: yield @ encoding: [0x01,0xf0,0x20,0xe3]
187 yield
189 @ CHECK: nop @ encoding: [0x00,0xf0,0x20,0xe3]
192 @ CHECK: dmb sy @ encoding: [0x5f,0xf0,0x7f,0xf5]
193 dmb sy
195 @ CHECK: dmb st @ encoding: [0x5e,0xf0,0x7f,0xf5]
196 dmb st
198 @ CHECK: dmb ish @ encoding: [0x5b,0xf0,0x7f,0xf5]
199 dmb ish
201 @ CHECK: dmb ishst @ encoding: [0x5a,0xf0,0x7f,0xf5]
202 dmb ishst
204 @ CHECK: dmb nsh @ encoding: [0x57,0xf0,0x7f,0xf5]
205 dmb nsh
207 @ CHECK: dmb nshst @ encoding: [0x56,0xf0,0x7f,0xf5]
208 dmb nshst
210 @ CHECK: dmb osh @ encoding: [0x53,0xf0,0x7f,0xf5]
211 dmb osh
213 @ CHECK: dmb oshst @ encoding: [0x52,0xf0,0x7f,0xf5]
214 dmb oshst
216 @ CHECK: dsb sy @ encoding: [0x4f,0xf0,0x7f,0xf5]
217 dsb sy
219 @ CHECK: dsb st @ encoding: [0x4e,0xf0,0x7f,0xf5]
220 dsb st
222 @ CHECK: dsb ish @ encoding: [0x4b,0xf0,0x7f,0xf5]
223 dsb ish
225 @ CHECK: dsb ishst @ encoding: [0x4a,0xf0,0x7f,0xf5]
226 dsb ishst
228 @ CHECK: dsb nsh @ encoding: [0x47,0xf0,0x7f,0xf5]
229 dsb nsh
231 @ CHECK: dsb nshst @ encoding: [0x46,0xf0,0x7f,0xf5]
232 dsb nshst
234 @ CHECK: dsb osh @ encoding: [0x43,0xf0,0x7f,0xf5]
235 dsb osh
237 @ CHECK: dsb oshst @ encoding: [0x42,0xf0,0x7f,0xf5]
238 dsb oshst
240 @ CHECK: cpsie aif @ encoding: [0xc0,0x01,0x08,0xf1]
241 cpsie aif
243 @ CHECK: cps #15 @ encoding: [0x0f,0x00,0x02,0xf1]
244 cps #15
246 @ CHECK: cpsie if, #10 @ encoding: [0xca,0x00,0x0a,0xf1]
247 cpsie if, #10
249 @ CHECK: msr cpsr_fc, r0 @ encoding: [0x00,0xf0,0x29,0xe1]
250 msr apsr, r0
252 @ CHECK: msr cpsr_s, r0 @ encoding: [0x00,0xf0,0x24,0xe1]
253 msr apsr_g, r0
255 @ CHECK: msr cpsr_f, r0 @ encoding: [0x00,0xf0,0x28,0xe1]
256 msr apsr_nzcvq, r0
258 @ CHECK: msr cpsr_fs, r0 @ encoding: [0x00,0xf0,0x2c,0xe1]
259 msr apsr_nzcvqg, r0
261 @ CHECK: msr cpsr_fc, r0 @ encoding: [0x00,0xf0,0x29,0xe1]
262 msr cpsr_fc, r0
264 @ CHECK: msr cpsr_c, r0 @ encoding: [0x00,0xf0,0x21,0xe1]
265 msr cpsr_c, r0
267 @ CHECK: msr cpsr_x, r0 @ encoding: [0x00,0xf0,0x22,0xe1]
268 msr cpsr_x, r0
270 @ CHECK: msr cpsr_fc, r0 @ encoding: [0x00,0xf0,0x29,0xe1]
271 msr cpsr_fc, r0
273 @ CHECK: msr cpsr_fc, r0 @ encoding: [0x00,0xf0,0x29,0xe1]
274 msr cpsr_all, r0
276 @ CHECK: msr cpsr_fsx, r0 @ encoding: [0x00,0xf0,0x2e,0xe1]
277 msr cpsr_fsx, r0
279 @ CHECK: msr spsr_fc, r0 @ encoding: [0x00,0xf0,0x69,0xe1]
280 msr spsr_fc, r0
282 @ CHECK: msr spsr_fsxc, r0 @ encoding: [0x00,0xf0,0x6f,0xe1]
283 msr spsr_fsxc, r0
285 @ CHECK: msr cpsr_fsxc, r0 @ encoding: [0x00,0xf0,0x2f,0xe1]
286 msr cpsr_fsxc, r0
288 @ CHECK: add r1, r2, r3, lsl r4 @ encoding: [0x13,0x14,0x82,0xe0]
289 add r1, r2, r3, lsl r4
291 @ CHECK: strexb r0, r1, [r2] @ encoding: [0x91,0x0f,0xc2,0xe1]
292 strexb r0, r1, [r2]
294 @ CHECK: strexh r0, r1, [r2] @ encoding: [0x91,0x0f,0xe2,0xe1]
295 strexh r0, r1, [r2]
297 @ CHECK: strex r0, r1, [r2] @ encoding: [0x91,0x0f,0x82,0xe1]
298 strex r0, r1, [r2]
300 @ CHECK: strexd r0, r2, r3, [r1] @ encoding: [0x92,0x0f,0xa1,0xe1]
301 strexd r0, r2, r3, [r1]
303 @ CHECK: ldrexb r0, [r0] @ encoding: [0x9f,0x0f,0xd0,0xe1]
304 ldrexb r0, [r0]
306 @ CHECK: ldrexh r0, [r0] @ encoding: [0x9f,0x0f,0xf0,0xe1]
307 ldrexh r0, [r0]
309 @ CHECK: ldrex r0, [r0] @ encoding: [0x9f,0x0f,0x90,0xe1]
310 ldrex r0, [r0]
312 @ CHECK: ldrexd r0, r1, [r0] @ encoding: [0x9f,0x0f,0xb0,0xe1]
313 ldrexd r0, r1, [r0]
315 @ CHECK: ssat16 r0, #7, r0 @ encoding: [0x30,0x0f,0xa6,0xe6]
316 ssat16 r0, #7, r0