OLD | NEW |
1 ; This tries to be a comprehensive test of i8 operations. | 1 ; This tries to be a comprehensive test of i8 operations. |
2 | 2 |
3 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -O2 | FileCheck %s | 3 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -O2 | FileCheck %s |
4 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -Om1 | FileCheck %s | 4 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -Om1 | FileCheck %s |
5 | 5 |
| 6 declare void @useInt(i32 %x) |
| 7 |
6 define internal i32 @add8Bit(i32 %a, i32 %b) { | 8 define internal i32 @add8Bit(i32 %a, i32 %b) { |
7 entry: | 9 entry: |
8 %a_8 = trunc i32 %a to i8 | 10 %a_8 = trunc i32 %a to i8 |
9 %b_8 = trunc i32 %b to i8 | 11 %b_8 = trunc i32 %b to i8 |
10 %add = add i8 %b_8, %a_8 | 12 %add = add i8 %b_8, %a_8 |
11 %ret = zext i8 %add to i32 | 13 %ret = zext i8 %add to i32 |
12 ret i32 %ret | 14 ret i32 %ret |
13 } | 15 } |
14 ; CHECK-LABEL: add8Bit | 16 ; CHECK-LABEL: add8Bit |
15 ; CHECK: add {{[abcd]l}} | 17 ; CHECK: add {{[abcd]l}} |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 ; CHECK-LABEL: icmp8BitMemSwapped | 273 ; CHECK-LABEL: icmp8BitMemSwapped |
272 ; CHECK: cmp {{[abcd]l|BYTE PTR}} | 274 ; CHECK: cmp {{[abcd]l|BYTE PTR}} |
273 | 275 |
274 define internal i32 @selectI8Var(i32 %a, i32 %b) { | 276 define internal i32 @selectI8Var(i32 %a, i32 %b) { |
275 entry: | 277 entry: |
276 %a_8 = trunc i32 %a to i8 | 278 %a_8 = trunc i32 %a to i8 |
277 %b_8 = trunc i32 %b to i8 | 279 %b_8 = trunc i32 %b to i8 |
278 %cmp = icmp slt i8 %a_8, %b_8 | 280 %cmp = icmp slt i8 %a_8, %b_8 |
279 %ret = select i1 %cmp, i8 %a_8, i8 %b_8 | 281 %ret = select i1 %cmp, i8 %a_8, i8 %b_8 |
280 %ret_ext = zext i8 %ret to i32 | 282 %ret_ext = zext i8 %ret to i32 |
| 283 ; Create a "fake" use of %cmp to prevent O2 bool folding. |
| 284 %d1 = zext i1 %cmp to i32 |
| 285 call void @useInt(i32 %d1) |
281 ret i32 %ret_ext | 286 ret i32 %ret_ext |
282 } | 287 } |
283 ; CHECK-LABEL: selectI8Var | 288 ; CHECK-LABEL: selectI8Var |
284 ; CHECK: cmp | 289 ; CHECK: cmp |
285 ; CHECK: setl | 290 ; CHECK: setl |
286 ; CHECK: mov {{[a-d]l}} | 291 ; CHECK: mov {{[a-d]l}} |
287 | 292 |
288 define internal i32 @testPhi8(i32 %arg, i32 %arg2, i32 %arg3, i32 %arg4, i32 %ar
g5, i32 %arg6, i32 %arg7, i32 %arg8, i32 %arg9, i32 %arg10) { | 293 define internal i32 @testPhi8(i32 %arg, i32 %arg2, i32 %arg3, i32 %arg4, i32 %ar
g5, i32 %arg6, i32 %arg7, i32 %arg8, i32 %arg9, i32 %arg10) { |
289 entry: | 294 entry: |
290 %trunc = trunc i32 %arg to i8 | 295 %trunc = trunc i32 %arg to i8 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 ; CHECK: mov BYTE PTR {{.*}},{{[a-d]l}} | 362 ; CHECK: mov BYTE PTR {{.*}},{{[a-d]l}} |
358 | 363 |
359 define void @store_i8_const(i32 %addr_arg) { | 364 define void @store_i8_const(i32 %addr_arg) { |
360 entry: | 365 entry: |
361 %addr = inttoptr i32 %addr_arg to i8* | 366 %addr = inttoptr i32 %addr_arg to i8* |
362 store i8 123, i8* %addr, align 1 | 367 store i8 123, i8* %addr, align 1 |
363 ret void | 368 ret void |
364 } | 369 } |
365 ; CHECK-LABEL: store_i8_const | 370 ; CHECK-LABEL: store_i8_const |
366 ; CHECK: mov BYTE PTR {{.*}},0x7b | 371 ; CHECK: mov BYTE PTR {{.*}},0x7b |
OLD | NEW |