1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals
2 ; RUN: opt -vector-library=sleefgnuabi -replace-with-veclib -S < %s | FileCheck %s
4 target triple = "aarch64-unknown-linux-gnu"
7 ; CHECK: @[[LLVM_COMPILER_USED:[a-zA-Z0-9_$"\\.-]+]] = appending global [14 x ptr] [ptr @_ZGVnN2v_cos, ptr @_ZGVnN4v_cosf, ptr @_ZGVnN2v_exp, ptr @_ZGVnN4v_expf, ptr @_ZGVnN2v_exp2, ptr @_ZGVnN4v_exp2f, ptr @_ZGVnN2v_log, ptr @_ZGVnN4v_logf, ptr @_ZGVnN2v_log10, ptr @_ZGVnN4v_log10f, ptr @_ZGVnN2v_log2, ptr @_ZGVnN4v_log2f, ptr @_ZGVnN2v_sin, ptr @_ZGVnN4v_sinf], section "llvm.metadata"
9 define <2 x double> @llvm_ceil_f64(<2 x double> %in) {
10 ; CHECK-LABEL: @llvm_ceil_f64(
11 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @llvm.ceil.v2f64(<2 x double> [[IN:%.*]])
12 ; CHECK-NEXT: ret <2 x double> [[TMP1]]
14 %1 = call fast <2 x double> @llvm.ceil.v2f64(<2 x double> %in)
18 define <4 x float> @llvm_ceil_f32(<4 x float> %in) {
19 ; CHECK-LABEL: @llvm_ceil_f32(
20 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @llvm.ceil.v4f32(<4 x float> [[IN:%.*]])
21 ; CHECK-NEXT: ret <4 x float> [[TMP1]]
23 %1 = call fast <4 x float> @llvm.ceil.v4f32(<4 x float> %in)
27 define <2 x double> @llvm_copysign_f64(<2 x double> %mag, <2 x double> %sgn) {
28 ; CHECK-LABEL: @llvm_copysign_f64(
29 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @llvm.copysign.v2f64(<2 x double> [[MAG:%.*]], <2 x double> [[SGN:%.*]])
30 ; CHECK-NEXT: ret <2 x double> [[TMP1]]
32 %1 = call fast <2 x double> @llvm.copysign.v2f64(<2 x double> %mag, <2 x double> %sgn)
36 define <4 x float> @llvm_copysign_f32(<4 x float> %mag, <4 x float> %sgn) {
37 ; CHECK-LABEL: @llvm_copysign_f32(
38 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @llvm.copysign.v4f32(<4 x float> [[MAG:%.*]], <4 x float> [[SGN:%.*]])
39 ; CHECK-NEXT: ret <4 x float> [[TMP1]]
41 %1 = call fast <4 x float> @llvm.copysign.v4f32(<4 x float> %mag, <4 x float> %sgn)
45 define <2 x double> @llvm_cos_f64(<2 x double> %in) {
46 ; CHECK-LABEL: @llvm_cos_f64(
47 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @_ZGVnN2v_cos(<2 x double> [[IN:%.*]])
48 ; CHECK-NEXT: ret <2 x double> [[TMP1]]
50 %1 = call fast <2 x double> @llvm.cos.v2f64(<2 x double> %in)
54 define <4 x float> @llvm_cos_f32(<4 x float> %in) {
55 ; CHECK-LABEL: @llvm_cos_f32(
56 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @_ZGVnN4v_cosf(<4 x float> [[IN:%.*]])
57 ; CHECK-NEXT: ret <4 x float> [[TMP1]]
59 %1 = call fast <4 x float> @llvm.cos.v4f32(<4 x float> %in)
63 define <2 x double> @llvm_exp_f64(<2 x double> %in) {
64 ; CHECK-LABEL: @llvm_exp_f64(
65 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @_ZGVnN2v_exp(<2 x double> [[IN:%.*]])
66 ; CHECK-NEXT: ret <2 x double> [[TMP1]]
68 %1 = call fast <2 x double> @llvm.exp.v2f64(<2 x double> %in)
72 define <4 x float> @llvm_exp_f32(<4 x float> %in) {
73 ; CHECK-LABEL: @llvm_exp_f32(
74 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @_ZGVnN4v_expf(<4 x float> [[IN:%.*]])
75 ; CHECK-NEXT: ret <4 x float> [[TMP1]]
77 %1 = call fast <4 x float> @llvm.exp.v4f32(<4 x float> %in)
81 define <2 x double> @llvm_exp2_f64(<2 x double> %in) {
82 ; CHECK-LABEL: @llvm_exp2_f64(
83 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @_ZGVnN2v_exp2(<2 x double> [[IN:%.*]])
84 ; CHECK-NEXT: ret <2 x double> [[TMP1]]
86 %1 = call fast <2 x double> @llvm.exp2.v2f64(<2 x double> %in)
90 define <4 x float> @llvm_exp2_f32(<4 x float> %in) {
91 ; CHECK-LABEL: @llvm_exp2_f32(
92 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @_ZGVnN4v_exp2f(<4 x float> [[IN:%.*]])
93 ; CHECK-NEXT: ret <4 x float> [[TMP1]]
95 %1 = call fast <4 x float> @llvm.exp2.v4f32(<4 x float> %in)
99 define <2 x double> @llvm_fabs_f64(<2 x double> %in) {
100 ; CHECK-LABEL: @llvm_fabs_f64(
101 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @llvm.fabs.v2f64(<2 x double> [[IN:%.*]])
102 ; CHECK-NEXT: ret <2 x double> [[TMP1]]
104 %1 = call fast <2 x double> @llvm.fabs.v2f64(<2 x double> %in)
108 define <4 x float> @llvm_fabs_f32(<4 x float> %in) {
109 ; CHECK-LABEL: @llvm_fabs_f32(
110 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @llvm.fabs.v4f32(<4 x float> [[IN:%.*]])
111 ; CHECK-NEXT: ret <4 x float> [[TMP1]]
113 %1 = call fast <4 x float> @llvm.fabs.v4f32(<4 x float> %in)
117 define <2 x double> @llvm_floor_f64(<2 x double> %in) {
118 ; CHECK-LABEL: @llvm_floor_f64(
119 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @llvm.floor.v2f64(<2 x double> [[IN:%.*]])
120 ; CHECK-NEXT: ret <2 x double> [[TMP1]]
122 %1 = call fast <2 x double> @llvm.floor.v2f64(<2 x double> %in)
126 define <4 x float> @llvm_floor_f32(<4 x float> %in) {
127 ; CHECK-LABEL: @llvm_floor_f32(
128 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @llvm.floor.v4f32(<4 x float> [[IN:%.*]])
129 ; CHECK-NEXT: ret <4 x float> [[TMP1]]
131 %1 = call fast <4 x float> @llvm.floor.v4f32(<4 x float> %in)
135 define <2 x double> @llvm_fma_f64(<2 x double> %a, <2 x double> %b, <2 x double> %c ) {
136 ; CHECK-LABEL: @llvm_fma_f64(
137 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @llvm.fma.v2f64(<2 x double> [[A:%.*]], <2 x double> [[B:%.*]], <2 x double> [[C:%.*]])
138 ; CHECK-NEXT: ret <2 x double> [[TMP1]]
140 %1 = call fast <2 x double> @llvm.fma.v2f64(<2 x double> %a, <2 x double> %b, <2 x double> %c)
144 define <4 x float> @llvm_fma_f32(<4 x float> %a, <4 x float> %b, <4 x float> %c) {
145 ; CHECK-LABEL: @llvm_fma_f32(
146 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @llvm.fma.v4f32(<4 x float> [[A:%.*]], <4 x float> [[B:%.*]], <4 x float> [[C:%.*]])
147 ; CHECK-NEXT: ret <4 x float> [[TMP1]]
149 %1 = call fast <4 x float> @llvm.fma.v4f32(<4 x float> %a, <4 x float> %b, <4 x float> %c)
153 define <2 x double> @llvm_log_f64(<2 x double> %in) {
154 ; CHECK-LABEL: @llvm_log_f64(
155 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @_ZGVnN2v_log(<2 x double> [[IN:%.*]])
156 ; CHECK-NEXT: ret <2 x double> [[TMP1]]
158 %1 = call fast <2 x double> @llvm.log.v2f64(<2 x double> %in)
162 define <4 x float> @llvm_log_f32(<4 x float> %in) {
163 ; CHECK-LABEL: @llvm_log_f32(
164 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @_ZGVnN4v_logf(<4 x float> [[IN:%.*]])
165 ; CHECK-NEXT: ret <4 x float> [[TMP1]]
167 %1 = call fast <4 x float> @llvm.log.v4f32(<4 x float> %in)
171 define <2 x double> @llvm_log10_f64(<2 x double> %in) {
172 ; CHECK-LABEL: @llvm_log10_f64(
173 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @_ZGVnN2v_log10(<2 x double> [[IN:%.*]])
174 ; CHECK-NEXT: ret <2 x double> [[TMP1]]
176 %1 = call fast <2 x double> @llvm.log10.v2f64(<2 x double> %in)
180 define <4 x float> @llvm_log10_f32(<4 x float> %in) {
181 ; CHECK-LABEL: @llvm_log10_f32(
182 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @_ZGVnN4v_log10f(<4 x float> [[IN:%.*]])
183 ; CHECK-NEXT: ret <4 x float> [[TMP1]]
185 %1 = call fast <4 x float> @llvm.log10.v4f32(<4 x float> %in)
189 define <2 x double> @llvm_log2_f64(<2 x double> %in) {
190 ; CHECK-LABEL: @llvm_log2_f64(
191 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @_ZGVnN2v_log2(<2 x double> [[IN:%.*]])
192 ; CHECK-NEXT: ret <2 x double> [[TMP1]]
194 %1 = call fast <2 x double> @llvm.log2.v2f64(<2 x double> %in)
198 define <4 x float> @llvm_log2_f32(<4 x float> %in) {
199 ; CHECK-LABEL: @llvm_log2_f32(
200 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @_ZGVnN4v_log2f(<4 x float> [[IN:%.*]])
201 ; CHECK-NEXT: ret <4 x float> [[TMP1]]
203 %1 = call fast <4 x float> @llvm.log2.v4f32(<4 x float> %in)
207 define <2 x double> @llvm_maxnum_f64(<2 x double> %in0, <2 x double> %in1) {
208 ; CHECK-LABEL: @llvm_maxnum_f64(
209 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @llvm.maxnum.v2f64(<2 x double> [[IN0:%.*]], <2 x double> [[IN1:%.*]])
210 ; CHECK-NEXT: ret <2 x double> [[TMP1]]
212 %1 = call fast <2 x double> @llvm.maxnum.v2f64(<2 x double> %in0, <2 x double> %in1)
216 define <4 x float> @llvm_maxnum_f32(<4 x float> %in0, <4 x float> %in1) {
217 ; CHECK-LABEL: @llvm_maxnum_f32(
218 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @llvm.maxnum.v4f32(<4 x float> [[IN0:%.*]], <4 x float> [[IN1:%.*]])
219 ; CHECK-NEXT: ret <4 x float> [[TMP1]]
221 %1 = call fast <4 x float> @llvm.maxnum.v4f32(<4 x float> %in0, <4 x float> %in1)
225 define <2 x double> @llvm_minnum_f64(<2 x double> %in0, <2 x double> %in1) {
226 ; CHECK-LABEL: @llvm_minnum_f64(
227 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @llvm.minnum.v2f64(<2 x double> [[IN0:%.*]], <2 x double> [[IN1:%.*]])
228 ; CHECK-NEXT: ret <2 x double> [[TMP1]]
230 %1 = call fast <2 x double> @llvm.minnum.v2f64(<2 x double> %in0, <2 x double> %in1)
234 define <4 x float> @llvm_minnum_f32(<4 x float> %in0, <4 x float> %in1) {
235 ; CHECK-LABEL: @llvm_minnum_f32(
236 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @llvm.minnum.v4f32(<4 x float> [[IN0:%.*]], <4 x float> [[IN1:%.*]])
237 ; CHECK-NEXT: ret <4 x float> [[TMP1]]
239 %1 = call fast <4 x float> @llvm.minnum.v4f32(<4 x float> %in0, <4 x float> %in1)
243 define <2 x double> @llvm_nearbyint_f64(<2 x double> %in) {
244 ; CHECK-LABEL: @llvm_nearbyint_f64(
245 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @llvm.nearbyint.v2f64(<2 x double> [[IN:%.*]])
246 ; CHECK-NEXT: ret <2 x double> [[TMP1]]
248 %1 = call fast <2 x double> @llvm.nearbyint.v2f64(<2 x double> %in)
252 define <4 x float> @llvm_nearbyint_f32(<4 x float> %in) {
253 ; CHECK-LABEL: @llvm_nearbyint_f32(
254 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @llvm.nearbyint.v4f32(<4 x float> [[IN:%.*]])
255 ; CHECK-NEXT: ret <4 x float> [[TMP1]]
257 %1 = call fast <4 x float> @llvm.nearbyint.v4f32(<4 x float> %in)
261 define <2 x double> @llvm_pow_f64(<2 x double> %in, <2 x double> %pow) {
262 ; CHECK-LABEL: @llvm_pow_f64(
263 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @llvm.pow.v2f64(<2 x double> [[IN:%.*]], <2 x double> [[POW:%.*]])
264 ; CHECK-NEXT: ret <2 x double> [[TMP1]]
266 %1 = call fast <2 x double> @llvm.pow.v2f64(<2 x double> %in, <2 x double> %pow)
270 define <4 x float> @llvm_pow_f32(<4 x float> %in, <4 x float> %pow) {
271 ; CHECK-LABEL: @llvm_pow_f32(
272 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @llvm.pow.v4f32(<4 x float> [[IN:%.*]], <4 x float> [[POW:%.*]])
273 ; CHECK-NEXT: ret <4 x float> [[TMP1]]
275 %1 = call fast <4 x float> @llvm.pow.v4f32(<4 x float> %in, <4 x float> %pow)
279 define <2 x double> @llvm_rint_f64(<2 x double> %in) {
280 ; CHECK-LABEL: @llvm_rint_f64(
281 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @llvm.rint.v2f64(<2 x double> [[IN:%.*]])
282 ; CHECK-NEXT: ret <2 x double> [[TMP1]]
284 %1 = call fast <2 x double> @llvm.rint.v2f64(<2 x double> %in)
288 define <4 x float> @llvm_rint_f32(<4 x float> %in) {
289 ; CHECK-LABEL: @llvm_rint_f32(
290 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @llvm.rint.v4f32(<4 x float> [[IN:%.*]])
291 ; CHECK-NEXT: ret <4 x float> [[TMP1]]
293 %1 = call fast <4 x float> @llvm.rint.v4f32(<4 x float> %in)
297 define <2 x double> @llvm_round_f64(<2 x double> %in) {
298 ; CHECK-LABEL: @llvm_round_f64(
299 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @llvm.round.v2f64(<2 x double> [[IN:%.*]])
300 ; CHECK-NEXT: ret <2 x double> [[TMP1]]
302 %1 = call fast <2 x double> @llvm.round.v2f64(<2 x double> %in)
306 define <4 x float> @llvm_round_f32(<4 x float> %in) {
307 ; CHECK-LABEL: @llvm_round_f32(
308 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @llvm.round.v4f32(<4 x float> [[IN:%.*]])
309 ; CHECK-NEXT: ret <4 x float> [[TMP1]]
311 %1 = call fast <4 x float> @llvm.round.v4f32(<4 x float> %in)
315 define <2 x double> @llvm_sin_f64(<2 x double> %in) {
316 ; CHECK-LABEL: @llvm_sin_f64(
317 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @_ZGVnN2v_sin(<2 x double> [[IN:%.*]])
318 ; CHECK-NEXT: ret <2 x double> [[TMP1]]
320 %1 = call fast <2 x double> @llvm.sin.v2f64(<2 x double> %in)
324 define <4 x float> @llvm_sin_f32(<4 x float> %in) {
325 ; CHECK-LABEL: @llvm_sin_f32(
326 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @_ZGVnN4v_sinf(<4 x float> [[IN:%.*]])
327 ; CHECK-NEXT: ret <4 x float> [[TMP1]]
329 %1 = call fast <4 x float> @llvm.sin.v4f32(<4 x float> %in)
333 define <2 x double> @llvm_sqrt_f64(<2 x double> %in) {
334 ; CHECK-LABEL: @llvm_sqrt_f64(
335 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @llvm.sqrt.v2f64(<2 x double> [[IN:%.*]])
336 ; CHECK-NEXT: ret <2 x double> [[TMP1]]
338 %1 = call fast <2 x double> @llvm.sqrt.v2f64(<2 x double> %in)
342 define <4 x float> @llvm_sqrt_f32(<4 x float> %in) {
343 ; CHECK-LABEL: @llvm_sqrt_f32(
344 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @llvm.sqrt.v4f32(<4 x float> [[IN:%.*]])
345 ; CHECK-NEXT: ret <4 x float> [[TMP1]]
347 %1 = call fast <4 x float> @llvm.sqrt.v4f32(<4 x float> %in)
351 define <2 x double> @llvm_trunc_f64(<2 x double> %in) {
352 ; CHECK-LABEL: @llvm_trunc_f64(
353 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @llvm.trunc.v2f64(<2 x double> [[IN:%.*]])
354 ; CHECK-NEXT: ret <2 x double> [[TMP1]]
356 %1 = call fast <2 x double> @llvm.trunc.v2f64(<2 x double> %in)
360 define <4 x float> @llvm_trunc_f32(<4 x float> %in) {
361 ; CHECK-LABEL: @llvm_trunc_f32(
362 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @llvm.trunc.v4f32(<4 x float> [[IN:%.*]])
363 ; CHECK-NEXT: ret <4 x float> [[TMP1]]
365 %1 = call fast <4 x float> @llvm.trunc.v4f32(<4 x float> %in)
369 declare <2 x double> @llvm.ceil.v2f64(<2 x double>)
370 declare <4 x float> @llvm.ceil.v4f32(<4 x float>)
371 declare <2 x double> @llvm.copysign.v2f64(<2 x double>, <2 x double>)
372 declare <4 x float> @llvm.copysign.v4f32(<4 x float>, <4 x float>)
373 declare <2 x double> @llvm.cos.v2f64(<2 x double>)
374 declare <4 x float> @llvm.cos.v4f32(<4 x float>)
375 declare <2 x double> @llvm.exp.v2f64(<2 x double>)
376 declare <4 x float> @llvm.exp.v4f32(<4 x float>)
377 declare <2 x double> @llvm.exp2.v2f64(<2 x double>)
378 declare <4 x float> @llvm.exp2.v4f32(<4 x float>)
379 declare <2 x double> @llvm.fabs.v2f64(<2 x double>)
380 declare <4 x float> @llvm.fabs.v4f32(<4 x float>)
381 declare <2 x double> @llvm.floor.v2f64(<2 x double>)
382 declare <4 x float> @llvm.floor.v4f32(<4 x float>)
383 declare <2 x double> @llvm.fma.v2f64(<2 x double>, <2 x double>, <2 x double>)
384 declare <4 x float> @llvm.fma.v4f32(<4 x float>, <4 x float>, <4 x float>)
385 declare <2 x double> @llvm.log.v2f64(<2 x double>)
386 declare <4 x float> @llvm.log.v4f32(<4 x float>)
387 declare <2 x double> @llvm.log10.v2f64(<2 x double>)
388 declare <4 x float> @llvm.log10.v4f32(<4 x float>)
389 declare <2 x double> @llvm.log2.v2f64(<2 x double>)
390 declare <4 x float> @llvm.log2.v4f32(<4 x float>)
391 declare <2 x double> @llvm.maxnum.v2f64(<2 x double>, <2 x double>)
392 declare <4 x float> @llvm.maxnum.v4f32(<4 x float>, <4 x float>)
393 declare <2 x double> @llvm.minnum.v2f64(<2 x double>, <2 x double>)
394 declare <4 x float> @llvm.minnum.v4f32(<4 x float>, <4 x float>)
395 declare <2 x double> @llvm.nearbyint.v2f64(<2 x double>)
396 declare <4 x float> @llvm.nearbyint.v4f32(<4 x float>)
397 declare <2 x double> @llvm.pow.v2f64(<2 x double>, <2 x double>)
398 declare <4 x float> @llvm.pow.v4f32(<4 x float>, <4 x float>)
399 declare <2 x double> @llvm.rint.v2f64(<2 x double>)
400 declare <4 x float> @llvm.rint.v4f32(<4 x float>)
401 declare <2 x double> @llvm.round.v2f64(<2 x double>)
402 declare <4 x float> @llvm.round.v4f32(<4 x float>)
403 declare <2 x double> @llvm.sin.v2f64(<2 x double>)
404 declare <4 x float> @llvm.sin.v4f32(<4 x float>)
405 declare <2 x double> @llvm.sqrt.v2f64(<2 x double>)
406 declare <4 x float> @llvm.sqrt.v4f32(<4 x float>)
407 declare <2 x double> @llvm.trunc.v2f64(<2 x double>)
408 declare <4 x float> @llvm.trunc.v4f32(<4 x float>)
410 ; CHECK: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }