gas/
[binutils.git] / gas / testsuite / gas / arm / sp-pc-usage-t.s
blob17568665869e0bdbfaf81e03b4e8d36aa8cb55c3
1 .arch armv7-r
2 .syntax unified
3 .text
4 .thumb
5 .global foo
6 foo:
7 @ Section A6.1.3 "Use of 0b1101 as a register specifier".
9 @ R13 as the source or destination register of a mov instruction.
10 @ only register to register transfers without shifts are supported,
11 @ with no flag setting
13 mov sp,r0
14 mov r0,sp
16 @ Using the following instructions to adjust r13 up or down by a
17 @ multiple of 4:
19 add sp,sp,#0
20 addw sp,sp,#0
21 sub sp,sp,#0
22 subw sp,sp,#0
23 add sp,sp,r0
24 add sp,sp,r0,lsl #1
25 sub sp,sp,r0
26 sub sp,sp,r0,lsl #1
28 @ R13 as a base register <Rn> of any load/store instruction.
30 ldr r0, [sp]
31 ldr r0, [pc]
32 ldr pc, [r0]
33 ldr sp, [r0]
34 ldr pc, [pc]
35 ldr sp, [sp]
36 ldr pc, [sp]
37 ldr sp, [pc]
38 ldr sp, [r0, +pc]
40 str r0, [sp]
41 str sp, [r0]
42 str sp, [sp]
43 str sp, [r0, +pc]
45 @ R13 as the first operand <Rn> in any add{s}, cmn, cmp, or sub{s} instruction.
47 add r0, sp, r0
48 adds r0, sp, r0
49 add r0, sp, r0, lsl #1
50 adds r0, sp, r0, lsl #1
52 cmn sp, #0
53 cmn sp, r0
54 cmn sp, r0, lsl #1
55 cmp sp, #0
56 cmp sp, r0
57 cmp sp, r0, lsl #1
59 sub sp, #0
60 subs sp, #0
61 sub r0, sp, #0
62 subs r0, sp, #0
64 @ ADD (sp plus immediate).
66 add sp, #4
67 add r0, sp, #4
68 adds sp, #4
69 adds r0, sp, #4
70 addw r0, sp, #4
72 add sp, sp, #4
73 adds sp, sp, #4
74 addw sp, sp, #4
76 @ ADD (sp plus register).
78 add sp, r0
79 add r0, sp, r0
80 add r0, sp, r0, lsl #1
81 adds sp, r0
82 adds r0, sp, r0
83 adds r0, sp, r0, lsl #1
85 add sp, sp, r0
86 add sp, sp, r0, lsl #1
87 adds sp, sp, r0
88 adds sp, sp, r0, lsl #1
90 add sp, sp, sp
92 @ SUB (sp minus immediate).
94 sub r0, sp , #0
95 subs r0, sp , #0
96 subw r0, sp , #0
98 sub sp, sp , #0
99 subs sp, sp , #0
100 subw sp, sp , #0
102 @ SUB (sp minus register).
104 sub sp, #0
105 subs sp, #0
106 sub r0, sp, r0, lsl #1
107 subs r0, sp, r0, lsl #1
109 sub sp, sp, r0, lsl #1
110 subs sp, sp, r0, lsl #1
112 @ PC-related insns (equivalent to adr).
114 add r0, pc, #4
115 sub r0, pc, #4
116 adds r0, pc, #4
117 subs r0, pc, #4
118 addw r0, pc, #4
119 subw r0, pc, #4
121 @ nops to pad the section out to an alignment boundary.