1 ; RUN: llc -mtriple=arm-eabi -mattr=+neon %s -o - | FileCheck %s
3 define <8 x i8> @vcges8(<8 x i8>* %A, <8 x i8>* %B) nounwind {
6 %tmp1 = load <8 x i8>, <8 x i8>* %A
7 %tmp2 = load <8 x i8>, <8 x i8>* %B
8 %tmp3 = icmp sge <8 x i8> %tmp1, %tmp2
9 %tmp4 = sext <8 x i1> %tmp3 to <8 x i8>
13 define <4 x i16> @vcges16(<4 x i16>* %A, <4 x i16>* %B) nounwind {
14 ;CHECK-LABEL: vcges16:
16 %tmp1 = load <4 x i16>, <4 x i16>* %A
17 %tmp2 = load <4 x i16>, <4 x i16>* %B
18 %tmp3 = icmp sge <4 x i16> %tmp1, %tmp2
19 %tmp4 = sext <4 x i1> %tmp3 to <4 x i16>
23 define <2 x i32> @vcges32(<2 x i32>* %A, <2 x i32>* %B) nounwind {
24 ;CHECK-LABEL: vcges32:
26 %tmp1 = load <2 x i32>, <2 x i32>* %A
27 %tmp2 = load <2 x i32>, <2 x i32>* %B
28 %tmp3 = icmp sge <2 x i32> %tmp1, %tmp2
29 %tmp4 = sext <2 x i1> %tmp3 to <2 x i32>
33 define <8 x i8> @vcgeu8(<8 x i8>* %A, <8 x i8>* %B) nounwind {
36 %tmp1 = load <8 x i8>, <8 x i8>* %A
37 %tmp2 = load <8 x i8>, <8 x i8>* %B
38 %tmp3 = icmp uge <8 x i8> %tmp1, %tmp2
39 %tmp4 = sext <8 x i1> %tmp3 to <8 x i8>
43 define <4 x i16> @vcgeu16(<4 x i16>* %A, <4 x i16>* %B) nounwind {
44 ;CHECK-LABEL: vcgeu16:
46 %tmp1 = load <4 x i16>, <4 x i16>* %A
47 %tmp2 = load <4 x i16>, <4 x i16>* %B
48 %tmp3 = icmp uge <4 x i16> %tmp1, %tmp2
49 %tmp4 = sext <4 x i1> %tmp3 to <4 x i16>
53 define <2 x i32> @vcgeu32(<2 x i32>* %A, <2 x i32>* %B) nounwind {
54 ;CHECK-LABEL: vcgeu32:
56 %tmp1 = load <2 x i32>, <2 x i32>* %A
57 %tmp2 = load <2 x i32>, <2 x i32>* %B
58 %tmp3 = icmp uge <2 x i32> %tmp1, %tmp2
59 %tmp4 = sext <2 x i1> %tmp3 to <2 x i32>
63 define <2 x i32> @vcgef32(<2 x float>* %A, <2 x float>* %B) nounwind {
64 ;CHECK-LABEL: vcgef32:
66 %tmp1 = load <2 x float>, <2 x float>* %A
67 %tmp2 = load <2 x float>, <2 x float>* %B
68 %tmp3 = fcmp oge <2 x float> %tmp1, %tmp2
69 %tmp4 = sext <2 x i1> %tmp3 to <2 x i32>
73 define <16 x i8> @vcgeQs8(<16 x i8>* %A, <16 x i8>* %B) nounwind {
74 ;CHECK-LABEL: vcgeQs8:
76 %tmp1 = load <16 x i8>, <16 x i8>* %A
77 %tmp2 = load <16 x i8>, <16 x i8>* %B
78 %tmp3 = icmp sge <16 x i8> %tmp1, %tmp2
79 %tmp4 = sext <16 x i1> %tmp3 to <16 x i8>
83 define <8 x i16> @vcgeQs16(<8 x i16>* %A, <8 x i16>* %B) nounwind {
84 ;CHECK-LABEL: vcgeQs16:
86 %tmp1 = load <8 x i16>, <8 x i16>* %A
87 %tmp2 = load <8 x i16>, <8 x i16>* %B
88 %tmp3 = icmp sge <8 x i16> %tmp1, %tmp2
89 %tmp4 = sext <8 x i1> %tmp3 to <8 x i16>
93 define <4 x i32> @vcgeQs32(<4 x i32>* %A, <4 x i32>* %B) nounwind {
94 ;CHECK-LABEL: vcgeQs32:
96 %tmp1 = load <4 x i32>, <4 x i32>* %A
97 %tmp2 = load <4 x i32>, <4 x i32>* %B
98 %tmp3 = icmp sge <4 x i32> %tmp1, %tmp2
99 %tmp4 = sext <4 x i1> %tmp3 to <4 x i32>
103 define <16 x i8> @vcgeQu8(<16 x i8>* %A, <16 x i8>* %B) nounwind {
104 ;CHECK-LABEL: vcgeQu8:
106 %tmp1 = load <16 x i8>, <16 x i8>* %A
107 %tmp2 = load <16 x i8>, <16 x i8>* %B
108 %tmp3 = icmp uge <16 x i8> %tmp1, %tmp2
109 %tmp4 = sext <16 x i1> %tmp3 to <16 x i8>
113 define <8 x i16> @vcgeQu16(<8 x i16>* %A, <8 x i16>* %B) nounwind {
114 ;CHECK-LABEL: vcgeQu16:
116 %tmp1 = load <8 x i16>, <8 x i16>* %A
117 %tmp2 = load <8 x i16>, <8 x i16>* %B
118 %tmp3 = icmp uge <8 x i16> %tmp1, %tmp2
119 %tmp4 = sext <8 x i1> %tmp3 to <8 x i16>
123 define <4 x i32> @vcgeQu32(<4 x i32>* %A, <4 x i32>* %B) nounwind {
124 ;CHECK-LABEL: vcgeQu32:
126 %tmp1 = load <4 x i32>, <4 x i32>* %A
127 %tmp2 = load <4 x i32>, <4 x i32>* %B
128 %tmp3 = icmp uge <4 x i32> %tmp1, %tmp2
129 %tmp4 = sext <4 x i1> %tmp3 to <4 x i32>
133 define <4 x i32> @vcgeQf32(<4 x float>* %A, <4 x float>* %B) nounwind {
134 ;CHECK-LABEL: vcgeQf32:
136 %tmp1 = load <4 x float>, <4 x float>* %A
137 %tmp2 = load <4 x float>, <4 x float>* %B
138 %tmp3 = fcmp oge <4 x float> %tmp1, %tmp2
139 %tmp4 = sext <4 x i1> %tmp3 to <4 x i32>
143 define <2 x i32> @vacgef32(<2 x float>* %A, <2 x float>* %B) nounwind {
144 ;CHECK-LABEL: vacgef32:
146 %tmp1 = load <2 x float>, <2 x float>* %A
147 %tmp2 = load <2 x float>, <2 x float>* %B
148 %tmp3 = call <2 x i32> @llvm.arm.neon.vacge.v2i32.v2f32(<2 x float> %tmp1, <2 x float> %tmp2)
152 define <4 x i32> @vacgeQf32(<4 x float>* %A, <4 x float>* %B) nounwind {
153 ;CHECK-LABEL: vacgeQf32:
155 %tmp1 = load <4 x float>, <4 x float>* %A
156 %tmp2 = load <4 x float>, <4 x float>* %B
157 %tmp3 = call <4 x i32> @llvm.arm.neon.vacge.v4i32.v4f32(<4 x float> %tmp1, <4 x float> %tmp2)
161 declare <2 x i32> @llvm.arm.neon.vacge.v2i32.v2f32(<2 x float>, <2 x float>) nounwind readnone
162 declare <4 x i32> @llvm.arm.neon.vacge.v4i32.v4f32(<4 x float>, <4 x float>) nounwind readnone
164 define <8 x i8> @vcgei8Z(<8 x i8>* %A) nounwind {
165 ;CHECK-LABEL: vcgei8Z:
169 %tmp1 = load <8 x i8>, <8 x i8>* %A
170 %tmp3 = icmp sge <8 x i8> %tmp1, <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>
171 %tmp4 = sext <8 x i1> %tmp3 to <8 x i8>
175 define <8 x i8> @vclei8Z(<8 x i8>* %A) nounwind {
176 ;CHECK-LABEL: vclei8Z:
180 %tmp1 = load <8 x i8>, <8 x i8>* %A
181 %tmp3 = icmp sle <8 x i8> %tmp1, <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>
182 %tmp4 = sext <8 x i1> %tmp3 to <8 x i8>
187 ; Floating-point comparisons against zero produce results with integer
188 ; elements, not floating-point elements.
189 define void @test_vclez_fp() nounwind optsize {
190 ;CHECK-LABEL: test_vclez_fp:
193 %0 = fcmp ole <4 x float> undef, zeroinitializer
194 %1 = sext <4 x i1> %0 to <4 x i16>
195 %2 = add <4 x i16> %1, zeroinitializer
196 %3 = shufflevector <4 x i16> %2, <4 x i16> undef, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
197 %4 = add <8 x i16> %3, <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>
198 %5 = trunc <8 x i16> %4 to <8 x i8>
199 tail call void @llvm.arm.neon.vst1.p0i8.v8i8(i8* undef, <8 x i8> %5, i32 1)
203 declare void @llvm.arm.neon.vst1.p0i8.v8i8(i8*, <8 x i8>, i32) nounwind