1	.text
2	.thumb
3	.syntax unified
4
5encode_thumb32_immediate:
6	orr	r0, r1, #0x00000000
7	orr	r0, r1, #0x000000a5
8	orr	r0, r1, #0x00a500a5
9	orr	r0, r1, #0xa500a500
10	orr	r0, r1, #0xa5a5a5a5
11
12	orr	r0, r1, #0xa5 << 31
13	orr	r0, r1, #0xa5 << 30
14	orr	r0, r1, #0xa5 << 29
15	orr	r0, r1, #0xa5 << 28
16	orr	r0, r1, #0xa5 << 27
17	orr	r0, r1, #0xa5 << 26
18	orr	r0, r1, #0xa5 << 25
19	orr	r0, r1, #0xa5 << 24
20	orr	r0, r1, #0xa5 << 23
21	orr	r0, r1, #0xa5 << 22
22	orr	r0, r1, #0xa5 << 21
23	orr	r0, r1, #0xa5 << 20
24	orr	r0, r1, #0xa5 << 19
25	orr	r0, r1, #0xa5 << 18
26	orr	r0, r1, #0xa5 << 17
27	orr	r0, r1, #0xa5 << 16
28	orr	r0, r1, #0xa5 << 15
29	orr	r0, r1, #0xa5 << 14
30	orr	r0, r1, #0xa5 << 13
31	orr	r0, r1, #0xa5 << 12
32	orr	r0, r1, #0xa5 << 11
33	orr	r0, r1, #0xa5 << 10
34	orr	r0, r1, #0xa5 << 9
35	orr	r0, r1, #0xa5 << 8
36	orr	r0, r1, #0xa5 << 7
37	orr	r0, r1, #0xa5 << 6
38	orr	r0, r1, #0xa5 << 5
39	orr	r0, r1, #0xa5 << 4
40	orr	r0, r1, #0xa5 << 3
41	orr	r0, r1, #0xa5 << 2
42	orr	r0, r1, #0xa5 << 1
43
44add_sub:
45	@ Should be format 1, Some have equivalent format 2 encodings
46	adds	r0, r0, #0
47	adds	r5, r0, #0
48	adds	r0, r5, #0
49	adds	r0, r2, #5
50
51	adds	r0, #129	@ format 2
52	adds	r0, r0, #129
53	adds	r5, #126
54
55	adds	r0, r0, r0	@ format 3
56	adds	r5, r0, r0
57	adds	r0, r5, r0
58	adds	r0, r0, r5
59	adds	r1, r2, r3
60
61	add	r8, r0		@ format 4
62	add	r0, r8
63	add	r0, r8, r0
64	add	r0, r0, r8
65	add	r8, r0, r0	@ ... not this one
66
67	add	r1, r0
68	add	r0, r1
69
70	add	r0, pc, #0	@ format 5
71	add	r5, pc, #0
72	add	r0, pc, #516
73
74	add	r0, sp, #0	@ format 6
75	add	r5, sp, #0
76	add	r0, sp, #516
77
78	add	sp, #0		@ format 7
79	add	sp, sp, #0
80	add	sp, #260
81
82	add.w	r0, r0, #0	@ T32 format 1
83	adds.w	r0, r0, #0
84	add.w	r9, r0, #0
85	add.w	r0, r9, #0
86	add.w	r0, r0, #129
87	adds	r5, r3, #0x10000
88	add	r0, sp, #1
89	add	r9, sp, #0
90	add.w	sp, sp, #4
91
92	add.w	r0, r0, r0	@ T32 format 2
93	adds.w	r0, r0, r0
94	add.w	r9, r0, r0
95	add.w	r0, r9, r0
96	add.w	r0, r0, r9
97
98	add.w	r8, r9, r10
99	add.w	r8, r9, r10, lsl #17
100	add.w	r8, r8, r10, lsr #32
101	add.w	r8, r8, r10, lsr #17
102	add.w	r8, r9, r10, asr #32
103	add.w	r8, r9, r10, asr #17
104	add.w	r8, r9, r10, rrx
105	add.w	r8, r9, r10, ror #17
106
107	subs	r0, r0, #0	@ format 1
108	subs	r5, r0, #0
109	subs	r0, r5, #0
110	subs	r0, r2, #5
111
112	subs	r0, r0, #129
113	subs	r5, #8
114
115	subs	r0, r0, r0	@ format 3
116	subs	r5, r0, r0
117	subs	r0, r5, r0
118	subs	r0, r0, r5
119
120	sub	sp, #260	@ format 4
121	sub	sp, sp, #260
122
123	subs	r8, r0		@ T32 format 2
124	subs	r0, r8
125	subs	r0, #260	@ T32 format 1
126	subs.w	r1, r2, #4
127	subs	r5, r3, #0x10000
128	sub	r1, sp, #4
129	sub	r9, sp, #0
130	sub.w	sp, sp, #4
131
132arit3:
133	.macro arit3 op ops opw opsw
134	\ops	r0, r0
135	\ops	r5, r0
136	\ops	r0, r5
137	\ops	r0, r0, r5
138	\ops	r0, r5, r0
139	\op	r0, r5, r0
140	\op	r0, r1, r2
141	\op	r9, r0, r0
142	\op	r0, r9, r0
143	\op	r0, r0, r9
144	\opsw	r0, r0, r0
145	\opw	r0, r1, r2, asr #17
146	\opw	r0, r1, #129
147	.endm
148
149	arit3	adc adcs adc.w adcs.w
150	arit3	and ands and.w ands.w
151	arit3	bic bics bic.w bics.w
152	arit3	eor eors eor.w eors.w
153	arit3	orr orrs orr.w orrs.w
154	arit3	rsb rsbs rsb.w rsbs.w
155	arit3	sbc sbcs sbc.w sbcs.w
156	arit3	orn orns orn orns
157
158	.purgem arit3
159
160bfc_bfi_bfx:
161	bfc	r0, #0, #1
162	bfc	r9, #0, #1
163	bfi	r9, #0, #0, #1
164	bfc	r0, #21, #1
165	bfc	r0, #0, #18
166
167	bfi	r0, r0, #0, #1
168	bfi	r9, r0, #0, #1
169	bfi	r0, r9, #0, #1
170	bfi	r0, r0, #21, #1
171	bfi	r0, r0, #0, #18
172
173	sbfx	r0, r0, #0, #1
174	ubfx	r9, r0, #0, #1
175	sbfx	r0, r9, #0, #1
176	ubfx	r0, r0, #21, #1
177	sbfx	r0, r0, #0, #18
178
179	.globl	branches
180branches:
181	.macro bra op
182	\op	1b
183	\op	1f
184	.endm
1851:
186	bra	beq.n
187	bra	bne.n
188	bra	bcs.n
189	bra	bhs.n
190	bra	bcc.n
191	bra	bul.n
192	bra	blo.n
193	bra	bmi.n
194	bra	bpl.n
195	bra	bvs.n
196	bra	bvc.n
197	bra	bhi.n
198	bra	bls.n
199	bra	bvc.n
200	bra	bhi.n
201	bra	bls.n
202	bra	bge.n
203	bra	blt.n
204	bra	bgt.n
205	bra	ble.n
206	bra	bal.n
207	bra	b.n
208	@ bl, blx have no short form.
209	.balign 4
2101:
211	bra	beq.w
212	bra	bne.w
213	bra	bcs.w
214	bra	bhs.w
215	bra	bcc.w
216	bra	bul.w
217	bra	blo.w
218	bra	bmi.w
219	bra	bpl.w
220	bra	bvs.w
221	bra	bvc.w
222	bra	bhi.w
223	bra	bls.w
224	bra	bvc.w
225	bra	bhi.w
226	bra	bls.w
227	bra	bge.w
228	bra	blt.w
229	bra	bgt.w
230	bra	ble.w
231	bra	b.w
232	bra	bl
233	bra	blx
234	.balign 4
2351:
236	bx	r9
237	blx	r0
238	blx	r9
239	bxj	r0
240	bxj	r9
241	.purgem bra
242
243clz:
244	clz	r0, r0
245	clz	r9, r0
246	clz	r0, r9
247
248cps:
249	cpsie	f
250	cpsid	i
251	cpsie	a
252	cpsid.w	f
253	cpsie.w	i
254	cpsid.w	a
255	cpsie	i, #0
256	cpsid	i, #17
257	cps	#0
258	cps	#17
259
260cpy:
261	cpy	r0, r0
262	cpy	r9, r0
263	cpy	r0, r9
264	cpy.w	r0, r0
265	cpy.w	r9, r0
266	cpy.w	r0, r9
267
268czb:
269	cbnz	r0, 2f
270	cbz	r5, 1f
271
272nop_hint:
273	nop
2741:	yield
2752:	wfe
276	wfi
277	sev
278
279	nop.w
280	yield.w
281	wfe.w
282	wfi.w
283	sev.w
284
285	nop {9}
286	nop {129}
287
288it:
289	.macro nop1 cond ncond a
290	.ifc \a,t
291	nop\cond
292	.else
293	nop\ncond
294	.endif
295	.endm
296	.macro it0 cond m=
297	it\m \cond
298	nop\cond
299	.endm
300	.macro it1 cond ncond a m=
301	it0 \cond \a\m
302	nop1 \cond \ncond \a
303	.endm
304	.macro it2 cond ncond a b m=
305	it1 \cond \ncond \a \b\m
306	nop1 \cond \ncond \b
307	.endm
308	.macro it3 cond ncond a b c
309	it2 \cond \ncond \a \b \c
310	nop1 \cond \ncond \c
311	.endm
312
313	it0	eq
314	it0	ne
315	it0	cs
316	it0	hs
317	it0	cc
318	it0	ul
319	it0	lo
320	it0	mi
321	it0	pl
322	it0	vs
323	it0	vc
324	it0	hi
325	it0	ge
326	it0	lt
327	it0	gt
328	it0	le
329	it0	al
330	it1 eq ne t
331	it1 eq ne e
332	it2 eq ne t t
333	it2 eq ne e t
334	it2 eq ne t e
335	it2 eq ne e e
336	it3 eq ne t t t
337	it3 eq ne e t t
338	it3 eq ne t e t
339	it3 eq ne t t e
340	it3 eq ne t e e
341	it3 eq ne e t e
342	it3 eq ne e e t
343	it3 eq ne e e e
344
345	it1 ne eq t
346	it1 ne eq e
347	it2 ne eq t t
348	it2 ne eq e t
349	it2 ne eq t e
350	it2 ne eq e e
351	it3 ne eq t t t
352	it3 ne eq e t t
353	it3 ne eq t e t
354	it3 ne eq t t e
355	it3 ne eq t e e
356	it3 ne eq e t e
357	it3 ne eq e e t
358	it3 ne eq e e e
359
360ldst:
3611:
362	pld	[r5]
363	pld	[r5, #0x330]
364	pld	[r5, #-0x30]
365	pld	[r5], #0x30
366	pld	[r5], #-0x30
367	pld	[r5, #0x30]!
368	pld	[r5, #-0x30]!
369	pld	[r5, r4]
370	pld	[r9, ip]
371	pld	1f
372	pld	1b
3731:
374	nop
375here:
376	ldrd	r2, r3, [r5]
377	ldrd	r2, [r5, #0x30]
378	ldrd	r2, [r5, #-0x30]
379	ldrd	r4, r5, here
380	strd	r2, r3, [r5]
381	strd	r2, [r5, #0x30]
382	strd	r2, [r5, #-0x30]
383
384	ldrbt	r1, [r5]
385	ldrbt	r1, [r5, #0x30]
386	ldrsbt	r1, [r5]
387	ldrsbt	r1, [r5, #0x30]
388	ldrht	r1, [r5]
389	ldrht	r1, [r5, #0x30]
390	ldrsht	r1, [r5]
391	ldrsht	r1, [r5, #0x30]
392	ldrt	r1, [r5]
393	ldrt	r1, [r5, #0x30]
394
395ldxstx:
396	ldrexb	r1, [r4]
397	ldrexh	r1, [r4]
398	ldrex	r1, [r4]
399	ldrexd	r1, r2, [r4]
400
401	strexb	r1, r2, [r4]
402	strexh	r1, r2, [r4]
403	strex	r1, r2, [r4]
404	strexd	r1, r2, r3, [r4]
405	strexd	r1, r3, r3, [r4]
406
407	ldrex	r1, [r4,#516]
408	strex	r1, r2, [r4,#516]
409
410ldmstm:
411	ldmia	r0!, {r1,r2,r3}
412	ldmia	r2, {r0,r1,r2}
413	ldmia.w	r2, {r0,r1,r2}
414	ldmia	r9, {r0,r1,r2}
415	ldmia	r0, {r7,r8,r10}
416	ldmia	r0!, {r7,r8,r10}
417
418	stmia	r0!, {r1,r2,r3}
419	stmia	r2!, {r0,r1,r3}
420	stmia.w	r2!, {r0,r1,r3}
421	stmia	r9, {r0,r1,r2}
422	stmia	r0, {r7,r8,r10}
423	stmia	r0!, {r7,r8,r10}
424
425	ldmdb	r0, {r7,r8,r10}
426	stmdb	r0, {r7,r8,r10}
427
428mlas:
429	mla	r0, r0, r0, r0
430	mls	r0, r0, r0, r0
431	mla	r9, r0, r0, r0
432	mla	r0, r9, r0, r0
433	mla	r0, r0, r9, r0
434	mla	r0, r0, r0, r9
435
436tst_teq_cmp_cmn_mov_mvn:
437	.macro	mt op ops opw opsw
438	\ops	r0, r0
439	\op	r0, r0
440	\ops	r5, r0
441	\op	r0, r5
442	\op	r0, r5, asr #17
443	\opw	r0, r0
444	\ops	r9, r0
445	\opsw	r0, r9
446	\opw	r0, #129
447	\opw	r5, #129
448	.endm
449
450	mt	tst tsts tst.w tsts.w
451	mt	teq teqs teq.w teqs.w
452	mt	cmp cmps cmp.w cmps.w
453	mt	cmn cmns cmn.w cmns.w
454	mt	mov movs mov.w movs.w
455	mt	mvn mvns mvn.w mvns.w
456	.purgem mt
457
458mov16:
459	movw	r0, #0
460	movt	r0, #0
461	movw	r9, #0
462	movw	r0, #0x9000
463	movw	r0, #0x0800
464	movw	r0, #0x0500
465	movw	r0, #0x0081
466	movw	r0, #0xffff
467
468mrs_msr:
469	mrs	r0, CPSR
470	mrs	r0, SPSR
471	mrs	r9, CPSR_all
472	mrs	r9, SPSR_all
473
474	msr	CPSR_c, r0
475	msr	SPSR_c, r0
476	msr	CPSR_c, r9
477	msr	CPSR_x, r0
478	msr	CPSR_s, r0
479	msr	CPSR_f, r0
480
481mul:
482	mul	r0, r0, r0
483	mul	r0, r9, r0
484	mul	r0, r0, r9
485	mul	r0, r0
486	mul	r9, r0
487	muls	r5, r0
488	muls	r5, r0, r5
489	muls	r0, r5
490
491mull:
492	smull	r0, r1, r0, r0
493	umull	r0, r1, r0, r0
494	smlal	r0, r1, r0, r0
495	umlal	r0, r1, r0, r0
496	smull	r9, r0, r0, r0
497	smull	r0, r9, r0, r0
498	smull	r0, r1, r9, r0
499	smull	r0, r1, r0, r9
500
501neg:
502	negs	r0, r0
503	negs	r0, r5
504	negs	r5, r0
505	negs.w	r0, r0
506	negs.w	r5, r0
507	negs.w	r0, r5
508
509	neg	r0, r9
510	neg	r9, r0
511	negs	r0, r9
512	negs	r9, r0
513
514pkh:
515	pkhbt	r0, r0, r0
516	pkhbt	r9, r0, r0
517	pkhbt	r0, r9, r0
518	pkhbt	r0, r0, r9
519	pkhbt	r0, r0, r0, lsl #0x14
520	pkhbt	r0, r0, r0, lsl #3
521	pkhtb	r1, r2, r3
522	pkhtb	r1, r2, r3, asr #0x11
523
524push_pop:
525	push	{r0}
526	pop	{r0}
527	push	{r1,lr}
528	pop	{r1,pc}
529	push	{r8,r9,r10,r11,r12}
530	pop	{r8,r9,r10,r11,r12}
531
532qadd:
533	qadd		r1, r2, r3
534	qadd16		r1, r2, r3
535	qadd8		r1, r2, r3
536	qasx		r1, r2, r3
537	qaddsubx	r1, r2, r3
538	qdadd		r1, r2, r3
539	qdsub		r1, r2, r3
540	qsub		r1, r2, r3
541	qsub16		r1, r2, r3
542	qsub8		r1, r2, r3
543	qsax		r1, r2, r3
544	qsubaddx	r1, r2, r3
545	sadd16		r1, r2, r3
546	sadd8		r1, r2, r3
547	sasx		r1, r2, r3
548	saddsubx	r1, r2, r3
549	ssub16		r1, r2, r3
550	ssub8		r1, r2, r3
551	ssax		r1, r2, r3
552	ssubaddx	r1, r2, r3
553	shadd16		r1, r2, r3
554	shadd8		r1, r2, r3
555	shasx		r1, r2, r3
556	shaddsubx	r1, r2, r3
557	shsub16		r1, r2, r3
558	shsub8		r1, r2, r3
559	shsax		r1, r2, r3
560	shsubaddx	r1, r2, r3
561	uadd16		r1, r2, r3
562	uadd8		r1, r2, r3
563	uasx		r1, r2, r3
564	uaddsubx	r1, r2, r3
565	usub16		r1, r2, r3
566	usub8		r1, r2, r3
567	usax		r1, r2, r3
568	usubaddx	r1, r2, r3
569	uhadd16		r1, r2, r3
570	uhadd8		r1, r2, r3
571	uhasx		r1, r2, r3
572	uhaddsubx	r1, r2, r3
573	uhsub16		r1, r2, r3
574	uhsub8		r1, r2, r3
575	uhsax		r1, r2, r3
576	uhsubaddx	r1, r2, r3
577	uqadd16		r1, r2, r3
578	uqadd8		r1, r2, r3
579	uqasx		r1, r2, r3
580	uqaddsubx	r1, r2, r3
581	uqsub16		r1, r2, r3
582	uqsub8		r1, r2, r3
583	uqsax		r1, r2, r3
584	uqsubaddx	r1, r2, r3
585	sel		r1, r2, r3
586
587rbit_rev:
588	.macro	rx op opw
589	\op	r0, r0
590	\opw	r0, r0
591	\op	r0, r5
592	\op	r5, r0
593	\op	r0, r9
594	\op	r9, r0
595	.endm
596
597	rx	rev rev.w
598	rx	rev16 rev16.w
599	rx	revsh revsh.w
600	rx	rbit rbit.w
601
602	.purgem rx
603
604shift:
605	.macro	sh op ops opw opsw
606	\ops	r0, #17		@ 16-bit format 1
607	\ops	r0, r0, #14
608	\ops	r5, r0, #17
609	\ops	r0, r5, #14
610	\ops	r0, r0		@ 16-bit format 2
611	\ops	r0, r5
612	\ops	r0, r0, r5
613	\op	r9, #17		@ 32-bit format 1
614	\op	r9, r9, #14
615	\ops	r0, r9, #17
616	\op	r9, r0, #14
617	\opw	r0, r0, r0	@ 32-bit format 2
618	\op	r9, r9
619	\ops	r9, r0
620	\op	r0, r9
621	\op	r0, r5
622	\ops	r0, r1, r2
623	.endm
624
625	sh	lsl lsls lsl.w lsls.w
626	sh	lsr lsrs lsr.w lsrs.w
627	sh	asr asrs asr.w asrs.w
628	sh	ror rors ror.w rors.w
629
630	.purgem sh
631
632rrx:
633	rrx	r1, r2
634	rrxs	r3, r4
635
636	.arch armv7-a
637	.arch_extension sec
638smc:
639	smc	#0
640	smc	#0xabcd
641
642smla:
643	smlabb	r0, r0, r0, r0
644	smlabb	r9, r0, r0, r0
645	smlabb	r0, r9, r0, r0
646	smlabb	r0, r0, r9, r0
647	smlabb	r0, r0, r0, r9
648
649	smlatb	r0, r0, r0, r0
650	smlabt	r0, r0, r0, r0
651	smlatt	r0, r0, r0, r0
652	smlawb	r0, r0, r0, r0
653	smlawt	r0, r0, r0, r0
654	smlad	r0, r0, r0, r0
655	smladx	r0, r0, r0, r0
656	smlsd	r0, r0, r0, r0
657	smlsdx	r0, r0, r0, r0
658	smmla	r0, r0, r0, r0
659	smmlar	r0, r0, r0, r0
660	smmls	r0, r0, r0, r0
661	smmlsr	r0, r0, r0, r0
662	usada8	r0, r0, r0, r0
663
664smlal:
665	smlalbb	r0, r0, r0, r0
666	smlalbb	r9, r0, r0, r0
667	smlalbb	r0, r9, r0, r0
668	smlalbb	r0, r0, r9, r0
669	smlalbb	r0, r0, r0, r9
670
671	smlaltb	r0, r0, r0, r0
672	smlalbt	r0, r0, r0, r0
673	smlaltt	r0, r0, r0, r0
674	smlald	r0, r0, r0, r0
675	smlaldx	r0, r0, r0, r0
676	smlsld	r0, r0, r0, r0
677	smlsldx	r0, r0, r0, r0
678	umaal	r0, r0, r0, r0
679
680smul:
681	smulbb	r0, r0, r0
682	smulbb	r9, r0, r0
683	smulbb	r0, r9, r0
684	smulbb	r0, r0, r9
685
686	smultb	r0, r0, r0
687	smulbt	r0, r0, r0
688	smultt	r0, r0, r0
689	smulwb	r0, r0, r0
690	smulwt	r0, r0, r0
691	smmul	r0, r0, r0
692	smmulr	r0, r0, r0
693	smuad	r0, r0, r0
694	smuadx	r0, r0, r0
695	smusd	r0, r0, r0
696	smusdx	r0, r0, r0
697	usad8	r0, r0, r0
698
699sat:
700	ssat	r0, #1, r0
701	ssat	r0, #1, r0, lsl #0
702	ssat	r0, #1, r0, asr #0
703	ssat	r9, #1, r0
704	ssat	r0, #18, r0
705	ssat	r0, #1, r9
706	ssat	r0, #1, r0, lsl #0x1c
707	ssat	r0, #1, r0, asr #0x03
708
709	ssat16	r0, #1, r0
710	ssat16	r9, #1, r0
711	ssat16	r0, #10, r0
712	ssat16	r0, #1, r9
713
714	usat	r0, #0, r0
715	usat	r0, #0, r0, lsl #0
716	usat	r0, #0, r0, asr #0
717	usat	r9, #0, r0
718	usat	r0, #17, r0
719	usat	r0, #0, r9
720	usat	r0, #0, r0, lsl #0x1c
721	usat	r0, #0, r0, asr #0x03
722
723	usat16	r0, #0, r0
724	usat16	r9, #0, r0
725	usat16	r0, #9, r0
726	usat16	r0, #0, r9
727
728xt:
729	sxtb	r0, r0
730	sxtb	r0, r0, ror #0
731	sxtb	r5, r0
732	sxtb	r0, r5
733	sxtb.w	r1, r2
734	sxtb	r1, r2, ror #8
735	sxtb	r1, r2, ror #16
736	sxtb	r1, r2, ror #24
737
738	sxtb16	r1, r2
739	sxtb16	r8, r9
740	sxth	r1, r2
741	sxth	r8, r9
742	uxtb	r1, r2
743	uxtb	r8, r9
744	uxtb16	r1, r2
745	uxtb16	r8, r9
746	uxth	r1, r2
747	uxth	r8, r9
748
749xta:
750	sxtab	r0, r0, r0
751	sxtab	r0, r0, r0, ror #0
752	sxtab	r9, r0, r0, ror #8
753	sxtab	r0, r9, r0, ror #16
754	sxtab	r0, r0, r9, ror #24
755
756	sxtab16	r1, r2, r3
757	sxtah	r1, r2, r3
758	uxtab	r1, r2, r3
759	uxtab16	r1, r2, r3
760	uxtah	r1, r2, r3
761
762	.macro	ldpcimm op
763	\op	r1, [pc, #0x2aa]
764	\op	r1, [pc, #0x155]
765	\op	r1, [pc, #-0x2aa]
766	\op	r1, [pc, #-0x155]
767	.endm
768	ldpcimm	ldrb
769	ldpcimm	ldrsb
770	ldpcimm	ldrh
771	ldpcimm	ldrsh
772	ldpcimm	ldr
773	addw r9, r0, #0
774	addw r6, pc, #0xfff
775	subw r6, r9, #0xa85
776	subw r6, r9, #0x57a
777	tbb [pc, r6]
778	tbb [r0, r9]
779	tbh [pc, r7, lsl #1]
780	tbh [r0, r8, lsl #1]
781
782	push	{r8}
783	pop	{r8}
784
785	ldmdb	r0!, {r7,r8,r10}
786	stmdb	r0!, {r7,r8,r10}
787
788	ldm	r0!, {r1, r2}
789	stm	r0!, {r1, r2}
790	ldm	r0, {r8, r9}
791	stm	r0, {r8, r9}
792	itttt eq
793	ldmeq	r0!, {r1, r2}
794	stmeq	r0!, {r1, r2}
795	ldmeq	r0, {r8, r9}
796	stmeq	r0, {r8, r9}
797	nop
798
799srs:
800	srsia sp, #16
801	srsdb sp, #16
802	srsia sp!, #21
803	srsia sp!, #10
804
805	movs pc, lr
806	subs pc, lr, #0
807	subs pc, lr, #4
808	subs pc, lr, #255
809
810	ldrd r2, r4, [r9, #48]!
811	ldrd r2, r4, [r9, #-48]!
812	strd r2, r4, [r9, #48]!
813	strd r2, r4, [r9, #-48]!
814	ldrd r2, r4, [r9], #48
815	ldrd r2, r4, [r9], #-48
816	strd r2, r4, [r9], #48
817	strd r2, r4, [r9], #-48
818
819	.macro ldaddr op
820	ldr\op	r1, [r5, #0x301]
821	ldr\op	r1, [r5, #0x30]!
822	ldr\op	r1, [r5, #-0x30]!
823	ldr\op	r1, [r5], #0x30
824	ldr\op	r1, [r5], #-0x30
825	ldr\op	r1, [r5, r9]
826	.endm
827	ldaddr
828	ldaddr b
829	ldaddr sb
830	ldaddr h
831	ldaddr sh
832	.macro movshift op s="s"
833	movs r1, r4, \op #2
834	movs r3, r9, \op #2
835	movs r1, r2, \op r3
836	movs r1, r1, \op r3
837	movs r1, r1, \op r9
838	mov r1, r2, \op r3
839	mov r1, r1, \op r3
840	.endm
841	movshift lsl
842	movshift lsr
843	movshift asr
844	movshift ror
845	nop
846