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

Side by Side Diff: tests_lit/llvm2ice_tests/arith.ll

Issue 1210073017: Subzero: Avoid unused insts for ARM Om1 lowering for arithmetic (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: change break to return where useful to make it obvious Created 5 years, 5 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
OLDNEW
1 ; Assembly test for simple arithmetic operations. 1 ; Assembly test for simple arithmetic operations.
2 2
3 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \ 3 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \
4 ; RUN: --target x8632 -i %s --args -O2 \ 4 ; RUN: --target x8632 -i %s --args -O2 \
5 ; RUN: | %if --need=target_X8632 --command FileCheck %s 5 ; RUN: | %if --need=target_X8632 --command FileCheck %s
6 6
7 ; TODO(jvoung): Stop skipping unimplemented parts (via --skip-unimplemented) 7 ; TODO(jvoung): Stop skipping unimplemented parts (via --skip-unimplemented)
8 ; once enough infrastructure is in. Also, switch to --filetype=obj 8 ; once enough infrastructure is in. Also, switch to --filetype=obj
9 ; when possible. 9 ; when possible.
10 ; RUN: %if --need=target_ARM32 --need=allow_dump \ 10 ; RUN: %if --need=target_ARM32 --need=allow_dump \
11 ; RUN: --command %p2i --filetype=asm --assemble --disassemble --target arm32 \ 11 ; RUN: --command %p2i --filetype=asm --assemble --disassemble --target arm32 \
12 ; RUN: -i %s --args -O2 --skip-unimplemented \ 12 ; RUN: -i %s --args -O2 --skip-unimplemented \
13 ; RUN: | %if --need=target_ARM32 --need=allow_dump \ 13 ; RUN: | %if --need=target_ARM32 --need=allow_dump \
14 ; RUN: --command FileCheck --check-prefix ARM32 %s 14 ; RUN: --command FileCheck --check-prefix ARM32 %s
15 ; RUN: %if --need=target_ARM32 --need=allow_dump \ 15 ; RUN: %if --need=target_ARM32 --need=allow_dump \
16 ; RUN: --command %p2i --filetype=asm --assemble --disassemble --target arm32 \ 16 ; RUN: --command %p2i --filetype=asm --assemble --disassemble --target arm32 \
17 ; RUN: -i %s --args -O2 --mattr=hwdiv-arm --skip-unimplemented \ 17 ; RUN: -i %s --args -O2 --mattr=hwdiv-arm --skip-unimplemented \
18 ; RUN: | %if --need=target_ARM32 --need=allow_dump \ 18 ; RUN: | %if --need=target_ARM32 --need=allow_dump \
19 ; RUN: --command FileCheck --check-prefix ARM32HWDIV %s 19 ; RUN: --command FileCheck --check-prefix ARM32HWDIV %s
20 ; RUN: %if --need=target_ARM32 --need=allow_dump \
21 ; RUN: --command %p2i --filetype=asm --assemble --disassemble --target arm32 \
22 ; RUN: -i %s --args -Om1 --skip-unimplemented \
23 ; RUN: | %if --need=target_ARM32 --need=allow_dump \
24 ; RUN: --command FileCheck --check-prefix ARM32 %s
20 25
21 define i32 @Add(i32 %a, i32 %b) { 26 define i32 @Add(i32 %a, i32 %b) {
22 entry: 27 entry:
23 %add = add i32 %b, %a 28 %add = add i32 %b, %a
24 ret i32 %add 29 ret i32 %add
25 } 30 }
26 ; CHECK-LABEL: Add 31 ; CHECK-LABEL: Add
27 ; CHECK: add e 32 ; CHECK: add e
28 ; ARM32-LABEL: Add 33 ; ARM32-LABEL: Add
29 ; ARM32: add r 34 ; ARM32: add r
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 } 105 }
101 ; NOTE: the lowering is currently a bit inefficient for small 64-bit constants. 106 ; NOTE: the lowering is currently a bit inefficient for small 64-bit constants.
102 ; The top bits of the immediate are 0, but the instructions modeling that 107 ; The top bits of the immediate are 0, but the instructions modeling that
103 ; multiply by 0 are not eliminated (see expanded 64-bit ARM lowering). 108 ; multiply by 0 are not eliminated (see expanded 64-bit ARM lowering).
104 ; CHECK-LABEL: MulImm64 109 ; CHECK-LABEL: MulImm64
105 ; CHECK: mov {{.*}},0x63 110 ; CHECK: mov {{.*}},0x63
106 ; CHECK: mov {{.*}},0x0 111 ; CHECK: mov {{.*}},0x0
107 ; CHECK-NOT: mul {{[0-9]+}} 112 ; CHECK-NOT: mul {{[0-9]+}}
108 ; 113 ;
109 ; ARM32-LABEL: MulImm64 114 ; ARM32-LABEL: MulImm64
110 ; ARM32: mov {{.*}}, #99 115 ; ARM32: movw {{.*}}, #99
111 ; ARM32: mov {{.*}}, #0 116 ; ARM32: movw {{.*}}, #0
112 ; ARM32: mul r 117 ; ARM32: mul r
113 ; ARM32: mla r 118 ; ARM32: mla r
114 ; ARM32: umull r 119 ; ARM32: umull r
115 ; ARM32: add r 120 ; ARM32: add r
116 121
117 define i32 @Sdiv(i32 %a, i32 %b) { 122 define i32 @Sdiv(i32 %a, i32 %b) {
118 entry: 123 entry:
119 %div = sdiv i32 %a, %b 124 %div = sdiv i32 %a, %b
120 ret i32 %div 125 ret i32 %div
121 } 126 }
122 ; CHECK-LABEL: Sdiv 127 ; CHECK-LABEL: Sdiv
123 ; CHECK: cdq 128 ; CHECK: cdq
124 ; CHECK: idiv e 129 ; CHECK: idiv e
125 ; 130 ;
126 ; ARM32-LABEL: Sdiv 131 ; ARM32-LABEL: Sdiv
127 ; ARM32: tst [[DENOM:r.*]], [[DENOM]] 132 ; ARM32: tst [[DENOM:r.*]], [[DENOM]]
128 ; ARM32: bne [[LABEL:[0-9a-f]+]] 133 ; ARM32: bne
129 ; ARM32: .word 0xe7fedef0 134 ; ARM32: .word 0xe7fedef0
130 ; ARM32: [[LABEL]]: {{.*}} bl {{.*}} __divsi3 135 ; ARM32: {{.*}} bl {{.*}} __divsi3
131 ; ARM32HWDIV-LABEL: Sdiv 136 ; ARM32HWDIV-LABEL: Sdiv
132 ; ARM32HWDIV: tst 137 ; ARM32HWDIV: tst
133 ; ARM32HWDIV: bne 138 ; ARM32HWDIV: bne
134 ; ARM32HWDIV: sdiv 139 ; ARM32HWDIV: sdiv
135 140
136 define i32 @SdivConst(i32 %a) { 141 define i32 @SdivConst(i32 %a) {
137 entry: 142 entry:
138 %div = sdiv i32 %a, 219 143 %div = sdiv i32 %a, 219
139 ret i32 %div 144 ret i32 %div
140 } 145 }
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 ; 200 ;
196 ; ARM32-LABEL: Urem 201 ; ARM32-LABEL: Urem
197 ; ARM32: tst [[DENOM:r.*]], [[DENOM]] 202 ; ARM32: tst [[DENOM:r.*]], [[DENOM]]
198 ; ARM32: bne 203 ; ARM32: bne
199 ; ARM32: bl {{.*}} __umodsi3 204 ; ARM32: bl {{.*}} __umodsi3
200 ; ARM32HWDIV-LABEL: Urem 205 ; ARM32HWDIV-LABEL: Urem
201 ; ARM32HWDIV: tst 206 ; ARM32HWDIV: tst
202 ; ARM32HWDIV: bne 207 ; ARM32HWDIV: bne
203 ; ARM32HWDIV: udiv 208 ; ARM32HWDIV: udiv
204 ; ARM32HWDIV: mls 209 ; ARM32HWDIV: mls
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698