llvm.org GIT mirror llvm / e8e72be
Convert some ARM tests with lots of greps to use FileCheck. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83651 91177308-0d34-0410-b5e6-96231b3b80d8 Bob Wilson 10 years ago
5 changed file(s) with 135 addition(s) and 58 deletion(s). Raw diff Collapse all Expand all
None ; RUN: llc < %s -march=arm -mattr=+vfp2 > %t
1 ; RUN: grep fmsr %t | count 4
2 ; RUN: grep fsitos %t
3 ; RUN: grep fmrs %t | count 2
4 ; RUN: grep fsitod %t
5 ; RUN: grep fmrrd %t | count 3
6 ; RUN: not grep fmdrr %t
7 ; RUN: grep fldd %t
8 ; RUN: grep fuitod %t
9 ; RUN: grep fuitos %t
10 ; RUN: grep 1065353216 %t
0 ; RUN: llc < %s -march=arm -mattr=+vfp2 | FileCheck %s
111
122 define float @f(i32 %a) {
3 ;CHECK: f:
4 ;CHECK: fmsr
5 ;CHECK-NEXT: fsitos
6 ;CHECK-NEXT: fmrs
137 entry:
148 %tmp = sitofp i32 %a to float ; [#uses=1]
159 ret float %tmp
1610 }
1711
1812 define double @g(i32 %a) {
13 ;CHECK: g:
14 ;CHECK: fmsr
15 ;CHECK-NEXT: fsitod
16 ;CHECK-NEXT: fmrrd
1917 entry:
2018 %tmp = sitofp i32 %a to double ; [#uses=1]
2119 ret double %tmp
2220 }
2321
2422 define double @uint_to_double(i32 %a) {
23 ;CHECK: uint_to_double:
24 ;CHECK: fmsr
25 ;CHECK-NEXT: fuitod
26 ;CHECK-NEXT: fmrrd
2527 entry:
2628 %tmp = uitofp i32 %a to double ; [#uses=1]
2729 ret double %tmp
2830 }
2931
3032 define float @uint_to_float(i32 %a) {
33 ;CHECK: uint_to_float:
34 ;CHECK: fmsr
35 ;CHECK-NEXT: fuitos
36 ;CHECK-NEXT: fmrs
3137 entry:
3238 %tmp = uitofp i32 %a to float ; [#uses=1]
3339 ret float %tmp
3440 }
3541
3642 define double @h(double* %v) {
43 ;CHECK: h:
44 ;CHECK: fldd
45 ;CHECK-NEXT: fmrrd
3746 entry:
3847 %tmp = load double* %v ; [#uses=1]
3948 ret double %tmp
4049 }
4150
4251 define float @h2() {
52 ;CHECK: h2:
53 ;CHECK: 1065353216
4354 entry:
4455 ret float 1.000000e+00
4556 }
4657
4758 define double @f2(double %a) {
59 ;CHECK: f2:
60 ;CHECK-NOT: fmdrr
4861 ret double %a
4962 }
5063
5164 define void @f3() {
65 ;CHECK: f3:
66 ;CHECK-NOT: fmdrr
67 ;CHECK: f4
5268 entry:
5369 %tmp = call double @f5( ) ; [#uses=1]
5470 call void @f4( double %tmp )
None ; RUN: llc < %s -march=arm -mattr=+vfp2 > %t
1 ; RUN: grep fadds %t
2 ; RUN: grep faddd %t
3 ; RUN: grep fmuls %t
4 ; RUN: grep fmuld %t
5 ; RUN: grep eor %t
6 ; RUN: grep fnegd %t
7 ; RUN: grep fdivs %t
8 ; RUN: grep fdivd %t
0 ; RUN: llc < %s -march=arm -mattr=+vfp2 | FileCheck %s
91
102 define float @f1(float %a, float %b) {
3 ;CHECK: f1:
4 ;CHECK: fadds
115 entry:
126 %tmp = fadd float %a, %b ; [#uses=1]
137 ret float %tmp
148 }
159
1610 define double @f2(double %a, double %b) {
11 ;CHECK: f2:
12 ;CHECK: faddd
1713 entry:
1814 %tmp = fadd double %a, %b ; [#uses=1]
1915 ret double %tmp
2016 }
2117
2218 define float @f3(float %a, float %b) {
19 ;CHECK: f3:
20 ;CHECK: fmuls
2321 entry:
2422 %tmp = fmul float %a, %b ; [#uses=1]
2523 ret float %tmp
2624 }
2725
2826 define double @f4(double %a, double %b) {
27 ;CHECK: f4:
28 ;CHECK: fmuld
2929 entry:
3030 %tmp = fmul double %a, %b ; [#uses=1]
3131 ret double %tmp
3232 }
3333
3434 define float @f5(float %a, float %b) {
35 ;CHECK: f5:
36 ;CHECK: fsubs
3537 entry:
3638 %tmp = fsub float %a, %b ; [#uses=1]
3739 ret float %tmp
3840 }
3941
4042 define double @f6(double %a, double %b) {
43 ;CHECK: f6:
44 ;CHECK: fsubd
4145 entry:
4246 %tmp = fsub double %a, %b ; [#uses=1]
4347 ret double %tmp
4448 }
4549
4650 define float @f7(float %a) {
51 ;CHECK: f7:
52 ;CHECK: eor
4753 entry:
4854 %tmp1 = fsub float -0.000000e+00, %a ; [#uses=1]
4955 ret float %tmp1
5056 }
5157
5258 define double @f8(double %a) {
59 ;CHECK: f8:
60 ;CHECK: fnegd
5361 entry:
5462 %tmp1 = fsub double -0.000000e+00, %a ; [#uses=1]
5563 ret double %tmp1
5664 }
5765
5866 define float @f9(float %a, float %b) {
67 ;CHECK: f9:
68 ;CHECK: fdivs
5969 entry:
6070 %tmp1 = fdiv float %a, %b ; [#uses=1]
6171 ret float %tmp1
6272 }
6373
6474 define double @f10(double %a, double %b) {
75 ;CHECK: f10:
76 ;CHECK: fdivd
6577 entry:
6678 %tmp1 = fdiv double %a, %b ; [#uses=1]
6779 ret double %tmp1
6880 }
6981
7082 define float @f11(float %a) {
83 ;CHECK: f11:
84 ;CHECK: bic
7185 entry:
7286 %tmp1 = call float @fabsf( float %a ) ; [#uses=1]
7387 ret float %tmp1
7690 declare float @fabsf(float)
7791
7892 define double @f12(double %a) {
93 ;CHECK: f12:
94 ;CHECK: fabsd
7995 entry:
8096 %tmp1 = call double @fabs( double %a ) ; [#uses=1]
8197 ret double %tmp1
None ; RUN: llc < %s -march=arm -mattr=+vfp2 > %t
1 ; RUN: grep movmi %t
2 ; RUN: grep moveq %t
3 ; RUN: grep movgt %t
4 ; RUN: grep movge %t
5 ; RUN: grep movne %t
6 ; RUN: grep fcmped %t | count 1
7 ; RUN: grep fcmpes %t | count 6
0 ; RUN: llc < %s -march=arm -mattr=+vfp2 | FileCheck %s
81
92 define i32 @f1(float %a) {
3 ;CHECK: f1:
4 ;CHECK: fcmpes
5 ;CHECK: movmi
106 entry:
117 %tmp = fcmp olt float %a, 1.000000e+00 ; [#uses=1]
128 %tmp1 = zext i1 %tmp to i32 ; [#uses=1]
1410 }
1511
1612 define i32 @f2(float %a) {
13 ;CHECK: f2:
14 ;CHECK: fcmpes
15 ;CHECK: moveq
1716 entry:
1817 %tmp = fcmp oeq float %a, 1.000000e+00 ; [#uses=1]
1918 %tmp2 = zext i1 %tmp to i32 ; [#uses=1]
2120 }
2221
2322 define i32 @f3(float %a) {
23 ;CHECK: f3:
24 ;CHECK: fcmpes
25 ;CHECK: movgt
2426 entry:
2527 %tmp = fcmp ogt float %a, 1.000000e+00 ; [#uses=1]
2628 %tmp3 = zext i1 %tmp to i32 ; [#uses=1]
2830 }
2931
3032 define i32 @f4(float %a) {
33 ;CHECK: f4:
34 ;CHECK: fcmpes
35 ;CHECK: movge
3136 entry:
3237 %tmp = fcmp oge float %a, 1.000000e+00 ; [#uses=1]
3338 %tmp4 = zext i1 %tmp to i32 ; [#uses=1]
3540 }
3641
3742 define i32 @f5(float %a) {
43 ;CHECK: f5:
44 ;CHECK: fcmpes
45 ;CHECK: movls
3846 entry:
3947 %tmp = fcmp ole float %a, 1.000000e+00 ; [#uses=1]
4048 %tmp5 = zext i1 %tmp to i32 ; [#uses=1]
4250 }
4351
4452 define i32 @f6(float %a) {
53 ;CHECK: f6:
54 ;CHECK: fcmpes
55 ;CHECK: movne
4556 entry:
4657 %tmp = fcmp une float %a, 1.000000e+00 ; [#uses=1]
4758 %tmp6 = zext i1 %tmp to i32 ; [#uses=1]
4960 }
5061
5162 define i32 @g1(double %a) {
63 ;CHECK: g1:
64 ;CHECK: fcmped
65 ;CHECK: movmi
5266 entry:
5367 %tmp = fcmp olt double %a, 1.000000e+00 ; [#uses=1]
5468 %tmp7 = zext i1 %tmp to i32 ; [#uses=1]
None ; RUN: llc < %s -march=arm -mattr=+vfp2 > %t
1 ; RUN: grep fcvtsd %t
2 ; RUN: grep fcvtds %t
3 ; RUN: grep ftosizs %t
4 ; RUN: grep ftouizs %t
5 ; RUN: grep ftosizd %t
6 ; RUN: grep ftouizd %t
7 ; RUN: grep fsitos %t
8 ; RUN: grep fsitod %t
9 ; RUN: grep fuitos %t
10 ; RUN: grep fuitod %t
11 ; RUN: llc < %s -march=arm > %t
12 ; RUN: grep truncdfsf2 %t
13 ; RUN: grep extendsfdf2 %t
14 ; RUN: grep fixsfsi %t
15 ; RUN: grep fixunssfsi %t
16 ; RUN: grep fixdfsi %t
17 ; RUN: grep fixunsdfsi %t
18 ; RUN: grep floatsisf %t
19 ; RUN: grep floatsidf %t
20 ; RUN: grep floatunsisf %t
21 ; RUN: grep floatunsidf %t
0 ; RUN: llc < %s -march=arm -mattr=+vfp2 | FileCheck %s --check-prefix=CHECK-VFP
1 ; RUN: llc < %s -march=arm | FileCheck %s
222
233 define float @f1(double %x) {
4 ;CHECK-VFP: f1:
5 ;CHECK-VFP: fcvtsd
6 ;CHECK: f1:
7 ;CHECK: truncdfsf2
248 entry:
259 %tmp1 = fptrunc double %x to float ; [#uses=1]
2610 ret float %tmp1
2711 }
2812
2913 define double @f2(float %x) {
14 ;CHECK-VFP: f2:
15 ;CHECK-VFP: fcvtds
16 ;CHECK: f2:
17 ;CHECK: extendsfdf2
3018 entry:
3119 %tmp1 = fpext float %x to double ; [#uses=1]
3220 ret double %tmp1
3321 }
3422
3523 define i32 @f3(float %x) {
24 ;CHECK-VFP: f3:
25 ;CHECK-VFP: ftosizs
26 ;CHECK: f3:
27 ;CHECK: fixsfsi
3628 entry:
3729 %tmp = fptosi float %x to i32 ; [#uses=1]
3830 ret i32 %tmp
3931 }
4032
4133 define i32 @f4(float %x) {
34 ;CHECK-VFP: f4:
35 ;CHECK-VFP: ftouizs
36 ;CHECK: f4:
37 ;CHECK: fixunssfsi
4238 entry:
4339 %tmp = fptoui float %x to i32 ; [#uses=1]
4440 ret i32 %tmp
4541 }
4642
4743 define i32 @f5(double %x) {
44 ;CHECK-VFP: f5:
45 ;CHECK-VFP: ftosizd
46 ;CHECK: f5:
47 ;CHECK: fixdfsi
4848 entry:
4949 %tmp = fptosi double %x to i32 ; [#uses=1]
5050 ret i32 %tmp
5151 }
5252
5353 define i32 @f6(double %x) {
54 ;CHECK-VFP: f6:
55 ;CHECK-VFP: ftouizd
56 ;CHECK: f6:
57 ;CHECK: fixunsdfsi
5458 entry:
5559 %tmp = fptoui double %x to i32 ; [#uses=1]
5660 ret i32 %tmp
5761 }
5862
5963 define float @f7(i32 %a) {
64 ;CHECK-VFP: f7:
65 ;CHECK-VFP: fsitos
66 ;CHECK: f7:
67 ;CHECK: floatsisf
6068 entry:
6169 %tmp = sitofp i32 %a to float ; [#uses=1]
6270 ret float %tmp
6371 }
6472
6573 define double @f8(i32 %a) {
74 ;CHECK-VFP: f8:
75 ;CHECK-VFP: fsitod
76 ;CHECK: f8:
77 ;CHECK: floatsidf
6678 entry:
6779 %tmp = sitofp i32 %a to double ; [#uses=1]
6880 ret double %tmp
6981 }
7082
7183 define float @f9(i32 %a) {
84 ;CHECK-VFP: f9:
85 ;CHECK-VFP: fuitos
86 ;CHECK: f9:
87 ;CHECK: floatunsisf
7288 entry:
7389 %tmp = uitofp i32 %a to float ; [#uses=1]
7490 ret float %tmp
7591 }
7692
7793 define double @f10(i32 %a) {
94 ;CHECK-VFP: f10:
95 ;CHECK-VFP: fuitod
96 ;CHECK: f10:
97 ;CHECK: floatunsidf
7898 entry:
7999 %tmp = uitofp i32 %a to double ; [#uses=1]
80100 ret double %tmp
None ; RUN: llc < %s -march=arm | grep moveq | count 1
1 ; RUN: llc < %s -march=arm | grep movgt | count 1
2 ; RUN: llc < %s -march=arm | grep movlt | count 3
3 ; RUN: llc < %s -march=arm | grep movle | count 1
4 ; RUN: llc < %s -march=arm | grep movls | count 1
5 ; RUN: llc < %s -march=arm | grep movhi | count 1
6 ; RUN: llc < %s -march=arm -mattr=+vfp2 | \
7 ; RUN: grep fcpydmi | count 1
0 ; RUN: llc < %s -march=arm | FileCheck %s
1 ; RUN: llc < %s -march=arm -mattr=+vfp2 | FileCheck %s --check-prefix=CHECK-VFP
82
93 define i32 @f1(i32 %a.s) {
4 ;CHECK: f1:
5 ;CHECK: moveq
106 entry:
117 %tmp = icmp eq i32 %a.s, 4
128 %tmp1.s = select i1 %tmp, i32 2, i32 3
1410 }
1511
1612 define i32 @f2(i32 %a.s) {
13 ;CHECK: f2:
14 ;CHECK: movgt
1715 entry:
1816 %tmp = icmp sgt i32 %a.s, 4
1917 %tmp1.s = select i1 %tmp, i32 2, i32 3
2119 }
2220
2321 define i32 @f3(i32 %a.s, i32 %b.s) {
22 ;CHECK: f3:
23 ;CHECK: movlt
2424 entry:
2525 %tmp = icmp slt i32 %a.s, %b.s
2626 %tmp1.s = select i1 %tmp, i32 2, i32 3
2828 }
2929
3030 define i32 @f4(i32 %a.s, i32 %b.s) {
31 ;CHECK: f4:
32 ;CHECK: movle
3133 entry:
3234 %tmp = icmp sle i32 %a.s, %b.s
3335 %tmp1.s = select i1 %tmp, i32 2, i32 3
3537 }
3638
3739 define i32 @f5(i32 %a.u, i32 %b.u) {
40 ;CHECK: f5:
41 ;CHECK: movls
3842 entry:
3943 %tmp = icmp ule i32 %a.u, %b.u
4044 %tmp1.s = select i1 %tmp, i32 2, i32 3
4246 }
4347
4448 define i32 @f6(i32 %a.u, i32 %b.u) {
49 ;CHECK: f6:
50 ;CHECK: movhi
4551 entry:
4652 %tmp = icmp ugt i32 %a.u, %b.u
4753 %tmp1.s = select i1 %tmp, i32 2, i32 3
4955 }
5056
5157 define double @f7(double %a, double %b) {
58 ;CHECK: f7:
59 ;CHECK: movlt
60 ;CHECK: movlt
61 ;CHECK-VFP: f7:
62 ;CHECK-VFP: fcpydmi
5263 %tmp = fcmp olt double %a, 1.234e+00
5364 %tmp1 = select i1 %tmp, double -1.000e+00, double %b
5465 ret double %tmp1