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

Side by Side Diff: tests_lit/assembler/arm32/global-load-store.ll

Issue 1424863005: Handle MOV (immediate) and MOVT to load ARM global addresses. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix movw and movt 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
« src/IceAssemblerARM32.cpp ('K') | « src/IceTargetLoweringARM32.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 ; TODO(kschimpf): Show that we can handle global variable loads/stores. 1 ; TODO(kschimpf): Show that we can handle global variable loads/stores.
2 2
3 ; REQUIRES: allow_dump 3 ; REQUIRES: allow_dump
4 4
5 ; Compile using standalone assembler. 5 ; Compile using standalone assembler.
6 ; RUN: %p2i --filetype=asm -i %s --target=arm32 --args -O2 \ 6 ; RUN: %p2i --filetype=asm -i %s --target=arm32 --args -O2 \
7 ; RUN: | FileCheck %s --check-prefix=ASM 7 ; RUN: | FileCheck %s --check-prefix=ASM
8 8
9 ; Show bytes in assembled standalone code. 9 ; Show bytes in assembled standalone code.
10 ; RUN: %p2i --filetype=asm -i %s --target=arm32 --assemble --disassemble \ 10 ; RUN: %p2i --filetype=asm -i %s --target=arm32 --assemble --disassemble \
11 ; RUN: --args -O2 | FileCheck %s --check-prefix=DIS 11 ; RUN: --args -O2 | FileCheck %s --check-prefix=DIS
12 12
13 ; Compile using integrated assembler. 13 ; Compile using integrated assembler.
14 ; RUN: %p2i --filetype=iasm -i %s --target=arm32 --args -O2 \ 14 ; RUN: %p2i --filetype=iasm -i %s --target=arm32 --args -O2 \
15 ; RUN: | FileCheck %s --check-prefix=IASM 15 ; RUN: | FileCheck %s --check-prefix=IASM
16 16
17 ; Show bytes in assembled integrated code. 17 ; Show bytes in assembled integrated code.
18 ; RUN: %p2i --filetype=iasm -i %s --target=arm32 --assemble --disassemble \ 18 ; RUN: %p2i --filetype=iasm -i %s --target=arm32 --assemble --disassemble \
19 ; RUN: --args -O2 | FileCheck %s --check-prefix=DIS 19 ; RUN: --args -O2 | FileCheck %s --check-prefix=DIS
20 20
21 @filler = internal global [128 x i8] zeroinitializer, align 4
22
21 @global1 = internal global [4 x i8] zeroinitializer, align 4 23 @global1 = internal global [4 x i8] zeroinitializer, align 4
22 24
23 ; ASM-LABEL: global1: 25 ; ASM-LABEL: global1:
24 ; ASM-NEXT: .zero 4 26 ; ASM-NEXT: .zero 4
25 ; ASM-NEXT: .size global1, 4 27 ; ASM-NEXT: .size global1, 4
26 ; ASM-NEXT: .text 28 ; ASM-NEXT: .text
27 ; ASM-NEXT: .p2alignl 4,0xe7fedef0 29 ; ASM-NEXT: .p2alignl 4,0xe7fedef0
28 30
29 ; IASM-LABEL:global1: 31 ; IASM-LABEL:global1:
30 ; IASM-NEXT: .zero 4 32 ; IASM-NEXT: .zero 4
(...skipping 15 matching lines...) Expand all
46 ; ASM-NEXT: bx lr 48 ; ASM-NEXT: bx lr
47 49
48 ; DIS-LABEL:00000000 <load>: 50 ; DIS-LABEL:00000000 <load>:
49 ; DIS-NEXT: 0: e3000000 51 ; DIS-NEXT: 0: e3000000
50 ; DIS-NEXT: 4: e3400000 52 ; DIS-NEXT: 4: e3400000
51 ; DIS-NEXT: 8: e5900000 53 ; DIS-NEXT: 8: e5900000
52 ; DIS-NEXT: c: e12fff1e 54 ; DIS-NEXT: c: e12fff1e
53 55
54 ; IASM-LABEL:load: 56 ; IASM-LABEL:load:
55 ; IASM-NEXT: .Lload$__0: 57 ; IASM-NEXT: .Lload$__0:
56 ; IASM-NEXT: movw r0, #:lower16:global1 58 ; IASM-NEXT: movw r0, #:lower16:global1 @ .word e3000000
57 ; IASM-NEXT: movt r0, #:upper16:global1 59 ; IASM-NEXT: movt r0, #:upper16:global1 @ .word e3400000
58 ; IASM-NEXT: ldr r0, [r0] 60 ; IASM-NEXT: ldr r0, [r0]
59 ; IASM-NEXT: .byte 0x1e 61 ; IASM-NEXT: .byte 0x1e
60 ; IASM-NEXT: .byte 0xff 62 ; IASM-NEXT: .byte 0xff
61 ; IASM-NEXT: .byte 0x2f 63 ; IASM-NEXT: .byte 0x2f
62 ; IASM-NEXT: .byte 0xe1 64 ; IASM-NEXT: .byte 0xe1
63 65
64 define internal void @store(i32 %v) { 66 define internal void @store(i32 %v) {
65 %addr = bitcast [4 x i8]* @global1 to i32* 67 %addr = bitcast [4 x i8]* @global1 to i32*
66 store i32 %v, i32* %addr, align 1 68 store i32 %v, i32* %addr, align 1
67 ret void 69 ret void
68 } 70 }
69 71
70 ; ASM-LABEL:store: 72 ; ASM-LABEL:store:
71 ; ASM-NEXT: .Lstore$__0: 73 ; ASM-NEXT: .Lstore$__0:
72 ; ASM-NEXT: movw r1, #:lower16:global1 74 ; ASM-NEXT: movw r1, #:lower16:global1
73 ; ASM-NEXT: movt r1, #:upper16:global1 75 ; ASM-NEXT: movt r1, #:upper16:global1
74 ; ASM-NEXT: str r0, [r1] 76 ; ASM-NEXT: str r0, [r1]
75 ; ASM-NEXT: bx lr 77 ; ASM-NEXT: bx lr
76 78
77 ; DIS-LABEL:00000010 <store>: 79 ; DIS-LABEL:00000010 <store>:
78 ; DIS-NEXT: 10: e3001000 80 ; DIS-NEXT: 10: e3001000
79 ; DIS-NEXT: 14: e3401000 81 ; DIS-NEXT: 14: e3401000
80 ; DIS-NEXT: 18: e5810000 82 ; DIS-NEXT: 18: e5810000
81 ; DIS-NEXT: 1c: e12fff1e 83 ; DIS-NEXT: 1c: e12fff1e
82 84
83 ; IASM-LABEL:store: 85 ; IASM-LABEL:store:
84 ; IASM-NEXT: .Lstore$__0: 86 ; IASM-NEXT: .Lstore$__0:
85 ; IASM-NEXT: movw r1, #:lower16:global1 87 ; IASM-NEXT: movw r1, #:lower16:global1 @ .word e3001000
86 ; IASM-NEXT: movt r1, #:upper16:global1 88 ; IASM-NEXT: movt r1, #:upper16:global1 @ .word e3401000
87 ; IASM-NEXT: str r0, [r1] 89 ; IASM-NEXT: str r0, [r1]
88 ; IASM-NEXT: .byte 0x1e 90 ; IASM-NEXT: .byte 0x1e
89 ; IASM-NEXT: .byte 0xff 91 ; IASM-NEXT: .byte 0xff
90 ; IASM-NEXT: .byte 0x2f 92 ; IASM-NEXT: .byte 0x2f
91 ; IASM-NEXT: .byte 0xe1 93 ; IASM-NEXT: .byte 0xe1
OLDNEW
« src/IceAssemblerARM32.cpp ('K') | « src/IceTargetLoweringARM32.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698