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

Side by Side Diff: tests_lit/assembler/arm32/lsl.ll

Issue 1456783003: Add LSL (register, immediate) to ARM integrated assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix more 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
« src/IceAssemblerARM32.cpp ('K') | « src/IceInstARM32.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 ; Show that we know how to translate add. 1 ; Show that we know how to translate lsl.
2 2
3 ; NOTE: We use -O2 to get rid of memory stores. 3 ; NOTE: We use -O2 to get rid of memory stores.
4 4
5 ; REQUIRES: allow_dump 5 ; REQUIRES: allow_dump
6 6
7 ; Compile using standalone assembler. 7 ; Compile using standalone assembler.
8 ; RUN: %p2i --filetype=asm -i %s --target=arm32 --args -O2 \ 8 ; RUN: %p2i --filetype=asm -i %s --target=arm32 --args -O2 \
9 ; RUN: | FileCheck %s --check-prefix=ASM 9 ; RUN: | FileCheck %s --check-prefix=ASM
10 10
11 ; Show bytes in assembled standalone code. 11 ; Show bytes in assembled standalone code.
12 ; RUN: %p2i --filetype=asm -i %s --target=arm32 --assemble --disassemble \ 12 ; RUN: %p2i --filetype=asm -i %s --target=arm32 --assemble --disassemble \
13 ; RUN: --args -O2 | FileCheck %s --check-prefix=DIS 13 ; RUN: --args -O2 | FileCheck %s --check-prefix=DIS
14 14
15 ; Compile using integrated assembler. 15 ; Compile using integrated assembler.
16 ; RUN: %p2i --filetype=iasm -i %s --target=arm32 --args -O2 \ 16 ; RUN: %p2i --filetype=iasm -i %s --target=arm32 --args -O2 \
17 ; RUN: | FileCheck %s --check-prefix=IASM 17 ; RUN: | FileCheck %s --check-prefix=IASM
18 18
19 ; Show bytes in assembled integrated code. 19 ; Show bytes in assembled integrated code.
20 ; RUN: %p2i --filetype=iasm -i %s --target=arm32 --assemble --disassemble \ 20 ; RUN: %p2i --filetype=iasm -i %s --target=arm32 --assemble --disassemble \
21 ; RUN: --args -O2 | FileCheck %s --check-prefix=DIS 21 ; RUN: --args -O2 | FileCheck %s --check-prefix=DIS
22 22
23 define internal void @callIndirect(i32 %addr) { 23 define internal i32 @_Z8testUdivhh(i32 %a, i32 %b) {
Jim Stichnoth 2015/11/22 03:58:47 What a lovely function name! :) Of course it is a
Karl 2015/11/30 16:53:52 Simplified.
24 ; ASM-LABEL:callIndirect: 24
25 ; DIS-LABEL:00000000 <callIndirect>: 25 ; ASM-LABEL:_Z8testUdivhh:
26 ; IASM-LABEL:callIndirect: 26 ; DIS-LABEL:00000000 <_Z8testUdivhh>:
27 ; IASM-LABEL:_Z8testUdivhh:
27 28
28 entry: 29 entry:
29 ; ASM-NEXT:.LcallIndirect$entry: 30
30 ; IASM-NEXT:.LcallIndirect$entry: 31 ; ASM-NEXT:.L_Z8testUdivhh$entry:
31 ; ASM-NEXT: push {lr} 32 ; ASM-NEXT: push {lr}
32 ; DIS-NEXT: 0: e52de004 33 ; DIS-NEXT: 0: e52de004
34 ; IASM-NEXT:.L_Z8testUdivhh$entry:
33 ; IASM-NEXT: .byte 0x4 35 ; IASM-NEXT: .byte 0x4
34 ; IASM-NEXT: .byte 0xe0 36 ; IASM-NEXT: .byte 0xe0
35 ; IASM-NEXT: .byte 0x2d 37 ; IASM-NEXT: .byte 0x2d
36 ; IASM-NEXT: .byte 0xe5 38 ; IASM-NEXT: .byte 0xe5
37 39
40 %b.arg_trunc = trunc i32 %b to i8
41 %a.arg_trunc = trunc i32 %a to i8
42 %div3 = udiv i8 %a.arg_trunc, %b.arg_trunc
43
38 ; ASM-NEXT: sub sp, sp, #12 44 ; ASM-NEXT: sub sp, sp, #12
39 ; DIS-NEXT: 4: e24dd00c 45 ; DIS-NEXT: 4: e24dd00c
40 ; IASM-NEXT: .byte 0xc 46 ; IASM-NEXT: .byte 0xc
41 ; IASM-NEXT: .byte 0xd0 47 ; IASM-NEXT: .byte 0xd0
42 ; IASM-NEXT: .byte 0x4d 48 ; IASM-NEXT: .byte 0x4d
43 ; IASM-NEXT: .byte 0xe2 49 ; IASM-NEXT: .byte 0xe2
44 50
45 %calladdr = inttoptr i32 %addr to void (i32)* 51 ; ASM-NEXT: lsls r2, r1, #24
52 ; DIS-NEXT: 8: e1b02c01
53 ; IASM-NEXT: .byte 0x1
54 ; IASM-NEXT: .byte 0x2c
55 ; IASM-NEXT: .byte 0xb0
56 ; IASM-NEXT: .byte 0xe1
46 57
47 ; ASM-NEXT: mov r1, r0 58 %div3.ret_ext = zext i8 %div3 to i32
48 ; DIS-NEXT: 8: e1a01000 59 ret i32 %div3.ret_ext
49 ; IASM-NEXT: .byte 0x0 60 }
61
62 define internal i32 @_Z7testShljj(i32 %a, i32 %b) {
63
64 ; ASM-LABEL:_Z7testShljj:
65 ; DIS-LABEL:00000030 <_Z7testShljj>:
66 ; IASM-LABEL:_Z7testShljj:
67
68 entry:
69
70 ; ASM-NEXT:.L_Z7testShljj$entry:
71 ; IASM-NEXT:.L_Z7testShljj$entry:
72
73 %shl = shl i32 %a, %b
74
75 ; ASM-NEXT: lsl r0, r0, r1
76 ; DIS-NEXT: 30: e1a00110
50 ; IASM-NEXT: .byte 0x10 77 ; IASM-NEXT: .byte 0x10
78 ; IASM-NEXT: .byte 0x1
51 ; IASM-NEXT: .byte 0xa0 79 ; IASM-NEXT: .byte 0xa0
52 ; IASM-NEXT: .byte 0xe1 80 ; IASM-NEXT: .byte 0xe1
53 81
54 call void %calladdr(i32 %addr) 82 ret i32 %shl
55
56 ; ASM-NEXT: blx r1
57 ; DIS-NEXT: c: e12fff31
58 ; IASM-NEXT: .byte 0x31
59 ; IASM-NEXT: .byte 0xff
60 ; IASM-NEXT: .byte 0x2f
61 ; IASM-NEXT: .byte 0xe1
62
63 ret void
64 } 83 }
OLDNEW
« src/IceAssemblerARM32.cpp ('K') | « src/IceInstARM32.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698