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

Side by Side Diff: tests_lit/assembler/arm32/global-load-store.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, 1 month 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/add.ll ('k') | tests_lit/assembler/arm32/load-store.ll » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 ; TODO(kschimpf): Show that we can handle global variable loads/stores.
2
3 ; REQUIRES: allow_dump
4
5 ; Compile using standalone assembler.
6 ; RUN: %p2i --filetype=asm -i %s --target=arm32 --args -O2 \
7 ; RUN: | FileCheck %s --check-prefix=ASM
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 \
15 ; RUN: | FileCheck %s --check-prefix=IASM
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
21 @global1 = internal global [4 x i8] zeroinitializer, align 4
22
23 ; ASM-LABEL: global1:
24 ; ASM-NEXT: .zero 4
25 ; ASM-NEXT: .size global1, 4
26 ; ASM-NEXT: .text
27 ; ASM-NEXT: .p2alignl 4,0xe7fedef0
28
29 ; IASM-LABEL:global1:
30 ; IASM-NEXT: .zero 4
31 ; IASM-NEXT: .size global1, 4
32 ; IASM-NEXT: .text
33 ; IASM-NEXT: .p2alignl 4,0xe7fedef0
34
35 define internal i32 @load() {
36 %addr = bitcast [4 x i8]* @global1 to i32*
37 %v = load i32, i32* %addr, align 1
38 ret i32 %v
39 }
40
41 ; ASM-LABEL: load:
42 ; ASM-NEXT: .Lload$__0:
43 ; ASM-NEXT: movw r0, #:lower16:global1
44 ; ASM-NEXT: movt r0, #:upper16:global1
45 ; ASM-NEXT: ldr r0, [r0]
46 ; ASM-NEXT: bx lr
47
48 ; DIS-LABEL:00000000 <load>:
49 ; DIS-NEXT: 0: e3000000
50 ; DIS-NEXT: 4: e3400000
51 ; DIS-NEXT: 8: e5900000
52 ; DIS-NEXT: c: e12fff1e
53
54 ; IASM-LABEL:load:
55 ; IASM-NEXT: movw r0, #:lower16:global1
56 ; IASM-NEXT: movt r0, #:upper16:global1
57 ; IASM-NEXT: ldr r0, [r0]
58 ; IASM-NEXT: .byte 0x1e
59 ; IASM-NEXT: .byte 0xff
60 ; IASM-NEXT: .byte 0x2f
61 ; IASM-NEXT: .byte 0xe1
62
63 define internal void @store(i32 %v) {
64 %addr = bitcast [4 x i8]* @global1 to i32*
65 store i32 %v, i32* %addr, align 1
66 ret void
67 }
68
69 ; ASM-LABEL:store:
70 ; ASM-NEXT: .Lstore$__0:
71 ; ASM-NEXT: movw r1, #:lower16:global1
72 ; ASM-NEXT: movt r1, #:upper16:global1
73 ; ASM-NEXT: str r0, [r1]
74 ; ASM-NEXT: bx lr
75
76 ; DIS-LABEL:00000010 <store>:
77 ; DIS-NEXT: 10: e3001000
78 ; DIS-NEXT: 14: e3401000
79 ; DIS-NEXT: 18: e5810000
80 ; DIS-NEXT: 1c: e12fff1e
81
82 ; IASM-LABEL:store:
83 ; IASM-NEXT: movw r1, #:lower16:global1
84 ; IASM-NEXT: movt r1, #:upper16:global1
85 ; IASM-NEXT: str r0, [r1]
86 ; IASM-NEXT: .byte 0x1e
87 ; IASM-NEXT: .byte 0xff
88 ; IASM-NEXT: .byte 0x2f
89 ; IASM-NEXT: .byte 0xe1
OLDNEW
« no previous file with comments | « tests_lit/assembler/arm32/add.ll ('k') | tests_lit/assembler/arm32/load-store.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698