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

Side by Side Diff: tests_lit/llvm2ice_tests/64bit.pnacl.ll

Issue 2122043002: Subzero, MIPS32: Extend InstMIPS32Mov to support different data types (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Change as suggested by Simon Dardis Created 4 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
« no previous file with comments | « src/IceInstMIPS32.cpp ('k') | tests_lit/llvm2ice_tests/int-arg.ll » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \ 5 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \
6 ; RUN: --target x8632 -i %s --args -O2 -allow-externally-defined-symbols \ 6 ; RUN: --target x8632 -i %s --args -O2 -allow-externally-defined-symbols \
7 ; RUN: | %if --need=target_X8632 --command FileCheck %s 7 ; RUN: | %if --need=target_X8632 --command FileCheck %s
8 8
9 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \ 9 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \
10 ; RUN: --target x8632 -i %s --args -Om1 -allow-externally-defined-symbols \ 10 ; RUN: --target x8632 -i %s --args -Om1 -allow-externally-defined-symbols \
(...skipping 29 matching lines...) Expand all
40 @__fini_array_start = internal constant [0 x i8] zeroinitializer, align 4 40 @__fini_array_start = internal constant [0 x i8] zeroinitializer, align 4
41 @__tls_template_start = internal constant [0 x i8] zeroinitializer, align 8 41 @__tls_template_start = internal constant [0 x i8] zeroinitializer, align 8
42 @__tls_template_alignment = internal constant [4 x i8] c"\01\00\00\00", align 4 42 @__tls_template_alignment = internal constant [4 x i8] c"\01\00\00\00", align 4
43 43
44 define internal i32 @ignore64BitArg(i64 %a, i32 %b, i64 %c) { 44 define internal i32 @ignore64BitArg(i64 %a, i32 %b, i64 %c) {
45 entry: 45 entry:
46 ret i32 %b 46 ret i32 %b
47 } 47 }
48 48
49 ; MIPS32-LABEL: ignore64BitArg 49 ; MIPS32-LABEL: ignore64BitArg
50 ; MIPS32: add v0,zero,a2 50 ; MIPS32: or v0,zero,a2
51 51
52 define internal i32 @pass64BitArg(i64 %a, i64 %b, i64 %c, i64 %d, i64 %e, i64 %f ) { 52 define internal i32 @pass64BitArg(i64 %a, i64 %b, i64 %c, i64 %d, i64 %e, i64 %f ) {
53 entry: 53 entry:
54 %call = call i32 @ignore64BitArgNoInline(i64 %a, i32 123, i64 %b) 54 %call = call i32 @ignore64BitArgNoInline(i64 %a, i32 123, i64 %b)
55 %call1 = call i32 @ignore64BitArgNoInline(i64 %c, i32 123, i64 %d) 55 %call1 = call i32 @ignore64BitArgNoInline(i64 %c, i32 123, i64 %d)
56 %call2 = call i32 @ignore64BitArgNoInline(i64 %e, i32 123, i64 %f) 56 %call2 = call i32 @ignore64BitArgNoInline(i64 %e, i32 123, i64 %f)
57 %add = add i32 %call1, %call 57 %add = add i32 %call1, %call
58 %add3 = add i32 %add, %call2 58 %add3 = add i32 %add, %call2
59 ret i32 %add3 59 ret i32 %add3
60 } 60 }
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 ; OPTM1-LABEL: return64BitArg 196 ; OPTM1-LABEL: return64BitArg
197 ; OPTM1: mov {{.*}},DWORD PTR [esp+0xc] 197 ; OPTM1: mov {{.*}},DWORD PTR [esp+0xc]
198 ; OPTM1: mov {{.*}},DWORD PTR [esp+0x10] 198 ; OPTM1: mov {{.*}},DWORD PTR [esp+0x10]
199 199
200 ; ARM32-LABEL: return64BitArg 200 ; ARM32-LABEL: return64BitArg
201 ; ARM32: mov {{.*}}, r2 201 ; ARM32: mov {{.*}}, r2
202 ; ARM32: mov {{.*}}, r3 202 ; ARM32: mov {{.*}}, r3
203 ; ARM32: bx lr 203 ; ARM32: bx lr
204 204
205 ; MIPS32-LABEL; return64BitArg 205 ; MIPS32-LABEL; return64BitArg
206 ; MIPS32: add v0,zero,a2 206 ; MIPS32: or v0,zero,a2
207 ; MIPS32: add v1,zero,a3 207 ; MIPS32: or v1,zero,a3
208 ; MIPS32: jr ra 208 ; MIPS32: jr ra
209 209
210 define internal i64 @return64BitConst() { 210 define internal i64 @return64BitConst() {
211 entry: 211 entry:
212 ret i64 -2401053092306725256 212 ret i64 -2401053092306725256
213 } 213 }
214 ; CHECK-LABEL: return64BitConst 214 ; CHECK-LABEL: return64BitConst
215 ; CHECK: mov eax,0x12345678 215 ; CHECK: mov eax,0x12345678
216 ; CHECK: mov edx,0xdeadbeef 216 ; CHECK: mov edx,0xdeadbeef
217 ; 217 ;
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after
793 ; CHECK-LABEL: trunc64To32Signed 793 ; CHECK-LABEL: trunc64To32Signed
794 ; CHECK: mov eax,DWORD PTR [esp+0xc] 794 ; CHECK: mov eax,DWORD PTR [esp+0xc]
795 ; 795 ;
796 ; OPTM1-LABEL: trunc64To32Signed 796 ; OPTM1-LABEL: trunc64To32Signed
797 ; OPTM1: mov eax,DWORD PTR [esp+ 797 ; OPTM1: mov eax,DWORD PTR [esp+
798 798
799 ; ARM32-LABEL: trunc64To32Signed 799 ; ARM32-LABEL: trunc64To32Signed
800 ; ARM32: mov r0, r2 800 ; ARM32: mov r0, r2
801 801
802 ; MIPS32-LABEL: trunc64To32Signed 802 ; MIPS32-LABEL: trunc64To32Signed
803 ; MIPS32: add v0,zero,a2 803 ; MIPS32: or v0,zero,a2
804 804
805 define internal i32 @trunc64To16Signed(i64 %a) { 805 define internal i32 @trunc64To16Signed(i64 %a) {
806 entry: 806 entry:
807 %conv = trunc i64 %a to i16 807 %conv = trunc i64 %a to i16
808 %conv.ret_ext = sext i16 %conv to i32 808 %conv.ret_ext = sext i16 %conv to i32
809 ret i32 %conv.ret_ext 809 ret i32 %conv.ret_ext
810 } 810 }
811 ; CHECK-LABEL: trunc64To16Signed 811 ; CHECK-LABEL: trunc64To16Signed
812 ; CHECK: mov eax,DWORD PTR [esp+0x4] 812 ; CHECK: mov eax,DWORD PTR [esp+0x4]
813 ; CHECK-NEXT: movsx eax,ax 813 ; CHECK-NEXT: movsx eax,ax
814 ; 814 ;
815 ; OPTM1-LABEL: trunc64To16Signed 815 ; OPTM1-LABEL: trunc64To16Signed
816 ; OPTM1: mov ax,WORD PTR [esp+ 816 ; OPTM1: mov ax,WORD PTR [esp+
817 ; OPTM1: movsx eax, 817 ; OPTM1: movsx eax,
818 818
819 ; ARM32-LABEL: trunc64To16Signed 819 ; ARM32-LABEL: trunc64To16Signed
820 ; ARM32: sxth r0, r0 820 ; ARM32: sxth r0, r0
821 821
822 ; MIPS32-LABEL: trunc64To16Signed 822 ; MIPS32-LABEL: trunc64To16Signed
823 ; MIPS32: sll a0,a0,0x10 823 ; MIPS32: sll a0,a0,0x10
824 ; MIPS32: sra a0,a0,0x10 824 ; MIPS32: sra a0,a0,0x10
825 ; MIPS32: add v0,zero,a0 825 ; MIPS32: or v0,zero,a0
826 826
827 define internal i32 @trunc64To8Signed(i64 %a) { 827 define internal i32 @trunc64To8Signed(i64 %a) {
828 entry: 828 entry:
829 %conv = trunc i64 %a to i8 829 %conv = trunc i64 %a to i8
830 %conv.ret_ext = sext i8 %conv to i32 830 %conv.ret_ext = sext i8 %conv to i32
831 ret i32 %conv.ret_ext 831 ret i32 %conv.ret_ext
832 } 832 }
833 ; CHECK-LABEL: trunc64To8Signed 833 ; CHECK-LABEL: trunc64To8Signed
834 ; CHECK: mov eax,DWORD PTR [esp+0x4] 834 ; CHECK: mov eax,DWORD PTR [esp+0x4]
835 ; CHECK-NEXT: movsx eax,al 835 ; CHECK-NEXT: movsx eax,al
836 ; 836 ;
837 ; OPTM1-LABEL: trunc64To8Signed 837 ; OPTM1-LABEL: trunc64To8Signed
838 ; OPTM1: mov eax,DWORD PTR [esp+ 838 ; OPTM1: mov eax,DWORD PTR [esp+
839 ; OPTM1: movsx eax, 839 ; OPTM1: movsx eax,
840 840
841 ; ARM32-LABEL: trunc64To8Signed 841 ; ARM32-LABEL: trunc64To8Signed
842 ; ARM32: sxtb r0, r0 842 ; ARM32: sxtb r0, r0
843 843
844 ; MIPS32-LABEL: trunc64To8Signed 844 ; MIPS32-LABEL: trunc64To8Signed
845 ; MIPS32: sll a0,a0,0x18 845 ; MIPS32: sll a0,a0,0x18
846 ; MIPS32: sra a0,a0,0x18 846 ; MIPS32: sra a0,a0,0x18
847 ; MIPS32: add v0,zero,a0 847 ; MIPS32: or v0,zero,a0
848 848
849 define internal i32 @trunc64To32SignedConst() { 849 define internal i32 @trunc64To32SignedConst() {
850 entry: 850 entry:
851 %conv = trunc i64 12345678901234 to i32 851 %conv = trunc i64 12345678901234 to i32
852 ret i32 %conv 852 ret i32 %conv
853 } 853 }
854 ; CHECK-LABEL: trunc64To32SignedConst 854 ; CHECK-LABEL: trunc64To32SignedConst
855 ; CHECK: mov eax,0x73ce2ff2 855 ; CHECK: mov eax,0x73ce2ff2
856 ; 856 ;
857 ; OPTM1-LABEL: trunc64To32SignedConst 857 ; OPTM1-LABEL: trunc64To32SignedConst
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
898 ; CHECK-LABEL: trunc64To32Unsigned 898 ; CHECK-LABEL: trunc64To32Unsigned
899 ; CHECK: mov eax,DWORD PTR [esp+0xc] 899 ; CHECK: mov eax,DWORD PTR [esp+0xc]
900 ; 900 ;
901 ; OPTM1-LABEL: trunc64To32Unsigned 901 ; OPTM1-LABEL: trunc64To32Unsigned
902 ; OPTM1: mov eax,DWORD PTR [esp+ 902 ; OPTM1: mov eax,DWORD PTR [esp+
903 903
904 ; ARM32-LABEL: trunc64To32Unsigned 904 ; ARM32-LABEL: trunc64To32Unsigned
905 ; ARM32: mov r0, r2 905 ; ARM32: mov r0, r2
906 906
907 ; MIPS32-LABEL: trunc64To32Unsigned 907 ; MIPS32-LABEL: trunc64To32Unsigned
908 ; MIPS32: add v0,zero,a2 908 ; MIPS32: or v0,zero,a2
909 909
910 define internal i32 @trunc64To16Unsigned(i64 %a) { 910 define internal i32 @trunc64To16Unsigned(i64 %a) {
911 entry: 911 entry:
912 %conv = trunc i64 %a to i16 912 %conv = trunc i64 %a to i16
913 %conv.ret_ext = zext i16 %conv to i32 913 %conv.ret_ext = zext i16 %conv to i32
914 ret i32 %conv.ret_ext 914 ret i32 %conv.ret_ext
915 } 915 }
916 ; CHECK-LABEL: trunc64To16Unsigned 916 ; CHECK-LABEL: trunc64To16Unsigned
917 ; CHECK: mov eax,DWORD PTR [esp+0x4] 917 ; CHECK: mov eax,DWORD PTR [esp+0x4]
918 ; CHECK-NEXT: movzx eax,ax 918 ; CHECK-NEXT: movzx eax,ax
919 ; 919 ;
920 ; OPTM1-LABEL: trunc64To16Unsigned 920 ; OPTM1-LABEL: trunc64To16Unsigned
921 ; OPTM1: mov ax,WORD PTR [esp+ 921 ; OPTM1: mov ax,WORD PTR [esp+
922 ; OPTM1: movzx eax, 922 ; OPTM1: movzx eax,
923 923
924 ; ARM32-LABEL: trunc64To16Unsigned 924 ; ARM32-LABEL: trunc64To16Unsigned
925 ; ARM32: uxth 925 ; ARM32: uxth
926 926
927 ; MIPS32-LABEL: trunc64To16Unsigned 927 ; MIPS32-LABEL: trunc64To16Unsigned
928 ; MIPS32: andi a0,a0,0xffff 928 ; MIPS32: andi a0,a0,0xffff
929 ; MIPS32: add v0,zero,a0 929 ; MIPS32: or v0,zero,a0
930 930
931 define internal i32 @trunc64To8Unsigned(i64 %a) { 931 define internal i32 @trunc64To8Unsigned(i64 %a) {
932 entry: 932 entry:
933 %conv = trunc i64 %a to i8 933 %conv = trunc i64 %a to i8
934 %conv.ret_ext = zext i8 %conv to i32 934 %conv.ret_ext = zext i8 %conv to i32
935 ret i32 %conv.ret_ext 935 ret i32 %conv.ret_ext
936 } 936 }
937 ; CHECK-LABEL: trunc64To8Unsigned 937 ; CHECK-LABEL: trunc64To8Unsigned
938 ; CHECK: mov eax,DWORD PTR [esp+0x4] 938 ; CHECK: mov eax,DWORD PTR [esp+0x4]
939 ; CHECK-NEXT: movzx eax,al 939 ; CHECK-NEXT: movzx eax,al
940 ; 940 ;
941 ; OPTM1-LABEL: trunc64To8Unsigned 941 ; OPTM1-LABEL: trunc64To8Unsigned
942 ; OPTM1: mov eax,DWORD PTR [esp+ 942 ; OPTM1: mov eax,DWORD PTR [esp+
943 ; OPTM1: movzx eax, 943 ; OPTM1: movzx eax,
944 944
945 ; ARM32-LABEL: trunc64To8Unsigned 945 ; ARM32-LABEL: trunc64To8Unsigned
946 ; ARM32: uxtb 946 ; ARM32: uxtb
947 947
948 ; MIPS32-LABEL: trunc64To8Unsigned 948 ; MIPS32-LABEL: trunc64To8Unsigned
949 ; MIPS32: andi a0,a0,0xff 949 ; MIPS32: andi a0,a0,0xff
950 ; MIPS32: add v0,zero,a0 950 ; MIPS32: or v0,zero,a0
951 951
952 define internal i32 @trunc64To1(i64 %a) { 952 define internal i32 @trunc64To1(i64 %a) {
953 entry: 953 entry:
954 ; %tobool = icmp ne i64 %a, 0 954 ; %tobool = icmp ne i64 %a, 0
955 %tobool = trunc i64 %a to i1 955 %tobool = trunc i64 %a to i1
956 %tobool.ret_ext = zext i1 %tobool to i32 956 %tobool.ret_ext = zext i1 %tobool to i32
957 ret i32 %tobool.ret_ext 957 ret i32 %tobool.ret_ext
958 } 958 }
959 ; CHECK-LABEL: trunc64To1 959 ; CHECK-LABEL: trunc64To1
960 ; CHECK: mov eax,DWORD PTR [esp+0x4] 960 ; CHECK: mov eax,DWORD PTR [esp+0x4]
961 ; CHECK: and al,0x1 961 ; CHECK: and al,0x1
962 ; CHECK-NOT: and eax,0x1 962 ; CHECK-NOT: and eax,0x1
963 ; 963 ;
964 ; OPTM1-LABEL: trunc64To1 964 ; OPTM1-LABEL: trunc64To1
965 ; OPTM1: mov eax,DWORD PTR [esp+ 965 ; OPTM1: mov eax,DWORD PTR [esp+
966 ; OPTM1: and al,0x1 966 ; OPTM1: and al,0x1
967 ; OPTM1-NOT: and eax,0x1 967 ; OPTM1-NOT: and eax,0x1
968 968
969 ; ARM32-LABEL: trunc64To1 969 ; ARM32-LABEL: trunc64To1
970 ; ARM32-OM1: and r0, r0, #1 970 ; ARM32-OM1: and r0, r0, #1
971 ; ARM32-O2: and r0, r0, #1 971 ; ARM32-O2: and r0, r0, #1
972 972
973 ; MIPS32-LABEL: trunc64To1 973 ; MIPS32-LABEL: trunc64To1
974 ; MIPS32: andi {{.*}},a0,0x1 974 ; MIPS32: andi {{.*}},a0,0x1
975 ; MIPS32: add v0,{{.*}} 975 ; MIPS32: or v0,{{.*}}
976 976
977 define internal i64 @sext32To64(i32 %a) { 977 define internal i64 @sext32To64(i32 %a) {
978 entry: 978 entry:
979 %conv = sext i32 %a to i64 979 %conv = sext i32 %a to i64
980 ret i64 %conv 980 ret i64 %conv
981 } 981 }
982 ; CHECK-LABEL: sext32To64 982 ; CHECK-LABEL: sext32To64
983 ; CHECK: mov 983 ; CHECK: mov
984 ; CHECK: sar {{.*}},0x1f 984 ; CHECK: sar {{.*}},0x1f
985 ; 985 ;
986 ; OPTM1-LABEL: sext32To64 986 ; OPTM1-LABEL: sext32To64
987 ; OPTM1: mov 987 ; OPTM1: mov
988 ; OPTM1: sar {{.*}},0x1f 988 ; OPTM1: sar {{.*}},0x1f
989 989
990 ; ARM32-LABEL: sext32To64 990 ; ARM32-LABEL: sext32To64
991 ; ARM32: asr {{.*}}, #31 991 ; ARM32: asr {{.*}}, #31
992 992
993 ; MIPS32-LABEL: sext32To64 993 ; MIPS32-LABEL: sext32To64
994 ; MIPS32-LABEL: sra {{.*}},a0,0x1f 994 ; MIPS32-LABEL: sra {{.*}},a0,0x1f
995 ; MIPS32-LABEL: add v1,{{.*}} 995 ; MIPS32-LABEL: or v1,{{.*}}
996 ; MIPS32-LABEL: add v0,{{.*}} 996 ; MIPS32-LABEL: or v0,{{.*}}
997 997
998 define internal i64 @sext16To64(i32 %a) { 998 define internal i64 @sext16To64(i32 %a) {
999 entry: 999 entry:
1000 %a.arg_trunc = trunc i32 %a to i16 1000 %a.arg_trunc = trunc i32 %a to i16
1001 %conv = sext i16 %a.arg_trunc to i64 1001 %conv = sext i16 %a.arg_trunc to i64
1002 ret i64 %conv 1002 ret i64 %conv
1003 } 1003 }
1004 ; CHECK-LABEL: sext16To64 1004 ; CHECK-LABEL: sext16To64
1005 ; CHECK: movsx 1005 ; CHECK: movsx
1006 ; CHECK: sar {{.*}},0x1f 1006 ; CHECK: sar {{.*}},0x1f
1007 ; 1007 ;
1008 ; OPTM1-LABEL: sext16To64 1008 ; OPTM1-LABEL: sext16To64
1009 ; OPTM1: movsx 1009 ; OPTM1: movsx
1010 ; OPTM1: sar {{.*}},0x1f 1010 ; OPTM1: sar {{.*}},0x1f
1011 1011
1012 ; ARM32-LABEL: sext16To64 1012 ; ARM32-LABEL: sext16To64
1013 ; ARM32: sxth 1013 ; ARM32: sxth
1014 ; ARM32: asr {{.*}}, #31 1014 ; ARM32: asr {{.*}}, #31
1015 1015
1016 ; MIPS32-LABEL: sext16To64 1016 ; MIPS32-LABEL: sext16To64
1017 ; MIPS32: sll {{.*}},{{.*}},0x10 1017 ; MIPS32: sll {{.*}},{{.*}},0x10
1018 ; MIPS32: sra {{.*}},{{.*}},0x10 1018 ; MIPS32: sra {{.*}},{{.*}},0x10
1019 ; MIPS32: sra {{.*}},{{.*}},0x1f 1019 ; MIPS32: sra {{.*}},{{.*}},0x1f
1020 ; MIPS32: add v1,{{.*}} 1020 ; MIPS32: or v1,{{.*}}
1021 ; MIPS32: add v0,{{.*}} 1021 ; MIPS32: or v0,{{.*}}
1022 1022
1023 define internal i64 @sext8To64(i32 %a) { 1023 define internal i64 @sext8To64(i32 %a) {
1024 entry: 1024 entry:
1025 %a.arg_trunc = trunc i32 %a to i8 1025 %a.arg_trunc = trunc i32 %a to i8
1026 %conv = sext i8 %a.arg_trunc to i64 1026 %conv = sext i8 %a.arg_trunc to i64
1027 ret i64 %conv 1027 ret i64 %conv
1028 } 1028 }
1029 ; CHECK-LABEL: sext8To64 1029 ; CHECK-LABEL: sext8To64
1030 ; CHECK: movsx 1030 ; CHECK: movsx
1031 ; CHECK: sar {{.*}},0x1f 1031 ; CHECK: sar {{.*}},0x1f
1032 ; 1032 ;
1033 ; OPTM1-LABEL: sext8To64 1033 ; OPTM1-LABEL: sext8To64
1034 ; OPTM1: movsx 1034 ; OPTM1: movsx
1035 ; OPTM1: sar {{.*}},0x1f 1035 ; OPTM1: sar {{.*}},0x1f
1036 1036
1037 ; ARM32-LABEL: sext8To64 1037 ; ARM32-LABEL: sext8To64
1038 ; ARM32: sxtb 1038 ; ARM32: sxtb
1039 ; ARM32: asr {{.*}}, #31 1039 ; ARM32: asr {{.*}}, #31
1040 1040
1041 ; MIPS32-LABEL: sext8To64 1041 ; MIPS32-LABEL: sext8To64
1042 ; MIPS32: sll {{.*}},a0,0x18 1042 ; MIPS32: sll {{.*}},a0,0x18
1043 ; MIPS32: sra {{.*}},{{.*}},0x18 1043 ; MIPS32: sra {{.*}},{{.*}},0x18
1044 ; MIPS32: sra {{.*}},{{.*}},0x1f 1044 ; MIPS32: sra {{.*}},{{.*}},0x1f
1045 ; MIPS32: add v1,{{.*}} 1045 ; MIPS32: or v1,{{.*}}
1046 ; MIPS32: add v0,{{.*}} 1046 ; MIPS32: or v0,{{.*}}
1047 1047
1048 define internal i64 @sext1To64(i32 %a) { 1048 define internal i64 @sext1To64(i32 %a) {
1049 entry: 1049 entry:
1050 %a.arg_trunc = trunc i32 %a to i1 1050 %a.arg_trunc = trunc i32 %a to i1
1051 %conv = sext i1 %a.arg_trunc to i64 1051 %conv = sext i1 %a.arg_trunc to i64
1052 ret i64 %conv 1052 ret i64 %conv
1053 } 1053 }
1054 ; CHECK-LABEL: sext1To64 1054 ; CHECK-LABEL: sext1To64
1055 ; CHECK: mov 1055 ; CHECK: mov
1056 ; CHECK: shl {{.*}},0x1f 1056 ; CHECK: shl {{.*}},0x1f
1057 ; CHECK: sar {{.*}},0x1f 1057 ; CHECK: sar {{.*}},0x1f
1058 ; 1058 ;
1059 ; OPTM1-LABEL: sext1To64 1059 ; OPTM1-LABEL: sext1To64
1060 ; OPTM1: mov 1060 ; OPTM1: mov
1061 ; OPTM1: shl {{.*}},0x1f 1061 ; OPTM1: shl {{.*}},0x1f
1062 ; OPTM1: sar {{.*}},0x1f 1062 ; OPTM1: sar {{.*}},0x1f
1063 1063
1064 ; ARM32-LABEL: sext1To64 1064 ; ARM32-LABEL: sext1To64
1065 ; ARM32: mov {{.*}}, #0 1065 ; ARM32: mov {{.*}}, #0
1066 ; ARM32: tst {{.*}}, #1 1066 ; ARM32: tst {{.*}}, #1
1067 ; ARM32: mvn {{.*}}, #0 1067 ; ARM32: mvn {{.*}}, #0
1068 ; ARM32: movne 1068 ; ARM32: movne
1069 1069
1070 ; MIPS32-LABEL: sext1To64 1070 ; MIPS32-LABEL: sext1To64
1071 ; MIPS32: sll {{.*}},a0,0x1f 1071 ; MIPS32: sll {{.*}},a0,0x1f
1072 ; MIPS32: sra {{.*}},{{.*}},0x1f 1072 ; MIPS32: sra {{.*}},{{.*}},0x1f
1073 ; MIPS32: add v1,{{.*}} 1073 ; MIPS32: or v1,{{.*}}
1074 ; MIPS32: add v0,{{.*}} 1074 ; MIPS32: or v0,{{.*}}
1075 1075
1076 define internal i64 @zext32To64(i32 %a) { 1076 define internal i64 @zext32To64(i32 %a) {
1077 entry: 1077 entry:
1078 %conv = zext i32 %a to i64 1078 %conv = zext i32 %a to i64
1079 ret i64 %conv 1079 ret i64 %conv
1080 } 1080 }
1081 ; CHECK-LABEL: zext32To64 1081 ; CHECK-LABEL: zext32To64
1082 ; CHECK: mov 1082 ; CHECK: mov
1083 ; CHECK: mov {{.*}},0x0 1083 ; CHECK: mov {{.*}},0x0
1084 ; 1084 ;
1085 ; OPTM1-LABEL: zext32To64 1085 ; OPTM1-LABEL: zext32To64
1086 ; OPTM1: mov 1086 ; OPTM1: mov
1087 ; OPTM1: mov {{.*}},0x0 1087 ; OPTM1: mov {{.*}},0x0
1088 1088
1089 ; ARM32-LABEL: zext32To64 1089 ; ARM32-LABEL: zext32To64
1090 ; ARM32: mov {{.*}}, #0 1090 ; ARM32: mov {{.*}}, #0
1091 1091
1092 ; MIPS32-LABEL: zext32To64 1092 ; MIPS32-LABEL: zext32To64
1093 ; MIPS32: li {{.*}},0 1093 ; MIPS32: li {{.*}},0
1094 ; MIPS32: add v1,{{.*}} 1094 ; MIPS32: or v1,{{.*}}
1095 ; MIPS32: add v0,{{.*}} 1095 ; MIPS32: or v0,{{.*}}
1096 1096
1097 define internal i64 @zext16To64(i32 %a) { 1097 define internal i64 @zext16To64(i32 %a) {
1098 entry: 1098 entry:
1099 %a.arg_trunc = trunc i32 %a to i16 1099 %a.arg_trunc = trunc i32 %a to i16
1100 %conv = zext i16 %a.arg_trunc to i64 1100 %conv = zext i16 %a.arg_trunc to i64
1101 ret i64 %conv 1101 ret i64 %conv
1102 } 1102 }
1103 ; CHECK-LABEL: zext16To64 1103 ; CHECK-LABEL: zext16To64
1104 ; CHECK: movzx 1104 ; CHECK: movzx
1105 ; CHECK: mov {{.*}},0x0 1105 ; CHECK: mov {{.*}},0x0
1106 ; 1106 ;
1107 ; OPTM1-LABEL: zext16To64 1107 ; OPTM1-LABEL: zext16To64
1108 ; OPTM1: movzx 1108 ; OPTM1: movzx
1109 ; OPTM1: mov {{.*}},0x0 1109 ; OPTM1: mov {{.*}},0x0
1110 1110
1111 ; ARM32-LABEL: zext16To64 1111 ; ARM32-LABEL: zext16To64
1112 ; ARM32: uxth 1112 ; ARM32: uxth
1113 ; ARM32: mov {{.*}}, #0 1113 ; ARM32: mov {{.*}}, #0
1114 1114
1115 ; MIPS32-LABEL: zext16To64 1115 ; MIPS32-LABEL: zext16To64
1116 ; MIPS32: andi {{.*}},a0,0xffff 1116 ; MIPS32: andi {{.*}},a0,0xffff
1117 ; MIPS32: li {{.*}},0 1117 ; MIPS32: li {{.*}},0
1118 ; MIPS32: add v1,{{.*}} 1118 ; MIPS32: or v1,{{.*}}
1119 ; MIPS32: add v0,{{.*}} 1119 ; MIPS32: or v0,{{.*}}
1120 1120
1121 define internal i64 @zext8To64(i32 %a) { 1121 define internal i64 @zext8To64(i32 %a) {
1122 entry: 1122 entry:
1123 %a.arg_trunc = trunc i32 %a to i8 1123 %a.arg_trunc = trunc i32 %a to i8
1124 %conv = zext i8 %a.arg_trunc to i64 1124 %conv = zext i8 %a.arg_trunc to i64
1125 ret i64 %conv 1125 ret i64 %conv
1126 } 1126 }
1127 ; CHECK-LABEL: zext8To64 1127 ; CHECK-LABEL: zext8To64
1128 ; CHECK: movzx 1128 ; CHECK: movzx
1129 ; CHECK: mov {{.*}},0x0 1129 ; CHECK: mov {{.*}},0x0
1130 ; 1130 ;
1131 ; OPTM1-LABEL: zext8To64 1131 ; OPTM1-LABEL: zext8To64
1132 ; OPTM1: movzx 1132 ; OPTM1: movzx
1133 ; OPTM1: mov {{.*}},0x0 1133 ; OPTM1: mov {{.*}},0x0
1134 1134
1135 ; ARM32-LABEL: zext8To64 1135 ; ARM32-LABEL: zext8To64
1136 ; ARM32: uxtb 1136 ; ARM32: uxtb
1137 ; ARM32: mov {{.*}}, #0 1137 ; ARM32: mov {{.*}}, #0
1138 1138
1139 ; MIPS32-LABEL: zext8To64 1139 ; MIPS32-LABEL: zext8To64
1140 ; MIPS32: andi {{.*}},a0,0xff 1140 ; MIPS32: andi {{.*}},a0,0xff
1141 ; MIPS32: li {{.*}},0 1141 ; MIPS32: li {{.*}},0
1142 ; MIPS32: add v1,{{.*}} 1142 ; MIPS32: or v1,{{.*}}
1143 ; MIPS32: add v0,{{.*}} 1143 ; MIPS32: or v0,{{.*}}
1144 1144
1145 define internal i64 @zext1To64(i32 %a) { 1145 define internal i64 @zext1To64(i32 %a) {
1146 entry: 1146 entry:
1147 %a.arg_trunc = trunc i32 %a to i1 1147 %a.arg_trunc = trunc i32 %a to i1
1148 %conv = zext i1 %a.arg_trunc to i64 1148 %conv = zext i1 %a.arg_trunc to i64
1149 ret i64 %conv 1149 ret i64 %conv
1150 } 1150 }
1151 ; CHECK-LABEL: zext1To64 1151 ; CHECK-LABEL: zext1To64
1152 ; CHECK: and {{.*}},0x1 1152 ; CHECK: and {{.*}},0x1
1153 ; CHECK: mov {{.*}},0x0 1153 ; CHECK: mov {{.*}},0x0
1154 ; 1154 ;
1155 ; OPTM1-LABEL: zext1To64 1155 ; OPTM1-LABEL: zext1To64
1156 ; OPTM1: and {{.*}},0x1 1156 ; OPTM1: and {{.*}},0x1
1157 ; OPTM1: mov {{.*}},0x0 1157 ; OPTM1: mov {{.*}},0x0
1158 1158
1159 ; ARM32-LABEL: zext1To64 1159 ; ARM32-LABEL: zext1To64
1160 ; ARM32: and {{.*}}, #1 1160 ; ARM32: and {{.*}}, #1
1161 ; ARM32: mov {{.*}}, #0 1161 ; ARM32: mov {{.*}}, #0
1162 ; ARM32: bx 1162 ; ARM32: bx
1163 1163
1164 ; MIPS32-LABEL: zext1To64 1164 ; MIPS32-LABEL: zext1To64
1165 ; MIPS32: andi {{.*}},a0,0x1 1165 ; MIPS32: andi {{.*}},a0,0x1
1166 ; MIPS32: li {{.*}},0 1166 ; MIPS32: li {{.*}},0
1167 ; MIPS32: add v1,{{.*}} 1167 ; MIPS32: or v1,{{.*}}
1168 ; MIPS32: add v0,{{.*}} 1168 ; MIPS32: or v0,{{.*}}
1169 1169
1170 define internal void @icmpEq64(i64 %a, i64 %b, i64 %c, i64 %d) { 1170 define internal void @icmpEq64(i64 %a, i64 %b, i64 %c, i64 %d) {
1171 entry: 1171 entry:
1172 %cmp = icmp eq i64 %a, %b 1172 %cmp = icmp eq i64 %a, %b
1173 br i1 %cmp, label %if.then, label %if.end 1173 br i1 %cmp, label %if.then, label %if.end
1174 1174
1175 if.then: ; preds = %entry 1175 if.then: ; preds = %entry
1176 call void @func() 1176 call void @func()
1177 br label %if.end 1177 br label %if.end
1178 1178
(...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after
2059 %s = lshr i64 %a, 40 2059 %s = lshr i64 %a, 40
2060 %t = trunc i64 %s to i32 2060 %t = trunc i64 %s to i32
2061 %r = sub i32 %t, 1 2061 %r = sub i32 %t, 1
2062 ret i32 %r 2062 ret i32 %r
2063 ; ARM32-LABEL: subOneToUpperAfterShift 2063 ; ARM32-LABEL: subOneToUpperAfterShift
2064 ; ARM32: subs 2064 ; ARM32: subs
2065 ; ARM32: sbc 2065 ; ARM32: sbc
2066 ; ARM32: lsr 2066 ; ARM32: lsr
2067 ; ARM32: sub 2067 ; ARM32: sub
2068 } 2068 }
OLDNEW
« no previous file with comments | « src/IceInstMIPS32.cpp ('k') | tests_lit/llvm2ice_tests/int-arg.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698