Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 ; This tries to be a comprehensive test of i64 operations, in | 1 ; This tries to be a comprehensive test of i64 operations, in |
| 2 ; particular the patterns for lowering i64 operations into constituent | 2 ; particular the patterns for lowering i64 operations into constituent |
| 3 ; i32 operations on x86-32. | 3 ; i32 operations on x86-32. |
| 4 | 4 |
| 5 ; TODO(jvoung): fix extra "CALLTARGETS" run. The llvm-objdump symbolizer | 5 ; TODO(jvoung): fix extra "CALLTARGETS" run. The llvm-objdump symbolizer |
| 6 ; doesn't know how to symbolize non-section-local functions. | 6 ; doesn't know how to symbolize non-section-local functions. |
| 7 ; The newer LLVM 3.6 one does work, but watch out for other bugs. | 7 ; The newer LLVM 3.6 one does work, but watch out for other bugs. |
| 8 | 8 |
| 9 ; RUN: %llvm2ice -O2 --verbose none %s \ | 9 ; RUN: %llvm2ice -O2 --verbose none %s \ |
| 10 ; RUN: | FileCheck --check-prefix=CALLTARGETS %s | 10 ; RUN: | FileCheck --check-prefix=CALLTARGETS %s |
| (...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 643 ret i64 %conv | 643 ret i64 %conv |
| 644 } | 644 } |
| 645 ; CHECK-LABEL: sext8To64 | 645 ; CHECK-LABEL: sext8To64 |
| 646 ; CHECK: movsx | 646 ; CHECK: movsx |
| 647 ; CHECK: sar {{.*}}, 31 | 647 ; CHECK: sar {{.*}}, 31 |
| 648 ; | 648 ; |
| 649 ; OPTM1-LABEL: sext8To64 | 649 ; OPTM1-LABEL: sext8To64 |
| 650 ; OPTM1: movsx | 650 ; OPTM1: movsx |
| 651 ; OPTM1: sar {{.*}}, 31 | 651 ; OPTM1: sar {{.*}}, 31 |
| 652 | 652 |
| 653 define internal i64 @sext1To64(i32 %a) { | |
| 654 entry: | |
| 655 %a.arg_trunc = trunc i32 %a to i1 | |
| 656 %conv = sext i1 %a.arg_trunc to i64 | |
| 657 ret i64 %conv | |
| 658 } | |
| 659 ; CHECK-LABEL: sext1To64 | |
| 660 ; CHECK: mov | |
| 661 ; CHECK: shl {{.*}}, 31 | |
| 662 ; CHECK: sar {{.*}}, 31 | |
| 663 ; CHECK: sar {{.*}}, 31 | |
| 664 ; | |
| 665 ; OPTM1-LABEL: sext1To64 | |
| 666 ; OPTM1: mov | |
| 667 ; OPTM1: shl {{.*}}, 31 | |
| 668 ; OPTM1: sar {{.*}}, 31 | |
| 669 ; OPTM1: sar {{.*}}, 31 | |
| 670 | |
| 653 define internal i64 @zext32To64(i32 %a) { | 671 define internal i64 @zext32To64(i32 %a) { |
| 654 entry: | 672 entry: |
| 655 %conv = zext i32 %a to i64 | 673 %conv = zext i32 %a to i64 |
| 656 ret i64 %conv | 674 ret i64 %conv |
| 657 } | 675 } |
| 658 ; CHECK-LABEL: zext32To64 | 676 ; CHECK-LABEL: zext32To64 |
| 659 ; CHECK: mov | 677 ; CHECK: mov |
| 660 ; CHECK: mov {{.*}}, 0 | 678 ; CHECK: mov {{.*}}, 0 |
| 661 ; | 679 ; |
| 662 ; OPTM1-LABEL: zext32To64 | 680 ; OPTM1-LABEL: zext32To64 |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 691 ; OPTM1: movzx | 709 ; OPTM1: movzx |
| 692 ; OPTM1: mov {{.*}}, 0 | 710 ; OPTM1: mov {{.*}}, 0 |
| 693 | 711 |
| 694 define internal i64 @zext1To64(i32 %a) { | 712 define internal i64 @zext1To64(i32 %a) { |
| 695 entry: | 713 entry: |
| 696 %a.arg_trunc = trunc i32 %a to i1 | 714 %a.arg_trunc = trunc i32 %a to i1 |
| 697 %conv = zext i1 %a.arg_trunc to i64 | 715 %conv = zext i1 %a.arg_trunc to i64 |
| 698 ret i64 %conv | 716 ret i64 %conv |
| 699 } | 717 } |
| 700 ; CHECK-LABEL: zext1To64 | 718 ; CHECK-LABEL: zext1To64 |
| 701 ; CHECK: movzx | 719 ; CHECK: and |
|
jvoung (off chromium)
2014/09/04 21:05:41
Could check that the and mask is "1" also -- but t
Jim Stichnoth
2014/09/04 21:43:07
Done.
| |
| 702 ; CHECK: mov {{.*}}, 0 | 720 ; CHECK: mov {{.*}}, 0 |
| 703 ; | 721 ; |
| 704 ; OPTM1-LABEL: zext1To64 | 722 ; OPTM1-LABEL: zext1To64 |
| 705 ; OPTM1: movzx | 723 ; OPTM1: and |
| 706 ; OPTM1: mov {{.*}}, 0 | 724 ; OPTM1: mov {{.*}}, 0 |
| 707 | 725 |
| 708 define internal void @icmpEq64(i64 %a, i64 %b, i64 %c, i64 %d) { | 726 define internal void @icmpEq64(i64 %a, i64 %b, i64 %c, i64 %d) { |
| 709 entry: | 727 entry: |
| 710 %cmp = icmp eq i64 %a, %b | 728 %cmp = icmp eq i64 %a, %b |
| 711 br i1 %cmp, label %if.then, label %if.end | 729 br i1 %cmp, label %if.then, label %if.end |
| 712 | 730 |
| 713 if.then: ; preds = %entry | 731 if.then: ; preds = %entry |
| 714 call void @func() | 732 call void @func() |
| 715 br label %if.end | 733 br label %if.end |
| (...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1293 } | 1311 } |
| 1294 ; The following checks are not strictly necessary since one of the RUN | 1312 ; The following checks are not strictly necessary since one of the RUN |
| 1295 ; lines actually runs the output through the assembler. | 1313 ; lines actually runs the output through the assembler. |
| 1296 ; CHECK-LABEL: icmpLt64Imm | 1314 ; CHECK-LABEL: icmpLt64Imm |
| 1297 ; CHECK-NOT: cmp {{[0-9]+}}, | 1315 ; CHECK-NOT: cmp {{[0-9]+}}, |
| 1298 ; OPTM1-LABEL: icmpLt64Imm | 1316 ; OPTM1-LABEL: icmpLt64Imm |
| 1299 ; OPTM1-NOT: cmp {{[0-9]+}}, | 1317 ; OPTM1-NOT: cmp {{[0-9]+}}, |
| 1300 | 1318 |
| 1301 ; ERRORS-NOT: ICE translation error | 1319 ; ERRORS-NOT: ICE translation error |
| 1302 ; DUMP-NOT: SZ | 1320 ; DUMP-NOT: SZ |
| OLD | NEW |