1 ; RUN: llc -mtriple=aarch64-none-linux-gnu -mattr=+neon < %s | FileCheck %s
3 ;; Scalar Floating-point Compare
5 define i32 @test_vceqs_f32(float %a, float %b) {
6 ; CHECK: test_vceqs_f32
7 ; CHECK: fcmeq {{s[0-9]}}, {{s[0-9]}}, {{s[0-9]}}
9 %vceq.i = insertelement <1 x float> undef, float %a, i32 0
10 %vceq1.i = insertelement <1 x float> undef, float %b, i32 0
11 %vceq2.i = call <1 x i32> @llvm.aarch64.neon.vceq.v1i32.v1f32.v1f32(<1 x float> %vceq.i, <1 x float> %vceq1.i)
12 %0 = extractelement <1 x i32> %vceq2.i, i32 0
16 define i64 @test_vceqd_f64(double %a, double %b) {
17 ; CHECK: test_vceqd_f64
18 ; CHECK: fcmeq {{d[0-9]}}, {{d[0-9]}}, {{d[0-9]}}
20 %vceq.i = insertelement <1 x double> undef, double %a, i32 0
21 %vceq1.i = insertelement <1 x double> undef, double %b, i32 0
22 %vceq2.i = call <1 x i64> @llvm.aarch64.neon.vceq.v1i64.v1f64.v1f64(<1 x double> %vceq.i, <1 x double> %vceq1.i)
23 %0 = extractelement <1 x i64> %vceq2.i, i32 0
27 define i32 @test_vceqzs_f32(float %a) {
28 ; CHECK: test_vceqzs_f32
29 ; CHECK: fcmeq {{s[0-9]}}, {{s[0-9]}}, #0.0
31 %vceq.i = insertelement <1 x float> undef, float %a, i32 0
32 %vceq1.i = call <1 x i32> @llvm.aarch64.neon.vceq.v1i32.v1f32.v1f32(<1 x float> %vceq.i, <1 x float> zeroinitializer)
33 %0 = extractelement <1 x i32> %vceq1.i, i32 0
37 define i64 @test_vceqzd_f64(double %a) {
38 ; CHECK: test_vceqzd_f64
39 ; CHECK: fcmeq {{d[0-9]}}, {{d[0-9]}}, #0.0
41 %vceq.i = insertelement <1 x double> undef, double %a, i32 0
42 %vceq1.i = call <1 x i64> @llvm.aarch64.neon.vceq.v1i64.v1f64.v1f64(<1 x double> %vceq.i, <1 x double> zeroinitializer)
43 %0 = extractelement <1 x i64> %vceq1.i, i32 0
47 define i32 @test_vcges_f32(float %a, float %b) {
48 ; CHECK: test_vcges_f32
49 ; CHECK: fcmge {{s[0-9]}}, {{s[0-9]}}, {{s[0-9]}}
51 %vcge.i = insertelement <1 x float> undef, float %a, i32 0
52 %vcge1.i = insertelement <1 x float> undef, float %b, i32 0
53 %vcge2.i = call <1 x i32> @llvm.aarch64.neon.vcge.v1i32.v1f32.v1f32(<1 x float> %vcge.i, <1 x float> %vcge1.i)
54 %0 = extractelement <1 x i32> %vcge2.i, i32 0
58 define i64 @test_vcged_f64(double %a, double %b) {
59 ; CHECK: test_vcged_f64
60 ; CHECK: fcmge {{d[0-9]}}, {{d[0-9]}}, {{d[0-9]}}
62 %vcge.i = insertelement <1 x double> undef, double %a, i32 0
63 %vcge1.i = insertelement <1 x double> undef, double %b, i32 0
64 %vcge2.i = call <1 x i64> @llvm.aarch64.neon.vcge.v1i64.v1f64.v1f64(<1 x double> %vcge.i, <1 x double> %vcge1.i)
65 %0 = extractelement <1 x i64> %vcge2.i, i32 0
69 define i32 @test_vcgezs_f32(float %a) {
70 ; CHECK: test_vcgezs_f32
71 ; CHECK: fcmge {{s[0-9]}}, {{s[0-9]}}, #0.0
73 %vcge.i = insertelement <1 x float> undef, float %a, i32 0
74 %vcge1.i = call <1 x i32> @llvm.aarch64.neon.vcge.v1i32.v1f32.v1f32(<1 x float> %vcge.i, <1 x float> zeroinitializer)
75 %0 = extractelement <1 x i32> %vcge1.i, i32 0
79 define i64 @test_vcgezd_f64(double %a) {
80 ; CHECK: test_vcgezd_f64
81 ; CHECK: fcmge {{d[0-9]}}, {{d[0-9]}}, #0.0
83 %vcge.i = insertelement <1 x double> undef, double %a, i32 0
84 %vcge1.i = call <1 x i64> @llvm.aarch64.neon.vcge.v1i64.v1f64.v1f64(<1 x double> %vcge.i, <1 x double> zeroinitializer)
85 %0 = extractelement <1 x i64> %vcge1.i, i32 0
89 define i32 @test_vcgts_f32(float %a, float %b) {
90 ; CHECK: test_vcgts_f32
91 ; CHECK: fcmgt {{s[0-9]}}, {{s[0-9]}}, {{s[0-9]}}
93 %vcgt.i = insertelement <1 x float> undef, float %a, i32 0
94 %vcgt1.i = insertelement <1 x float> undef, float %b, i32 0
95 %vcgt2.i = call <1 x i32> @llvm.aarch64.neon.vcgt.v1i32.v1f32.v1f32(<1 x float> %vcgt.i, <1 x float> %vcgt1.i)
96 %0 = extractelement <1 x i32> %vcgt2.i, i32 0
100 define i64 @test_vcgtd_f64(double %a, double %b) {
101 ; CHECK: test_vcgtd_f64
102 ; CHECK: fcmgt {{d[0-9]}}, {{d[0-9]}}, {{d[0-9]}}
104 %vcgt.i = insertelement <1 x double> undef, double %a, i32 0
105 %vcgt1.i = insertelement <1 x double> undef, double %b, i32 0
106 %vcgt2.i = call <1 x i64> @llvm.aarch64.neon.vcgt.v1i64.v1f64.v1f64(<1 x double> %vcgt.i, <1 x double> %vcgt1.i)
107 %0 = extractelement <1 x i64> %vcgt2.i, i32 0
111 define i32 @test_vcgtzs_f32(float %a) {
112 ; CHECK: test_vcgtzs_f32
113 ; CHECK: fcmgt {{s[0-9]}}, {{s[0-9]}}, #0.0
115 %vcgt.i = insertelement <1 x float> undef, float %a, i32 0
116 %vcgt1.i = call <1 x i32> @llvm.aarch64.neon.vcgt.v1i32.v1f32.v1f32(<1 x float> %vcgt.i, <1 x float> zeroinitializer)
117 %0 = extractelement <1 x i32> %vcgt1.i, i32 0
121 define i64 @test_vcgtzd_f64(double %a) {
122 ; CHECK: test_vcgtzd_f64
123 ; CHECK: fcmgt {{d[0-9]}}, {{d[0-9]}}, #0.0
125 %vcgt.i = insertelement <1 x double> undef, double %a, i32 0
126 %vcgt1.i = call <1 x i64> @llvm.aarch64.neon.vcgt.v1i64.v1f64.v1f64(<1 x double> %vcgt.i, <1 x double> zeroinitializer)
127 %0 = extractelement <1 x i64> %vcgt1.i, i32 0
131 define i32 @test_vcles_f32(float %a, float %b) {
132 ; CHECK: test_vcles_f32
133 ; CHECK: fcmge {{s[0-9]}}, {{s[0-9]}}, {{s[0-9]}}
135 %vcge.i = insertelement <1 x float> undef, float %a, i32 0
136 %vcge1.i = insertelement <1 x float> undef, float %b, i32 0
137 %vcge2.i = call <1 x i32> @llvm.aarch64.neon.vcge.v1i32.v1f32.v1f32(<1 x float> %vcge.i, <1 x float> %vcge1.i)
138 %0 = extractelement <1 x i32> %vcge2.i, i32 0
142 define i64 @test_vcled_f64(double %a, double %b) {
143 ; CHECK: test_vcled_f64
144 ; CHECK: fcmge {{d[0-9]}}, {{d[0-9]}}, {{d[0-9]}}
146 %vcge.i = insertelement <1 x double> undef, double %a, i32 0
147 %vcge1.i = insertelement <1 x double> undef, double %b, i32 0
148 %vcge2.i = call <1 x i64> @llvm.aarch64.neon.vcge.v1i64.v1f64.v1f64(<1 x double> %vcge.i, <1 x double> %vcge1.i)
149 %0 = extractelement <1 x i64> %vcge2.i, i32 0
153 define i32 @test_vclezs_f32(float %a) {
154 ; CHECK: test_vclezs_f32
155 ; CHECK: fcmle {{s[0-9]}}, {{s[0-9]}}, #0.0
157 %vcle.i = insertelement <1 x float> undef, float %a, i32 0
158 %vcle1.i = call <1 x i32> @llvm.aarch64.neon.vclez.v1i32.v1f32.v1f32(<1 x float> %vcle.i, <1 x float> zeroinitializer)
159 %0 = extractelement <1 x i32> %vcle1.i, i32 0
163 define i64 @test_vclezd_f64(double %a) {
164 ; CHECK: test_vclezd_f64
165 ; CHECK: fcmle {{d[0-9]}}, {{d[0-9]}}, #0.0
167 %vcle.i = insertelement <1 x double> undef, double %a, i32 0
168 %vcle1.i = call <1 x i64> @llvm.aarch64.neon.vclez.v1i64.v1f64.v1f64(<1 x double> %vcle.i, <1 x double> zeroinitializer)
169 %0 = extractelement <1 x i64> %vcle1.i, i32 0
173 define i32 @test_vclts_f32(float %a, float %b) {
174 ; CHECK: test_vclts_f32
175 ; CHECK: fcmgt {{s[0-9]}}, {{s[0-9]}}, {{s[0-9]}}
177 %vcgt.i = insertelement <1 x float> undef, float %b, i32 0
178 %vcgt1.i = insertelement <1 x float> undef, float %a, i32 0
179 %vcgt2.i = call <1 x i32> @llvm.aarch64.neon.vcgt.v1i32.v1f32.v1f32(<1 x float> %vcgt.i, <1 x float> %vcgt1.i)
180 %0 = extractelement <1 x i32> %vcgt2.i, i32 0
184 define i64 @test_vcltd_f64(double %a, double %b) {
185 ; CHECK: test_vcltd_f64
186 ; CHECK: fcmgt {{d[0-9]}}, {{d[0-9]}}, {{d[0-9]}}
188 %vcgt.i = insertelement <1 x double> undef, double %b, i32 0
189 %vcgt1.i = insertelement <1 x double> undef, double %a, i32 0
190 %vcgt2.i = call <1 x i64> @llvm.aarch64.neon.vcgt.v1i64.v1f64.v1f64(<1 x double> %vcgt.i, <1 x double> %vcgt1.i)
191 %0 = extractelement <1 x i64> %vcgt2.i, i32 0
195 define i32 @test_vcltzs_f32(float %a) {
196 ; CHECK: test_vcltzs_f32
197 ; CHECK: fcmlt {{s[0-9]}}, {{s[0-9]}}, #0.0
199 %vclt.i = insertelement <1 x float> undef, float %a, i32 0
200 %vclt1.i = call <1 x i32> @llvm.aarch64.neon.vcltz.v1i32.v1f32.v1f32(<1 x float> %vclt.i, <1 x float> zeroinitializer)
201 %0 = extractelement <1 x i32> %vclt1.i, i32 0
205 define i64 @test_vcltzd_f64(double %a) {
206 ; CHECK: test_vcltzd_f64
207 ; CHECK: fcmlt {{d[0-9]}}, {{d[0-9]}}, #0.0
209 %vclt.i = insertelement <1 x double> undef, double %a, i32 0
210 %vclt1.i = call <1 x i64> @llvm.aarch64.neon.vcltz.v1i64.v1f64.v1f64(<1 x double> %vclt.i, <1 x double> zeroinitializer)
211 %0 = extractelement <1 x i64> %vclt1.i, i32 0
215 define i32 @test_vcages_f32(float %a, float %b) {
216 ; CHECK: test_vcages_f32
217 ; CHECK: facge {{s[0-9]}}, {{s[0-9]}}, {{s[0-9]}}
219 %vcage.i = insertelement <1 x float> undef, float %a, i32 0
220 %vcage1.i = insertelement <1 x float> undef, float %b, i32 0
221 %vcage2.i = call <1 x i32> @llvm.aarch64.neon.vcage.v1i32.v1f32.v1f32(<1 x float> %vcage.i, <1 x float> %vcage1.i)
222 %0 = extractelement <1 x i32> %vcage2.i, i32 0
226 define i64 @test_vcaged_f64(double %a, double %b) {
227 ; CHECK: test_vcaged_f64
228 ; CHECK: facge {{d[0-9]}}, {{d[0-9]}}, {{d[0-9]}}
230 %vcage.i = insertelement <1 x double> undef, double %a, i32 0
231 %vcage1.i = insertelement <1 x double> undef, double %b, i32 0
232 %vcage2.i = call <1 x i64> @llvm.aarch64.neon.vcage.v1i64.v1f64.v1f64(<1 x double> %vcage.i, <1 x double> %vcage1.i)
233 %0 = extractelement <1 x i64> %vcage2.i, i32 0
237 define i32 @test_vcagts_f32(float %a, float %b) {
238 ; CHECK: test_vcagts_f32
239 ; CHECK: facgt {{s[0-9]}}, {{s[0-9]}}, {{s[0-9]}}
241 %vcagt.i = insertelement <1 x float> undef, float %a, i32 0
242 %vcagt1.i = insertelement <1 x float> undef, float %b, i32 0
243 %vcagt2.i = call <1 x i32> @llvm.aarch64.neon.vcagt.v1i32.v1f32.v1f32(<1 x float> %vcagt.i, <1 x float> %vcagt1.i)
244 %0 = extractelement <1 x i32> %vcagt2.i, i32 0
248 define i64 @test_vcagtd_f64(double %a, double %b) {
249 ; CHECK: test_vcagtd_f64
250 ; CHECK: facgt {{d[0-9]}}, {{d[0-9]}}, {{d[0-9]}}
252 %vcagt.i = insertelement <1 x double> undef, double %a, i32 0
253 %vcagt1.i = insertelement <1 x double> undef, double %b, i32 0
254 %vcagt2.i = call <1 x i64> @llvm.aarch64.neon.vcagt.v1i64.v1f64.v1f64(<1 x double> %vcagt.i, <1 x double> %vcagt1.i)
255 %0 = extractelement <1 x i64> %vcagt2.i, i32 0
259 define i32 @test_vcales_f32(float %a, float %b) {
260 ; CHECK: test_vcales_f32
261 ; CHECK: facge {{s[0-9]}}, {{s[0-9]}}, {{s[0-9]}}
263 %vcage.i = insertelement <1 x float> undef, float %b, i32 0
264 %vcage1.i = insertelement <1 x float> undef, float %a, i32 0
265 %vcage2.i = call <1 x i32> @llvm.aarch64.neon.vcage.v1i32.v1f32.v1f32(<1 x float> %vcage.i, <1 x float> %vcage1.i)
266 %0 = extractelement <1 x i32> %vcage2.i, i32 0
270 define i64 @test_vcaled_f64(double %a, double %b) {
271 ; CHECK: test_vcaled_f64
272 ; CHECK: facge {{d[0-9]}}, {{d[0-9]}}, {{d[0-9]}}
274 %vcage.i = insertelement <1 x double> undef, double %b, i32 0
275 %vcage1.i = insertelement <1 x double> undef, double %a, i32 0
276 %vcage2.i = call <1 x i64> @llvm.aarch64.neon.vcage.v1i64.v1f64.v1f64(<1 x double> %vcage.i, <1 x double> %vcage1.i)
277 %0 = extractelement <1 x i64> %vcage2.i, i32 0
281 define i32 @test_vcalts_f32(float %a, float %b) {
282 ; CHECK: test_vcalts_f32
283 ; CHECK: facgt {{s[0-9]}}, {{s[0-9]}}, {{s[0-9]}}
285 %vcalt.i = insertelement <1 x float> undef, float %b, i32 0
286 %vcalt1.i = insertelement <1 x float> undef, float %a, i32 0
287 %vcalt2.i = call <1 x i32> @llvm.aarch64.neon.vcagt.v1i32.v1f32.v1f32(<1 x float> %vcalt.i, <1 x float> %vcalt1.i)
288 %0 = extractelement <1 x i32> %vcalt2.i, i32 0
292 define i64 @test_vcaltd_f64(double %a, double %b) {
293 ; CHECK: test_vcaltd_f64
294 ; CHECK: facgt {{d[0-9]}}, {{d[0-9]}}, {{d[0-9]}}
296 %vcalt.i = insertelement <1 x double> undef, double %b, i32 0
297 %vcalt1.i = insertelement <1 x double> undef, double %a, i32 0
298 %vcalt2.i = call <1 x i64> @llvm.aarch64.neon.vcagt.v1i64.v1f64.v1f64(<1 x double> %vcalt.i, <1 x double> %vcalt1.i)
299 %0 = extractelement <1 x i64> %vcalt2.i, i32 0
303 declare <1 x i32> @llvm.aarch64.neon.vceq.v1i32.v1f32.v1f32(<1 x float>, <1 x float>)
304 declare <1 x i64> @llvm.aarch64.neon.vceq.v1i64.v1f64.v1f64(<1 x double>, <1 x double>)
305 declare <1 x i32> @llvm.aarch64.neon.vcge.v1i32.v1f32.v1f32(<1 x float>, <1 x float>)
306 declare <1 x i64> @llvm.aarch64.neon.vcge.v1i64.v1f64.v1f64(<1 x double>, <1 x double>)
307 declare <1 x i32> @llvm.aarch64.neon.vclez.v1i32.v1f32.v1f32(<1 x float>, <1 x float>)
308 declare <1 x i64> @llvm.aarch64.neon.vclez.v1i64.v1f64.v1f64(<1 x double>, <1 x double>)
309 declare <1 x i32> @llvm.aarch64.neon.vcgt.v1i32.v1f32.v1f32(<1 x float>, <1 x float>)
310 declare <1 x i64> @llvm.aarch64.neon.vcgt.v1i64.v1f64.v1f64(<1 x double>, <1 x double>)
311 declare <1 x i32> @llvm.aarch64.neon.vcltz.v1i32.v1f32.v1f32(<1 x float>, <1 x float>)
312 declare <1 x i64> @llvm.aarch64.neon.vcltz.v1i64.v1f64.v1f64(<1 x double>, <1 x double>)
313 declare <1 x i32> @llvm.aarch64.neon.vcage.v1i32.v1f32.v1f32(<1 x float>, <1 x float>)
314 declare <1 x i64> @llvm.aarch64.neon.vcage.v1i64.v1f64.v1f64(<1 x double>, <1 x double>)
315 declare <1 x i32> @llvm.aarch64.neon.vcagt.v1i32.v1f32.v1f32(<1 x float>, <1 x float>)
316 declare <1 x i64> @llvm.aarch64.neon.vcagt.v1i64.v1f64.v1f64(<1 x double>, <1 x double>)