blob: 9b4fafcb2f28359eeec338cd62ef50d3b82793f4 [file] [log] [blame]
Dan Gohmanfce288f2009-09-09 00:09:15 +00001; RUN: llc < %s -march=arm -mattr=+neon > %t
Bob Wilson5bafff32009-06-22 23:27:02 +00002; RUN: grep {vceq\\.f32} %t | count 1
3; RUN: grep {vcgt\\.f32} %t | count 9
4; RUN: grep {vcge\\.f32} %t | count 5
5; RUN: grep vorr %t | count 4
6; RUN: grep vmvn %t | count 7
7
Chris Lattnerb2773e12009-07-08 00:46:57 +00008; This tests fcmp operations that do not map directly to NEON instructions.
Bob Wilson5bafff32009-06-22 23:27:02 +00009
10; une is implemented with VCEQ/VMVN
11define <2 x i32> @vcunef32(<2 x float>* %A, <2 x float>* %B) nounwind {
12 %tmp1 = load <2 x float>* %A
13 %tmp2 = load <2 x float>* %B
Chris Lattnerb2773e12009-07-08 00:46:57 +000014 %tmp3 = fcmp une <2 x float> %tmp1, %tmp2
15 %tmp4 = sext <2 x i1> %tmp3 to <2 x i32>
16 ret <2 x i32> %tmp4
Bob Wilson5bafff32009-06-22 23:27:02 +000017}
18
19; olt is implemented with VCGT
20define <2 x i32> @vcoltf32(<2 x float>* %A, <2 x float>* %B) nounwind {
21 %tmp1 = load <2 x float>* %A
22 %tmp2 = load <2 x float>* %B
Chris Lattnerb2773e12009-07-08 00:46:57 +000023 %tmp3 = fcmp olt <2 x float> %tmp1, %tmp2
24 %tmp4 = sext <2 x i1> %tmp3 to <2 x i32>
25 ret <2 x i32> %tmp4
Bob Wilson5bafff32009-06-22 23:27:02 +000026}
27
28; ole is implemented with VCGE
29define <2 x i32> @vcolef32(<2 x float>* %A, <2 x float>* %B) nounwind {
30 %tmp1 = load <2 x float>* %A
31 %tmp2 = load <2 x float>* %B
Chris Lattnerb2773e12009-07-08 00:46:57 +000032 %tmp3 = fcmp ole <2 x float> %tmp1, %tmp2
33 %tmp4 = sext <2 x i1> %tmp3 to <2 x i32>
34 ret <2 x i32> %tmp4
Bob Wilson5bafff32009-06-22 23:27:02 +000035}
36
37; uge is implemented with VCGT/VMVN
38define <2 x i32> @vcugef32(<2 x float>* %A, <2 x float>* %B) nounwind {
39 %tmp1 = load <2 x float>* %A
40 %tmp2 = load <2 x float>* %B
Chris Lattnerb2773e12009-07-08 00:46:57 +000041 %tmp3 = fcmp uge <2 x float> %tmp1, %tmp2
42 %tmp4 = sext <2 x i1> %tmp3 to <2 x i32>
43 ret <2 x i32> %tmp4
Bob Wilson5bafff32009-06-22 23:27:02 +000044}
45
46; ule is implemented with VCGT/VMVN
47define <2 x i32> @vculef32(<2 x float>* %A, <2 x float>* %B) nounwind {
48 %tmp1 = load <2 x float>* %A
49 %tmp2 = load <2 x float>* %B
Chris Lattnerb2773e12009-07-08 00:46:57 +000050 %tmp3 = fcmp ule <2 x float> %tmp1, %tmp2
51 %tmp4 = sext <2 x i1> %tmp3 to <2 x i32>
52 ret <2 x i32> %tmp4
Bob Wilson5bafff32009-06-22 23:27:02 +000053}
54
55; ugt is implemented with VCGE/VMVN
56define <2 x i32> @vcugtf32(<2 x float>* %A, <2 x float>* %B) nounwind {
57 %tmp1 = load <2 x float>* %A
58 %tmp2 = load <2 x float>* %B
Chris Lattnerb2773e12009-07-08 00:46:57 +000059 %tmp3 = fcmp ugt <2 x float> %tmp1, %tmp2
60 %tmp4 = sext <2 x i1> %tmp3 to <2 x i32>
61 ret <2 x i32> %tmp4
Bob Wilson5bafff32009-06-22 23:27:02 +000062}
63
64; ult is implemented with VCGE/VMVN
65define <2 x i32> @vcultf32(<2 x float>* %A, <2 x float>* %B) nounwind {
66 %tmp1 = load <2 x float>* %A
67 %tmp2 = load <2 x float>* %B
Chris Lattnerb2773e12009-07-08 00:46:57 +000068 %tmp3 = fcmp ult <2 x float> %tmp1, %tmp2
69 %tmp4 = sext <2 x i1> %tmp3 to <2 x i32>
70 ret <2 x i32> %tmp4
Bob Wilson5bafff32009-06-22 23:27:02 +000071}
72
73; ueq is implemented with VCGT/VCGT/VORR/VMVN
74define <2 x i32> @vcueqf32(<2 x float>* %A, <2 x float>* %B) nounwind {
75 %tmp1 = load <2 x float>* %A
76 %tmp2 = load <2 x float>* %B
Chris Lattnerb2773e12009-07-08 00:46:57 +000077 %tmp3 = fcmp ueq <2 x float> %tmp1, %tmp2
78 %tmp4 = sext <2 x i1> %tmp3 to <2 x i32>
79 ret <2 x i32> %tmp4
Bob Wilson5bafff32009-06-22 23:27:02 +000080}
81
82; one is implemented with VCGT/VCGT/VORR
83define <2 x i32> @vconef32(<2 x float>* %A, <2 x float>* %B) nounwind {
84 %tmp1 = load <2 x float>* %A
85 %tmp2 = load <2 x float>* %B
Chris Lattnerb2773e12009-07-08 00:46:57 +000086 %tmp3 = fcmp one <2 x float> %tmp1, %tmp2
87 %tmp4 = sext <2 x i1> %tmp3 to <2 x i32>
88 ret <2 x i32> %tmp4
Bob Wilson5bafff32009-06-22 23:27:02 +000089}
90
91; uno is implemented with VCGT/VCGE/VORR/VMVN
92define <2 x i32> @vcunof32(<2 x float>* %A, <2 x float>* %B) nounwind {
93 %tmp1 = load <2 x float>* %A
94 %tmp2 = load <2 x float>* %B
Chris Lattnerb2773e12009-07-08 00:46:57 +000095 %tmp3 = fcmp uno <2 x float> %tmp1, %tmp2
96 %tmp4 = sext <2 x i1> %tmp3 to <2 x i32>
97 ret <2 x i32> %tmp4
Bob Wilson5bafff32009-06-22 23:27:02 +000098}
99
100; ord is implemented with VCGT/VCGE/VORR
101define <2 x i32> @vcordf32(<2 x float>* %A, <2 x float>* %B) nounwind {
102 %tmp1 = load <2 x float>* %A
103 %tmp2 = load <2 x float>* %B
Chris Lattnerb2773e12009-07-08 00:46:57 +0000104 %tmp3 = fcmp ord <2 x float> %tmp1, %tmp2
105 %tmp4 = sext <2 x i1> %tmp3 to <2 x i32>
106 ret <2 x i32> %tmp4
Bob Wilson5bafff32009-06-22 23:27:02 +0000107}