Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(212)

Side by Side Diff: tests_lit/assembler/arm32/mov-imm.ll

Issue 1418523002: Add hybrid assembler concept to ARM assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nits. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tests_lit/assembler/arm32/load-store.ll ('k') | tests_lit/assembler/arm32/ret.ll » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 ; Show that we know how to translate move (immediate) ARM instruction. 1 ; Show that we know how to translate move (immediate) ARM instruction.
2 2
3 ; REQUIRES: allow_dump 3 ; REQUIRES: allow_dump
4 4
5 ; RUN: %p2i --filetype=asm -i %s --target=arm32 \ 5 ; Compile using standalone assembler.
6 ; RUN: %p2i --filetype=asm -i %s --target=arm32 --args -O2 \
6 ; RUN: | FileCheck %s --check-prefix=ASM 7 ; RUN: | FileCheck %s --check-prefix=ASM
7 ; RUN: %p2i --filetype=iasm -i %s --target=arm32 \ 8
9 ; Show bytes in assembled standalone code.
10 ; RUN: %p2i --filetype=asm -i %s --target=arm32 --assemble --disassemble \
11 ; RUN: --args -O2 | FileCheck %s --check-prefix=DIS
12
13 ; Compile using integrated assembler.
14 ; RUN: %p2i --filetype=iasm -i %s --target=arm32 --args -O2 \
8 ; RUN: | FileCheck %s --check-prefix=IASM 15 ; RUN: | FileCheck %s --check-prefix=IASM
9 16
17 ; Show bytes in assembled integrated code.
18 ; RUN: %p2i --filetype=iasm -i %s --target=arm32 --assemble --disassemble \
19 ; RUN: --args -O2 | FileCheck %s --check-prefix=DIS
20
10 define internal i32 @Imm1() { 21 define internal i32 @Imm1() {
11 ret i32 1 22 ret i32 1
12 } 23 }
13 24
14 ; ASM-LABEL: Imm1: 25 ; ASM-LABEL: Imm1:
15 ; ASM: mov» r0, #1 26 ; ASM: mov r0, #1
27
28 ; DIS-LABEL:00000000 <Imm1>:
29 ; DIS-NEXT: 0: e3a00001
30
16 ; IASM-LABEL: Imm1: 31 ; IASM-LABEL: Imm1:
17 ; IASM:».byte 0x1 32 ; IASM: .byte 0x1
18 ; IASM:».byte 0x0 33 ; IASM: .byte 0x0
19 ; IASM:».byte 0xa0 34 ; IASM: .byte 0xa0
20 ; IASM:».byte 0xe3 35 ; IASM: .byte 0xe3
21 36
22 37
23 define internal i32 @rotateFImmAA() { 38 define internal i32 @rotateFImmAA() {
24 ; immediate = 0x000002a8 = b 0000 0000 0000 0000 0000 0010 1010 1000 39 ; immediate = 0x000002a8 = b 0000 0000 0000 0000 0000 0010 1010 1000
25 ret i32 680 40 ret i32 680
26 } 41 }
27 42
28 ; ASM-LABEL: rotateFImmAA: 43 ; ASM-LABEL: rotateFImmAA:
29 ; ASM: mov» r0, #680 44 ; ASM: mov r0, #680
45
46 ; DIS-LABEL:00000010 <rotateFImmAA>:
47 ; DIS-NEXT: 10: e3a00faa
30 48
31 ; IASM-LABEL: rotateFImmAA: 49 ; IASM-LABEL: rotateFImmAA:
32 ; IASM:».byte 0xaa 50 ; IASM: .byte 0xaa
33 ; IASM:».byte 0xf 51 ; IASM: .byte 0xf
34 ; IASM:».byte 0xa0 52 ; IASM: .byte 0xa0
35 ; IASM:».byte 0xe3 53 ; IASM: .byte 0xe3
36 54
37 define internal i32 @rotateEImmAA() { 55 define internal i32 @rotateEImmAA() {
38 ; immediate = 0x00000aa0 = b 0000 0000 0000 0000 0000 1010 1010 0000 56 ; immediate = 0x00000aa0 = b 0000 0000 0000 0000 0000 1010 1010 0000
39 ret i32 2720 57 ret i32 2720
40 } 58 }
41 59
42 ; ASM-LABEL: rotateEImmAA: 60 ; ASM-LABEL: rotateEImmAA:
43 ; ASM: mov» r0, #2720 61 ; ASM: mov r0, #2720
62
63 ; DIS-LABEL:00000020 <rotateEImmAA>:
64 ; DIS-NEXT: 20: e3a00eaa
44 65
45 ; IASM-LABEL: rotateEImmAA: 66 ; IASM-LABEL: rotateEImmAA:
46 ; IASM:».byte 0xaa 67 ; IASM: .byte 0xaa
47 ; IASM:».byte 0xe 68 ; IASM: .byte 0xe
48 ; IASM:».byte 0xa0 69 ; IASM: .byte 0xa0
49 ; IASM:».byte 0xe3 70 ; IASM: .byte 0xe3
50 71
51 define internal i32 @rotateDImmAA() { 72 define internal i32 @rotateDImmAA() {
52 ; immediate = 0x00002a80 = b 0000 0000 0000 0000 0010 1010 1000 0000 73 ; immediate = 0x00002a80 = b 0000 0000 0000 0000 0010 1010 1000 0000
53 ret i32 10880 74 ret i32 10880
54 } 75 }
55 76
56 ; ASM-LABEL: rotateDImmAA: 77 ; ASM-LABEL: rotateDImmAA:
57 ; ASM: mov» r0, #10880 78 ; ASM: mov r0, #10880
79
80 ; DIS-LABEL:00000030 <rotateDImmAA>:
81 ; DIS-NEXT: 30: e3a00daa
58 82
59 ; IASM-LABEL: rotateDImmAA: 83 ; IASM-LABEL: rotateDImmAA:
60 ; IASM:».byte 0xaa 84 ; IASM: .byte 0xaa
61 ; IASM:».byte 0xd 85 ; IASM: .byte 0xd
62 ; IASM:».byte 0xa0 86 ; IASM: .byte 0xa0
63 ; IASM:».byte 0xe3 87 ; IASM: .byte 0xe3
64 88
65 define internal i32 @rotateCImmAA() { 89 define internal i32 @rotateCImmAA() {
66 ; immediate = 0x0000aa00 = b 0000 0000 0000 0000 1010 1010 0000 0000 90 ; immediate = 0x0000aa00 = b 0000 0000 0000 0000 1010 1010 0000 0000
67 ret i32 43520 91 ret i32 43520
68 } 92 }
69 93
70 ; ASM-LABEL: rotateCImmAA: 94 ; ASM-LABEL: rotateCImmAA:
71 ; ASM: mov» r0, #43520 95 ; ASM: mov r0, #43520
96
97 ; DIS-LABEL:00000040 <rotateCImmAA>:
98 ; DIS-NEXT: 40: e3a00caa
72 99
73 ; IASM-LABEL: rotateCImmAA: 100 ; IASM-LABEL: rotateCImmAA:
74 ; IASM:».byte 0xaa 101 ; IASM: .byte 0xaa
75 ; IASM:».byte 0xc 102 ; IASM: .byte 0xc
76 ; IASM:».byte 0xa0 103 ; IASM: .byte 0xa0
77 ; IASM:».byte 0xe3 104 ; IASM: .byte 0xe3
78 105
79 define internal i32 @rotateBImmAA() { 106 define internal i32 @rotateBImmAA() {
80 ; immediate = 0x0002a800 = b 0000 0000 0000 0010 1010 1000 0000 0000 107 ; immediate = 0x0002a800 = b 0000 0000 0000 0010 1010 1000 0000 0000
81 ret i32 174080 108 ret i32 174080
82 } 109 }
83 110
84 ; ASM-LABEL: rotateBImmAA: 111 ; ASM-LABEL: rotateBImmAA:
85 ; ASM: mov» r0, #174080 112 ; ASM: mov r0, #174080
113
114 ; DIS-LABEL:00000050 <rotateBImmAA>:
115 ; DIS-NEXT: 50: e3a00baa
86 116
87 ; IASM-LABEL: rotateBImmAA: 117 ; IASM-LABEL: rotateBImmAA:
88 ; IASM:».byte 0xaa 118 ; IASM: .byte 0xaa
89 ; IASM:».byte 0xb 119 ; IASM: .byte 0xb
90 ; IASM:».byte 0xa0 120 ; IASM: .byte 0xa0
91 ; IASM:».byte 0xe3 121 ; IASM: .byte 0xe3
92 122
93 define internal i32 @rotateAImmAA() { 123 define internal i32 @rotateAImmAA() {
94 ; immediate = 0x000aa000 = b 0000 0000 0000 1010 1010 0000 0000 0000 124 ; immediate = 0x000aa000 = b 0000 0000 0000 1010 1010 0000 0000 0000
95 ret i32 696320 125 ret i32 696320
96 } 126 }
97 127
98 ; ASM-LABEL: rotateAImmAA: 128 ; ASM-LABEL: rotateAImmAA:
99 ; ASM: mov» r0, #696320 129 ; ASM: mov r0, #696320
130
131 ; DIS-LABEL:00000060 <rotateAImmAA>:
132 ; DIS-NEXT: 60: e3a00aaa
100 133
101 ; IASM-LABEL: rotateAImmAA: 134 ; IASM-LABEL: rotateAImmAA:
102 ; IASM:».byte 0xaa 135 ; IASM: .byte 0xaa
103 ; IASM:».byte 0xa 136 ; IASM: .byte 0xa
104 ; IASM:».byte 0xa0 137 ; IASM: .byte 0xa0
105 ; IASM:».byte 0xe3 138 ; IASM: .byte 0xe3
106 139
107 define internal i32 @rotate9ImmAA() { 140 define internal i32 @rotate9ImmAA() {
108 ; immediate = 0x002a8000 = b 0000 0000 0010 1010 1000 0000 0000 0000 141 ; immediate = 0x002a8000 = b 0000 0000 0010 1010 1000 0000 0000 0000
109 ret i32 2785280 142 ret i32 2785280
110 } 143 }
111 144
112 ; ASM-LABEL: rotate9ImmAA: 145 ; ASM-LABEL: rotate9ImmAA:
113 ; ASM: mov» r0, #2785280 146 ; ASM: mov r0, #2785280
147
148 ; DIS-LABEL:00000070 <rotate9ImmAA>:
149 ; DIS-NEXT: 70: e3a009aa
114 150
115 ; IASM-LABEL: rotate9ImmAA: 151 ; IASM-LABEL: rotate9ImmAA:
116 ; IASM:».byte 0xaa 152 ; IASM: .byte 0xaa
117 ; IASM:».byte 0x9 153 ; IASM: .byte 0x9
118 ; IASM:».byte 0xa0 154 ; IASM: .byte 0xa0
119 ; IASM:».byte 0xe3 155 ; IASM: .byte 0xe3
120 156
121 define internal i32 @rotate8ImmAA() { 157 define internal i32 @rotate8ImmAA() {
122 ; immediate = 0x00aa0000 = b 0000 0000 1010 1010 0000 0000 0000 0000 158 ; immediate = 0x00aa0000 = b 0000 0000 1010 1010 0000 0000 0000 0000
123 ret i32 11141120 159 ret i32 11141120
124 } 160 }
125 161
126 ; ASM-LABEL: rotate8ImmAA: 162 ; ASM-LABEL: rotate8ImmAA:
127 ; ASM: mov» r0, #11141120 163 ; ASM: mov r0, #11141120
164
165 ; DIS-LABEL:00000080 <rotate8ImmAA>:
166 ; DIS-NEXT: 80: e3a008aa
128 167
129 ; IASM-LABEL: rotate8ImmAA: 168 ; IASM-LABEL: rotate8ImmAA:
130 ; IASM:».byte 0xaa 169 ; IASM: .byte 0xaa
131 ; IASM:».byte 0x8 170 ; IASM: .byte 0x8
132 ; IASM:».byte 0xa0 171 ; IASM: .byte 0xa0
133 ; IASM:».byte 0xe3 172 ; IASM: .byte 0xe3
134 173
135 define internal i32 @rotate7ImmAA() { 174 define internal i32 @rotate7ImmAA() {
136 ; immediate = 0x02a80000 = b 0000 0010 1010 1000 0000 0000 0000 0000 175 ; immediate = 0x02a80000 = b 0000 0010 1010 1000 0000 0000 0000 0000
137 ret i32 44564480 176 ret i32 44564480
138 } 177 }
139 178
140 ; ASM-LABEL: rotate7ImmAA: 179 ; ASM-LABEL: rotate7ImmAA:
141 ; ASM: »mov» r0, #44564480 180 ; ASM: mov r0, #44564480
181
182 ; DIS-LABEL:00000090 <rotate7ImmAA>:
183 ; DIS-NEXT: 90: e3a007aa
142 184
143 ; IASM-LABEL: rotate7ImmAA: 185 ; IASM-LABEL: rotate7ImmAA:
144 ; IASM:».byte 0xaa 186 ; IASM: .byte 0xaa
145 ; IASM:».byte 0x7 187 ; IASM: .byte 0x7
146 ; IASM:».byte 0xa0 188 ; IASM: .byte 0xa0
147 ; IASM:».byte 0xe3 189 ; IASM: .byte 0xe3
148 190
149 define internal i32 @rotate6ImmAA() { 191 define internal i32 @rotate6ImmAA() {
150 ; immediate = 0x0aa00000 = b 0000 1010 1010 0000 0000 0000 0000 0000 192 ; immediate = 0x0aa00000 = b 0000 1010 1010 0000 0000 0000 0000 0000
151 ret i32 178257920 193 ret i32 178257920
152 } 194 }
153 195
154 ; ASM-LABEL: rotate6ImmAA: 196 ; ASM-LABEL: rotate6ImmAA:
155 ; ASM: »mov» r0, #178257920 197 ; ASM: mov r0, #178257920
198
199 ; DIS-LABEL:000000a0 <rotate6ImmAA>:
200 ; DIS-NEXT: a0: e3a006aa
156 201
157 ; IASM-LABEL: rotate6ImmAA: 202 ; IASM-LABEL: rotate6ImmAA:
158 ; IASM:».byte 0xaa 203 ; IASM: .byte 0xaa
159 ; IASM:».byte 0x6 204 ; IASM: .byte 0x6
160 ; IASM:».byte 0xa0 205 ; IASM: .byte 0xa0
161 ; IASM:».byte 0xe3 206 ; IASM: .byte 0xe3
162 207
163 define internal i32 @rotate5ImmAA() { 208 define internal i32 @rotate5ImmAA() {
164 ; immediate = 0x2a800000 = b 0010 1010 1000 0000 0000 0000 0000 0000 209 ; immediate = 0x2a800000 = b 0010 1010 1000 0000 0000 0000 0000 0000
165 ret i32 713031680 210 ret i32 713031680
166 } 211 }
167 212
168 ; ASM-LABEL: rotate5ImmAA: 213 ; ASM-LABEL: rotate5ImmAA:
169 ; ASM: »mov» r0, #713031680 214 ; ASM: mov r0, #713031680
215
216 ; DIS-LABEL:000000b0 <rotate5ImmAA>:
217 ; DIS-NEXT: b0: e3a005aa
170 218
171 ; IASM-LABEL: rotate5ImmAA: 219 ; IASM-LABEL: rotate5ImmAA:
172 ; IASM:».byte 0xaa 220 ; IASM: .byte 0xaa
173 ; IASM:».byte 0x5 221 ; IASM: .byte 0x5
174 ; IASM:».byte 0xa0 222 ; IASM: .byte 0xa0
175 ; IASM:».byte 0xe3 223 ; IASM: .byte 0xe3
176 224
177 define internal i32 @rotate4ImmAA() { 225 define internal i32 @rotate4ImmAA() {
178 ; immediate = 0xaa000000 = b 1010 1010 0000 0000 0000 0000 0000 0000 226 ; immediate = 0xaa000000 = b 1010 1010 0000 0000 0000 0000 0000 0000
179 ret i32 2852126720 227 ret i32 2852126720
180 } 228 }
181 229
182 ; ASM-LABEL: rotate4ImmAA: 230 ; ASM-LABEL: rotate4ImmAA:
183 ; ASM: mov» r0, #2852126720 231 ; ASM: mov r0, #2852126720
232
233 ; DIS-LABEL:000000c0 <rotate4ImmAA>:
234 ; DIS-NEXT: c0: e3a004aa
184 235
185 ; IASM-LABEL: rotate4ImmAA: 236 ; IASM-LABEL: rotate4ImmAA:
186 ; IASM:».byte 0xaa 237 ; IASM: .byte 0xaa
187 ; IASM:».byte 0x4 238 ; IASM: .byte 0x4
188 ; IASM:».byte 0xa0 239 ; IASM: .byte 0xa0
189 ; IASM:».byte 0xe3 240 ; IASM: .byte 0xe3
190 241
191 define internal i32 @rotate3ImmAA() { 242 define internal i32 @rotate3ImmAA() {
192 ; immediate = 0xa8000002 = b 1010 1000 0000 0000 0000 0000 0000 0010 243 ; immediate = 0xa8000002 = b 1010 1000 0000 0000 0000 0000 0000 0010
193 ret i32 2818572290 244 ret i32 2818572290
194 } 245 }
195 246
196 ; ASM-LABEL: rotate3ImmAA: 247 ; ASM-LABEL: rotate3ImmAA:
197 ; ASM: mov» r0, #2818572290 248 ; ASM: mov r0, #2818572290
249
250 ; DIS-LABEL:000000d0 <rotate3ImmAA>:
251 ; DIS-NEXT: d0: e3a003aa
198 252
199 ; IASM-LABEL: rotate3ImmAA: 253 ; IASM-LABEL: rotate3ImmAA:
200 ; IASM:».byte 0xaa 254 ; IASM: .byte 0xaa
201 ; IASM:».byte 0x3 255 ; IASM: .byte 0x3
202 ; IASM:».byte 0xa0 256 ; IASM: .byte 0xa0
203 ; IASM:».byte 0xe3 257 ; IASM: .byte 0xe3
204 258
205 define internal i32 @rotate2ImmAA() { 259 define internal i32 @rotate2ImmAA() {
206 ; immediate = 0xa000000a = b 1010 0000 0000 0000 0000 0000 0000 1010 260 ; immediate = 0xa000000a = b 1010 0000 0000 0000 0000 0000 0000 1010
207 ret i32 2684354570 261 ret i32 2684354570
208 } 262 }
209 263
210 ; ASM-LABEL: rotate2ImmAA: 264 ; ASM-LABEL: rotate2ImmAA:
211 ; ASM: »mov» r0, #2684354570 265 ; ASM: mov r0, #2684354570
266
267 ; DIS-LABEL:000000e0 <rotate2ImmAA>:
268 ; DIS-NEXT: e0: e3a002aa
212 269
213 ; IASM-LABEL: rotate2ImmAA: 270 ; IASM-LABEL: rotate2ImmAA:
214 ; IASM:».byte 0xaa 271 ; IASM: .byte 0xaa
215 ; IASM:».byte 0x2 272 ; IASM: .byte 0x2
216 ; IASM:».byte 0xa0 273 ; IASM: .byte 0xa0
217 ; IASM:».byte 0xe3 274 ; IASM: .byte 0xe3
218 275
219 define internal i32 @rotate1ImmAA() { 276 define internal i32 @rotate1ImmAA() {
220 ; immediate = 0x8000002a = b 1000 1000 0000 0000 0000 0000 0010 1010 277 ; immediate = 0x8000002a = b 1000 1000 0000 0000 0000 0000 0010 1010
221 ret i32 2147483690 278 ret i32 2147483690
222 } 279 }
223 280
224 ; ASM-LABEL: rotate1ImmAA: 281 ; ASM-LABEL: rotate1ImmAA:
225 ; ASM: mov» r0, #2147483690 282 ; ASM: mov r0, #2147483690
283
284 ; DIS-LABEL:000000f0 <rotate1ImmAA>:
285 ; DIS-NEXT: f0: e3a001aa
226 286
227 ; IASM-LABEL: rotate1ImmAA: 287 ; IASM-LABEL: rotate1ImmAA:
228 ; IASM:».byte 0xaa 288 ; IASM: .byte 0xaa
229 ; IASM:».byte 0x1 289 ; IASM: .byte 0x1
230 ; IASM:».byte 0xa0 290 ; IASM: .byte 0xa0
231 ; IASM:».byte 0xe3 291 ; IASM: .byte 0xe3
232 292
233 define internal i32 @rotate0ImmAA() { 293 define internal i32 @rotate0ImmAA() {
234 ; immediate = 0x000000aa = b 0000 0000 0000 0000 0000 0000 1010 1010 294 ; immediate = 0x000000aa = b 0000 0000 0000 0000 0000 0000 1010 1010
235 ret i32 170 295 ret i32 170
236 } 296 }
237 297
238 ; ASM-LABEL: rotate0ImmAA: 298 ; ASM-LABEL: rotate0ImmAA:
239 ; ASM: mov» r0, #170 299 ; ASM: mov r0, #170
300
301 ; DIS-LABEL:00000100 <rotate0ImmAA>:
302 ; DIS-NEXT: 100: e3a000aa
240 303
241 ; IASM-LABEL: rotate0ImmAA: 304 ; IASM-LABEL: rotate0ImmAA:
242 ; IASM:».byte 0xaa 305 ; IASM: .byte 0xaa
243 ; IASM:».byte 0x0 306 ; IASM: .byte 0x0
244 ; IASM:».byte 0xa0 307 ; IASM: .byte 0xa0
245 ; IASM:».byte 0xe3 308 ; IASM: .byte 0xe3
OLDNEW
« no previous file with comments | « tests_lit/assembler/arm32/load-store.ll ('k') | tests_lit/assembler/arm32/ret.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698