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

Side by Side Diff: tests_lit/assembler/arm32/ldr-shift.ll

Issue 1458523002: Add LDR/LDRB (register) to ARM integrated assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: 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 | « src/IceInstARM32.h ('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
(Empty)
1 ; Show that we know how to translate LDR (register).
2
3 ; NOTE: We use -O2 to get rid of memory stores.
4
5 ; REQUIRES: allow_dump
6
7 ; Compile using standalone assembler.
8 ; RUN: %lc2i --filetype=asm -i %s --target=arm32 --args -O2 \
9 ; RUN: | FileCheck %s --check-prefix=ASM
10
11 ; Show bytes in assembled standalone code.
12 ; RUN: %lc2i --filetype=asm -i %s --target=arm32 --assemble --disassemble \
13 ; RUN: --args -O2 | FileCheck %s --check-prefix=DIS
14
15 ; Compile using integrated assembler.
16 ; RUN: %lc2i --filetype=iasm -i %s --target=arm32 --args -O2 \
17 ; RUN: | FileCheck %s --check-prefix=IASM
18
19 ; Show bytes in assembled integrated code.
20 ; RUN: %lc2i --filetype=iasm -i %s --target=arm32 --assemble --disassemble \
21 ; RUN: --args -O2 | FileCheck %s --check-prefix=DIS
22
23 @ArrayInitPartial = internal global [40 x i8] c"<\00\00\00F\00\00\00P\00\00\00Z\ 00\00\00d\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", align 4
24
25 @NumArraysElements = internal global [4 x i8] c"\01\00\00\00", align 4
26
27 @Arrays = internal constant <{ i32, [4 x i8] }> <{ i32 ptrtoint ([40 x i8]* @Arr ayInitPartial to i32), [4 x i8] c"\14\00\00\00" }>, align 4
28
29 define internal void @_Z8getArrayjRj(i32 %WhichArray, i32 %Len) {
30 ; ASM-LABEL:_Z8getArrayjRj:
31 ; DIS-LABEL:00000000 <_Z8getArrayjRj>:
32 ; IASM-LABEL:_Z8getArrayjRj:
33
34 entry:
35 ; ASM-NEXT:.L_Z8getArrayjRj$entry:
36 ; IASM-NEXT:.L_Z8getArrayjRj$entry:
37
38 %gep_array = mul i32 %WhichArray, 8
39 %expanded1 = ptrtoint <{ i32, [4 x i8] }>* @Arrays to i32
40 %gep = add i32 %expanded1, %gep_array
41
42 ; ASM-NEXT: movw r2, #:lower16:Arrays
43 ; ASM-NEXT: movt r2, #:upper16:Arrays
44 ; DIS-NEXT: 0: e3002000
45 ; DIS-NEXT: 4: e3402000
46 ; IASM-NEXT: movw r2, #:lower16:Arrays @ .word e3002000
47 ; IASM-NEXT: movt r2, #:upper16:Arrays @ .word e3402000
48
49 %gep3 = add i32 %gep, 4
50
51 ; ASM-NEXT: add r2, r2, #4
52 ; DIS-NEXT: 8: e2822004
53 ; IASM-NEXT: .byte 0x4
54 ; IASM-NEXT: .byte 0x20
55 ; IASM-NEXT: .byte 0x82
56 ; IASM-NEXT: .byte 0xe2
57
58 ; ***** Here is the use of a LDR (register) instruction.
59 %gep3.asptr = inttoptr i32 %gep3 to i32*
60 %v1 = load i32, i32* %gep3.asptr, align 1
61
62 ; ASM-NEXT: ldr r2, [r2, r0, lsl #3]
63 ; DIS-NEXT: c: e7922180
64 ; IASM-NEXT: .byte 0x80
65 ; IASM-NEXT: .byte 0x21
66 ; IASM-NEXT: .byte 0x92
67 ; IASM-NEXT: .byte 0xe7
68
69
70 %Len.asptr3 = inttoptr i32 %Len to i32*
71 store i32 %v1, i32* %Len.asptr3, align 1
72
73 ; ASM-NEXT: str r2, [r1]
74 ; DIS-NEXT: 10: e5812000
75 ; IASM-NEXT: .byte 0x0
76 ; IASM-NEXT: .byte 0x20
77 ; IASM-NEXT: .byte 0x81
78 ; IASM-NEXT: .byte 0xe5
79
80 ret void
81
82 ; ASM-NEXT: bx lr
83 ; DIS-NEXT: 14: e12fff1e
84 ; IASM-NEXT: .byte 0x1e
85 ; IASM-NEXT: .byte 0xff
86 ; IASM-NEXT: .byte 0x2f
87 ; IASM-NEXT: .byte 0xe1
88
89 }
OLDNEW
« no previous file with comments | « src/IceInstARM32.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698