[PowerPC] Generate Power9 extswsli extend sign and shift immediate instruction
[llvm-core.git] / test / CodeGen / AArch64 / arm64-vfloatintrinsics.ll
blob4e1de87f586557fb1bb6c2ea20b2e94b01c3ac6d
1 ; RUN: llc < %s -mtriple=arm64-eabi -aarch64-neon-syntax=apple -mattr=-fullfp16 | FileCheck %s
2 ; RUN: llc < %s -mtriple=arm64-eabi -aarch64-neon-syntax=apple -mattr=+fullfp16 | FileCheck %s --check-prefix=CHECK-FP16
4 ;;; Float vectors
6 %v2f32 = type <2 x float>
7 %v4f16 = type <4 x half>
8 %v8f16 = type <8 x half>
10 ; CHECK-LABEL: test_v2f32.sqrt:
11 define %v2f32 @test_v2f32.sqrt(%v2f32 %a) {
12   ; CHECK: fsqrt.2s
13   %1 = call %v2f32 @llvm.sqrt.v2f32(%v2f32 %a)
14   ret %v2f32 %1
16 define %v4f16 @test_v4f16.sqrt(%v4f16 %a) {
17 ; CHECK-LABEL: test_v4f16.sqrt:
18 ; CHECK:       fsqrt s{{.}}, s{{.}}
19 ; CHECK:       fsqrt s{{.}}, s{{.}}
20 ; CHECK:       fsqrt s{{.}}, s{{.}}
21 ; CHECK:       fsqrt s{{.}}, s{{.}}
23 ; CHECK-FP16-LABEL: test_v4f16.sqrt:
24 ; CHECK-FP16-NOT:   fcvt
25 ; CHECK-FP16:       fsqrt.4h
26 ; CHECK-FP16-NEXT:  ret
27   %1 = call %v4f16 @llvm.sqrt.v4f16(%v4f16 %a)
28   ret %v4f16 %1
30 define %v8f16 @test_v8f16.sqrt(%v8f16 %a) {
31 ; Filechecks are unwieldy with 16 fcvt and 8 fsqrt tests, so skipped for -fullfp16.
33 ; CHECK-FP16-LABEL: test_v8f16.sqrt:
34 ; CHECK-FP16-NOT:   fcvt
35 ; CHECK-FP16:       fsqrt.8h
36 ; CHECK-FP16-NEXT:  ret
37   %1 = call %v8f16 @llvm.sqrt.v8f16(%v8f16 %a)
38   ret %v8f16 %1
40 ; CHECK: test_v2f32.powi:
41 define %v2f32 @test_v2f32.powi(%v2f32 %a, i32 %b) {
42   ; CHECK: pow
43   %1 = call %v2f32 @llvm.powi.v2f32(%v2f32 %a, i32 %b)
44   ret %v2f32 %1
46 ; CHECK: test_v2f32.sin:
47 define %v2f32 @test_v2f32.sin(%v2f32 %a) {
48   ; CHECK: sin
49   %1 = call %v2f32 @llvm.sin.v2f32(%v2f32 %a)
50   ret %v2f32 %1
52 ; CHECK: test_v2f32.cos:
53 define %v2f32 @test_v2f32.cos(%v2f32 %a) {
54   ; CHECK: cos
55   %1 = call %v2f32 @llvm.cos.v2f32(%v2f32 %a)
56   ret %v2f32 %1
58 ; CHECK: test_v2f32.pow:
59 define %v2f32 @test_v2f32.pow(%v2f32 %a, %v2f32 %b) {
60   ; CHECK: pow
61   %1 = call %v2f32 @llvm.pow.v2f32(%v2f32 %a, %v2f32 %b)
62   ret %v2f32 %1
64 ; CHECK: test_v2f32.exp:
65 define %v2f32 @test_v2f32.exp(%v2f32 %a) {
66   ; CHECK: exp
67   %1 = call %v2f32 @llvm.exp.v2f32(%v2f32 %a)
68   ret %v2f32 %1
70 ; CHECK: test_v2f32.exp2:
71 define %v2f32 @test_v2f32.exp2(%v2f32 %a) {
72   ; CHECK: exp
73   %1 = call %v2f32 @llvm.exp2.v2f32(%v2f32 %a)
74   ret %v2f32 %1
76 ; CHECK: test_v2f32.log:
77 define %v2f32 @test_v2f32.log(%v2f32 %a) {
78   ; CHECK: log
79   %1 = call %v2f32 @llvm.log.v2f32(%v2f32 %a)
80   ret %v2f32 %1
82 ; CHECK: test_v2f32.log10:
83 define %v2f32 @test_v2f32.log10(%v2f32 %a) {
84   ; CHECK: log
85   %1 = call %v2f32 @llvm.log10.v2f32(%v2f32 %a)
86   ret %v2f32 %1
88 ; CHECK: test_v2f32.log2:
89 define %v2f32 @test_v2f32.log2(%v2f32 %a) {
90   ; CHECK: log
91   %1 = call %v2f32 @llvm.log2.v2f32(%v2f32 %a)
92   ret %v2f32 %1
94 ; CHECK-LABEL: test_v2f32.fma:
95 define %v2f32 @test_v2f32.fma(%v2f32 %a, %v2f32 %b, %v2f32 %c) {
96   ; CHECK: fmla.2s
97   %1 = call %v2f32 @llvm.fma.v2f32(%v2f32 %a, %v2f32 %b, %v2f32 %c)
98   ret %v2f32 %1
100 define %v4f16 @test_v4f16.fma(%v4f16 %a, %v4f16 %b, %v4f16 %c) {
101 ; CHECK-LABEL: test_v4f16.fma:
102 ; CHECK:       fmadd s{{.}}, s{{.}}, s{{.}}, s{{.}}
103 ; CHECK:       fmadd s{{.}}, s{{.}}, s{{.}}, s{{.}}
104 ; CHECK:       fmadd s{{.}}, s{{.}}, s{{.}}, s{{.}}
105 ; CHECK:       fmadd s{{.}}, s{{.}}, s{{.}}, s{{.}}
107 ; CHECK-FP16-LABEL: test_v4f16.fma:
108 ; CHECK-FP16-NOT:   fcvt
109 ; CHECK-FP16:       fmla.4h
110   %1 = call %v4f16 @llvm.fma.v4f16(%v4f16 %a, %v4f16 %b, %v4f16 %c)
111   ret %v4f16 %1
113 define %v8f16 @test_v8f16.fma(%v8f16 %a, %v8f16 %b, %v8f16 %c) {
114 ; Filechecks are unwieldy with 16 fcvt and 8 fma tests, so skipped for -fullfp16.
116 ; CHECK-FP16-LABEL: test_v8f16.fma:
117 ; CHECK-FP16-NOT:   fcvt
118 ; CHECK-FP16:       fmla.8h
119   %1 = call %v8f16 @llvm.fma.v8f16(%v8f16 %a, %v8f16 %b, %v8f16 %c)
120   ret %v8f16 %1
122 ; CHECK-LABEL: test_v2f32.fabs:
123 define %v2f32 @test_v2f32.fabs(%v2f32 %a) {
124   ; CHECK: fabs.2s
125   %1 = call %v2f32 @llvm.fabs.v2f32(%v2f32 %a)
126   ret %v2f32 %1
128 define %v4f16 @test_v4f16.fabs(%v4f16 %a) {
129 ; CHECK-LABEL: test_v4f16.fabs:
130 ; CHECK:       fabs s{{.}}, s{{.}}
131 ; CHECK:       fabs s{{.}}, s{{.}}
132 ; CHECK:       fabs s{{.}}, s{{.}}
133 ; CHECK:       fabs s{{.}}, s{{.}}
135 ; CHECK-FP16-LABEL: test_v4f16.fabs:
136 ; CHECK-FP16-NOT:   fcvt
137 ; CHECK-FP16:       fabs.4h
138 ; CHECK-FP16-NEXT:  ret
139   %1 = call %v4f16 @llvm.fabs.v4f16(%v4f16 %a)
140   ret %v4f16 %1
142 define %v8f16 @test_v8f16.fabs(%v8f16 %a) {
143 ; Filechecks are unwieldy with 16 fcvt and 8 fabs tests, so skipped for -fullfp16.
145 ; CHECK-FP16-LABEL: test_v8f16.fabs:
146 ; CHECK-FP16-NOT:   fcvt
147 ; CHECK-FP16:       fabs.8h
148 ; CHECK-FP16-NEXT:  ret
149   %1 = call %v8f16 @llvm.fabs.v8f16(%v8f16 %a)
150   ret %v8f16 %1
152 ; CHECK-LABEL: test_v2f32.floor:
153 define %v2f32 @test_v2f32.floor(%v2f32 %a) {
154   ; CHECK: frintm.2s
155   %1 = call %v2f32 @llvm.floor.v2f32(%v2f32 %a)
156   ret %v2f32 %1
158 define %v4f16 @test_v4f16.floor(%v4f16 %a) {
159 ; CHECK-LABEL: test_v4f16.floor:
160 ; CHECK:       frintm s{{.}}, s{{.}}
161 ; CHECK:       frintm s{{.}}, s{{.}}
162 ; CHECK:       frintm s{{.}}, s{{.}}
163 ; CHECK:       frintm s{{.}}, s{{.}}
165 ; CHECK-FP16-LABEL: test_v4f16.floor:
166 ; CHECK-FP16-NOT:   fcvt
167 ; CHECK-FP16:       frintm.4h
168 ; CHECK-FP16-NEXT:  ret
169   %1 = call %v4f16 @llvm.floor.v4f16(%v4f16 %a)
170   ret %v4f16 %1
172 define %v8f16 @test_v8f16.floor(%v8f16 %a) {
173 ; Filechecks are unwieldy with 16 fcvt and 8 frintm tests, so skipped for -fullfp16.
175 ; CHECK-FP16-LABEL: test_v8f16.floor:
176 ; CHECK-FP16-NOT:   fcvt
177 ; CHECK-FP16:       frintm.8h
178 ; CHECK-FP16-NEXT:  ret
179   %1 = call %v8f16 @llvm.floor.v8f16(%v8f16 %a)
180   ret %v8f16 %1
182 ; CHECK-LABEL: test_v2f32.ceil:
183 define %v2f32 @test_v2f32.ceil(%v2f32 %a) {
184   ; CHECK: frintp.2s
185   %1 = call %v2f32 @llvm.ceil.v2f32(%v2f32 %a)
186   ret %v2f32 %1
188 define %v4f16 @test_v4f16.ceil(%v4f16 %a) {
189 ; CHECK-LABEL: test_v4f16.ceil:
190 ; CHECK:       frintp s{{.}}, s{{.}}
191 ; CHECK:       frintp s{{.}}, s{{.}}
192 ; CHECK:       frintp s{{.}}, s{{.}}
193 ; CHECK:       frintp s{{.}}, s{{.}}
195 ; CHECK-FP16-LABEL: test_v4f16.ceil:
196 ; CHECK-FP16-NOT:   fcvt
197 ; CHECK-FP16:       frintp.4h
198 ; CHECK-FP16-NEXT:  ret
199   %1 = call %v4f16 @llvm.ceil.v4f16(%v4f16 %a)
200   ret %v4f16 %1
202 define %v8f16 @test_v8f16.ceil(%v8f16 %a) {
203 ; Filechecks are unwieldy with 16 fcvt and 8 frint tests, so skipped for -fullfp16.
205 ; CHECK-FP16-LABEL: test_v8f16.ceil:
206 ; CHECK-FP16-NOT:   fcvt
207 ; CHECK-FP16:       frintp.8h
208 ; CHECK-FP16-NEXT:  ret
209   %1 = call %v8f16 @llvm.ceil.v8f16(%v8f16 %a)
210   ret %v8f16 %1
212 ; CHECK-LABEL: test_v2f32.trunc:
213 define %v2f32 @test_v2f32.trunc(%v2f32 %a) {
214   ; CHECK: frintz.2s
215   %1 = call %v2f32 @llvm.trunc.v2f32(%v2f32 %a)
216   ret %v2f32 %1
218 define %v4f16 @test_v4f16.trunc(%v4f16 %a) {
219 ; CHECK-LABEL: test_v4f16.trunc:
220 ; CHECK:       frintz s{{.}}, s{{.}}
221 ; CHECK:       frintz s{{.}}, s{{.}}
222 ; CHECK:       frintz s{{.}}, s{{.}}
223 ; CHECK:       frintz s{{.}}, s{{.}}
225 ; CHECK-FP16-LABEL: test_v4f16.trunc:
226 ; CHECK-FP16:       frintz.4h
227 ; CHECK-FP16-NEXT:  ret
228   %1 = call %v4f16 @llvm.trunc.v4f16(%v4f16 %a)
229   ret %v4f16 %1
231 define %v8f16 @test_v8f16.trunc(%v8f16 %a) {
232 ; Filechecks are unwieldy with 16 fcvt and 8 frint tests, so skipped for -fullfp16.
234 ; CHECK-FP16-LABEL: test_v8f16.trunc:
235 ; CHECK-FP16-NOT:   fcvt
236 ; CHECK-FP16:       frintz.8h
237 ; CHECK-FP16-NEXT:  ret
238   %1 = call %v8f16 @llvm.trunc.v8f16(%v8f16 %a)
239   ret %v8f16 %1
241 ; CHECK-LABEL: test_v2f32.rint:
242 define %v2f32 @test_v2f32.rint(%v2f32 %a) {
243   ; CHECK: frintx.2s
244   %1 = call %v2f32 @llvm.rint.v2f32(%v2f32 %a)
245   ret %v2f32 %1
247 define %v4f16 @test_v4f16.rint(%v4f16 %a) {
248 ; CHECK-LABEL: test_v4f16.rint:
249 ; CHECK:       frintx s{{.}}, s{{.}}
250 ; CHECK:       frintx s{{.}}, s{{.}}
251 ; CHECK:       frintx s{{.}}, s{{.}}
252 ; CHECK:       frintx s{{.}}, s{{.}}
254 ; CHECK-FP16-LABEL: test_v4f16.rint:
255 ; CHECK-FP16-NOT:   fcvt
256 ; CHECK-FP16:       frintx.4h
257 ; CHECK-FP16-NEXT:  ret
258   %1 = call %v4f16 @llvm.rint.v4f16(%v4f16 %a)
259   ret %v4f16 %1
261 define %v8f16 @test_v8f16.rint(%v8f16 %a) {
262 ; Filechecks are unwieldy with 16 fcvt and 8 frint tests, so skipped for -fullfp16.
264 ; CHECK-FP16-LABEL: test_v8f16.rint:
265 ; CHECK-FP16:       frintx.8h
266 ; CHECK-FP16-NEXT:  ret
267   %1 = call %v8f16 @llvm.rint.v8f16(%v8f16 %a)
268   ret %v8f16 %1
270 ; CHECK-LABEL: test_v2f32.nearbyint:
271 define %v2f32 @test_v2f32.nearbyint(%v2f32 %a) {
272   ; CHECK: frinti.2s
273   %1 = call %v2f32 @llvm.nearbyint.v2f32(%v2f32 %a)
274   ret %v2f32 %1
276 define %v4f16 @test_v4f16.nearbyint(%v4f16 %a) {
277 ; CHECK-LABEL: test_v4f16.nearbyint:
278 ; CHECK:       frinti s{{.}}, s{{.}}
279 ; CHECK:       frinti s{{.}}, s{{.}}
280 ; CHECK:       frinti s{{.}}, s{{.}}
281 ; CHECK:       frinti s{{.}}, s{{.}}
283 ; CHECK-FP16-LABEL: test_v4f16.nearbyint:
284 ; CHECK-FP16-NOT:   fcvt
285 ; CHECK-FP16:       frinti.4h
286 ; CHECK-FP16-NEXT:  ret
287   %1 = call %v4f16 @llvm.nearbyint.v4f16(%v4f16 %a)
288   ret %v4f16 %1
290 define %v8f16 @test_v8f16.nearbyint(%v8f16 %a) {
291 ; Filechecks are unwieldy with 16 fcvt and 8 frint tests, so skipped for -fullfp16.
293 ; CHECK-FP16-LABEL: test_v8f16.nearbyint:
294 ; CHECK-FP16-NOT:   fcvt
295 ; CHECK-FP16:       frinti.8h
296 ; CHECK-FP16-NEXT:  ret
297   %1 = call %v8f16 @llvm.nearbyint.v8f16(%v8f16 %a)
298   ret %v8f16 %1
301 declare %v2f32 @llvm.sqrt.v2f32(%v2f32) #0
302 declare %v4f16 @llvm.sqrt.v4f16(%v4f16) #0
303 declare %v8f16 @llvm.sqrt.v8f16(%v8f16) #0
305 declare %v2f32 @llvm.powi.v2f32(%v2f32, i32) #0
306 declare %v2f32 @llvm.sin.v2f32(%v2f32) #0
307 declare %v2f32 @llvm.cos.v2f32(%v2f32) #0
308 declare %v2f32 @llvm.pow.v2f32(%v2f32, %v2f32) #0
309 declare %v2f32 @llvm.exp.v2f32(%v2f32) #0
310 declare %v2f32 @llvm.exp2.v2f32(%v2f32) #0
311 declare %v2f32 @llvm.log.v2f32(%v2f32) #0
312 declare %v2f32 @llvm.log10.v2f32(%v2f32) #0
313 declare %v2f32 @llvm.log2.v2f32(%v2f32) #0
315 declare %v2f32 @llvm.fma.v2f32(%v2f32, %v2f32, %v2f32) #0
316 declare %v4f16 @llvm.fma.v4f16(%v4f16, %v4f16, %v4f16) #0
317 declare %v8f16 @llvm.fma.v8f16(%v8f16, %v8f16, %v8f16) #0
319 declare %v2f32 @llvm.fabs.v2f32(%v2f32) #0
320 declare %v4f16 @llvm.fabs.v4f16(%v4f16) #0
321 declare %v8f16 @llvm.fabs.v8f16(%v8f16) #0
323 declare %v2f32 @llvm.floor.v2f32(%v2f32) #0
324 declare %v4f16 @llvm.floor.v4f16(%v4f16) #0
325 declare %v8f16 @llvm.floor.v8f16(%v8f16) #0
327 declare %v2f32 @llvm.ceil.v2f32(%v2f32) #0
328 declare %v4f16 @llvm.ceil.v4f16(%v4f16) #0
329 declare %v8f16 @llvm.ceil.v8f16(%v8f16) #0
331 declare %v2f32 @llvm.trunc.v2f32(%v2f32) #0
332 declare %v4f16 @llvm.trunc.v4f16(%v4f16) #0
333 declare %v8f16 @llvm.trunc.v8f16(%v8f16) #0
335 declare %v2f32 @llvm.rint.v2f32(%v2f32) #0
336 declare %v4f16 @llvm.rint.v4f16(%v4f16) #0
337 declare %v8f16 @llvm.rint.v8f16(%v8f16) #0
339 declare %v2f32 @llvm.nearbyint.v2f32(%v2f32) #0
340 declare %v4f16 @llvm.nearbyint.v4f16(%v4f16) #0
341 declare %v8f16 @llvm.nearbyint.v8f16(%v8f16) #0
345 %v4f32 = type <4 x float>
346 ; CHECK: test_v4f32.sqrt:
347 define %v4f32 @test_v4f32.sqrt(%v4f32 %a) {
348   ; CHECK: fsqrt.4s
349   %1 = call %v4f32 @llvm.sqrt.v4f32(%v4f32 %a)
350   ret %v4f32 %1
352 ; CHECK: test_v4f32.powi:
353 define %v4f32 @test_v4f32.powi(%v4f32 %a, i32 %b) {
354   ; CHECK: pow
355   %1 = call %v4f32 @llvm.powi.v4f32(%v4f32 %a, i32 %b)
356   ret %v4f32 %1
358 ; CHECK: test_v4f32.sin:
359 define %v4f32 @test_v4f32.sin(%v4f32 %a) {
360   ; CHECK: sin
361   %1 = call %v4f32 @llvm.sin.v4f32(%v4f32 %a)
362   ret %v4f32 %1
364 ; CHECK: test_v4f32.cos:
365 define %v4f32 @test_v4f32.cos(%v4f32 %a) {
366   ; CHECK: cos
367   %1 = call %v4f32 @llvm.cos.v4f32(%v4f32 %a)
368   ret %v4f32 %1
370 ; CHECK: test_v4f32.pow:
371 define %v4f32 @test_v4f32.pow(%v4f32 %a, %v4f32 %b) {
372   ; CHECK: pow
373   %1 = call %v4f32 @llvm.pow.v4f32(%v4f32 %a, %v4f32 %b)
374   ret %v4f32 %1
376 ; CHECK: test_v4f32.exp:
377 define %v4f32 @test_v4f32.exp(%v4f32 %a) {
378   ; CHECK: exp
379   %1 = call %v4f32 @llvm.exp.v4f32(%v4f32 %a)
380   ret %v4f32 %1
382 ; CHECK: test_v4f32.exp2:
383 define %v4f32 @test_v4f32.exp2(%v4f32 %a) {
384   ; CHECK: exp
385   %1 = call %v4f32 @llvm.exp2.v4f32(%v4f32 %a)
386   ret %v4f32 %1
388 ; CHECK: test_v4f32.log:
389 define %v4f32 @test_v4f32.log(%v4f32 %a) {
390   ; CHECK: log
391   %1 = call %v4f32 @llvm.log.v4f32(%v4f32 %a)
392   ret %v4f32 %1
394 ; CHECK: test_v4f32.log10:
395 define %v4f32 @test_v4f32.log10(%v4f32 %a) {
396   ; CHECK: log
397   %1 = call %v4f32 @llvm.log10.v4f32(%v4f32 %a)
398   ret %v4f32 %1
400 ; CHECK: test_v4f32.log2:
401 define %v4f32 @test_v4f32.log2(%v4f32 %a) {
402   ; CHECK: log
403   %1 = call %v4f32 @llvm.log2.v4f32(%v4f32 %a)
404   ret %v4f32 %1
406 ; CHECK: test_v4f32.fma:
407 define %v4f32 @test_v4f32.fma(%v4f32 %a, %v4f32 %b, %v4f32 %c) {
408   ; CHECK: fma
409   %1 = call %v4f32 @llvm.fma.v4f32(%v4f32 %a, %v4f32 %b, %v4f32 %c)
410   ret %v4f32 %1
412 ; CHECK: test_v4f32.fabs:
413 define %v4f32 @test_v4f32.fabs(%v4f32 %a) {
414   ; CHECK: fabs
415   %1 = call %v4f32 @llvm.fabs.v4f32(%v4f32 %a)
416   ret %v4f32 %1
418 ; CHECK: test_v4f32.floor:
419 define %v4f32 @test_v4f32.floor(%v4f32 %a) {
420   ; CHECK: frintm.4s
421   %1 = call %v4f32 @llvm.floor.v4f32(%v4f32 %a)
422   ret %v4f32 %1
424 ; CHECK: test_v4f32.ceil:
425 define %v4f32 @test_v4f32.ceil(%v4f32 %a) {
426   ; CHECK: frintp.4s
427   %1 = call %v4f32 @llvm.ceil.v4f32(%v4f32 %a)
428   ret %v4f32 %1
430 ; CHECK: test_v4f32.trunc:
431 define %v4f32 @test_v4f32.trunc(%v4f32 %a) {
432   ; CHECK: frintz.4s
433   %1 = call %v4f32 @llvm.trunc.v4f32(%v4f32 %a)
434   ret %v4f32 %1
436 ; CHECK: test_v4f32.rint:
437 define %v4f32 @test_v4f32.rint(%v4f32 %a) {
438   ; CHECK: frintx.4s
439   %1 = call %v4f32 @llvm.rint.v4f32(%v4f32 %a)
440   ret %v4f32 %1
442 ; CHECK: test_v4f32.nearbyint:
443 define %v4f32 @test_v4f32.nearbyint(%v4f32 %a) {
444   ; CHECK: frinti.4s
445   %1 = call %v4f32 @llvm.nearbyint.v4f32(%v4f32 %a)
446   ret %v4f32 %1
449 declare %v4f32 @llvm.sqrt.v4f32(%v4f32) #0
450 declare %v4f32 @llvm.powi.v4f32(%v4f32, i32) #0
451 declare %v4f32 @llvm.sin.v4f32(%v4f32) #0
452 declare %v4f32 @llvm.cos.v4f32(%v4f32) #0
453 declare %v4f32 @llvm.pow.v4f32(%v4f32, %v4f32) #0
454 declare %v4f32 @llvm.exp.v4f32(%v4f32) #0
455 declare %v4f32 @llvm.exp2.v4f32(%v4f32) #0
456 declare %v4f32 @llvm.log.v4f32(%v4f32) #0
457 declare %v4f32 @llvm.log10.v4f32(%v4f32) #0
458 declare %v4f32 @llvm.log2.v4f32(%v4f32) #0
459 declare %v4f32 @llvm.fma.v4f32(%v4f32, %v4f32, %v4f32) #0
460 declare %v4f32 @llvm.fabs.v4f32(%v4f32) #0
461 declare %v4f32 @llvm.floor.v4f32(%v4f32) #0
462 declare %v4f32 @llvm.ceil.v4f32(%v4f32) #0
463 declare %v4f32 @llvm.trunc.v4f32(%v4f32) #0
464 declare %v4f32 @llvm.rint.v4f32(%v4f32) #0
465 declare %v4f32 @llvm.nearbyint.v4f32(%v4f32) #0
467 ;;; Double vector
469 %v2f64 = type <2 x double>
470 ; CHECK: test_v2f64.sqrt:
471 define %v2f64 @test_v2f64.sqrt(%v2f64 %a) {
472   ; CHECK: fsqrt.2d
473   %1 = call %v2f64 @llvm.sqrt.v2f64(%v2f64 %a)
474   ret %v2f64 %1
476 ; CHECK: test_v2f64.powi:
477 define %v2f64 @test_v2f64.powi(%v2f64 %a, i32 %b) {
478   ; CHECK: pow
479   %1 = call %v2f64 @llvm.powi.v2f64(%v2f64 %a, i32 %b)
480   ret %v2f64 %1
482 ; CHECK: test_v2f64.sin:
483 define %v2f64 @test_v2f64.sin(%v2f64 %a) {
484   ; CHECK: sin
485   %1 = call %v2f64 @llvm.sin.v2f64(%v2f64 %a)
486   ret %v2f64 %1
488 ; CHECK: test_v2f64.cos:
489 define %v2f64 @test_v2f64.cos(%v2f64 %a) {
490   ; CHECK: cos
491   %1 = call %v2f64 @llvm.cos.v2f64(%v2f64 %a)
492   ret %v2f64 %1
494 ; CHECK: test_v2f64.pow:
495 define %v2f64 @test_v2f64.pow(%v2f64 %a, %v2f64 %b) {
496   ; CHECK: pow
497   %1 = call %v2f64 @llvm.pow.v2f64(%v2f64 %a, %v2f64 %b)
498   ret %v2f64 %1
500 ; CHECK: test_v2f64.exp:
501 define %v2f64 @test_v2f64.exp(%v2f64 %a) {
502   ; CHECK: exp
503   %1 = call %v2f64 @llvm.exp.v2f64(%v2f64 %a)
504   ret %v2f64 %1
506 ; CHECK: test_v2f64.exp2:
507 define %v2f64 @test_v2f64.exp2(%v2f64 %a) {
508   ; CHECK: exp
509   %1 = call %v2f64 @llvm.exp2.v2f64(%v2f64 %a)
510   ret %v2f64 %1
512 ; CHECK: test_v2f64.log:
513 define %v2f64 @test_v2f64.log(%v2f64 %a) {
514   ; CHECK: log
515   %1 = call %v2f64 @llvm.log.v2f64(%v2f64 %a)
516   ret %v2f64 %1
518 ; CHECK: test_v2f64.log10:
519 define %v2f64 @test_v2f64.log10(%v2f64 %a) {
520   ; CHECK: log
521   %1 = call %v2f64 @llvm.log10.v2f64(%v2f64 %a)
522   ret %v2f64 %1
524 ; CHECK: test_v2f64.log2:
525 define %v2f64 @test_v2f64.log2(%v2f64 %a) {
526   ; CHECK: log
527   %1 = call %v2f64 @llvm.log2.v2f64(%v2f64 %a)
528   ret %v2f64 %1
530 ; CHECK: test_v2f64.fma:
531 define %v2f64 @test_v2f64.fma(%v2f64 %a, %v2f64 %b, %v2f64 %c) {
532   ; CHECK: fma
533   %1 = call %v2f64 @llvm.fma.v2f64(%v2f64 %a, %v2f64 %b, %v2f64 %c)
534   ret %v2f64 %1
536 ; CHECK: test_v2f64.fabs:
537 define %v2f64 @test_v2f64.fabs(%v2f64 %a) {
538   ; CHECK: fabs
539   %1 = call %v2f64 @llvm.fabs.v2f64(%v2f64 %a)
540   ret %v2f64 %1
542 ; CHECK: test_v2f64.floor:
543 define %v2f64 @test_v2f64.floor(%v2f64 %a) {
544   ; CHECK: frintm.2d
545   %1 = call %v2f64 @llvm.floor.v2f64(%v2f64 %a)
546   ret %v2f64 %1
548 ; CHECK: test_v2f64.ceil:
549 define %v2f64 @test_v2f64.ceil(%v2f64 %a) {
550   ; CHECK: frintp.2d
551   %1 = call %v2f64 @llvm.ceil.v2f64(%v2f64 %a)
552   ret %v2f64 %1
554 ; CHECK: test_v2f64.trunc:
555 define %v2f64 @test_v2f64.trunc(%v2f64 %a) {
556   ; CHECK: frintz.2d
557   %1 = call %v2f64 @llvm.trunc.v2f64(%v2f64 %a)
558   ret %v2f64 %1
560 ; CHECK: test_v2f64.rint:
561 define %v2f64 @test_v2f64.rint(%v2f64 %a) {
562   ; CHECK: frintx.2d
563   %1 = call %v2f64 @llvm.rint.v2f64(%v2f64 %a)
564   ret %v2f64 %1
566 ; CHECK: test_v2f64.nearbyint:
567 define %v2f64 @test_v2f64.nearbyint(%v2f64 %a) {
568   ; CHECK: frinti.2d
569   %1 = call %v2f64 @llvm.nearbyint.v2f64(%v2f64 %a)
570   ret %v2f64 %1
573 declare %v2f64 @llvm.sqrt.v2f64(%v2f64) #0
574 declare %v2f64 @llvm.powi.v2f64(%v2f64, i32) #0
575 declare %v2f64 @llvm.sin.v2f64(%v2f64) #0
576 declare %v2f64 @llvm.cos.v2f64(%v2f64) #0
577 declare %v2f64 @llvm.pow.v2f64(%v2f64, %v2f64) #0
578 declare %v2f64 @llvm.exp.v2f64(%v2f64) #0
579 declare %v2f64 @llvm.exp2.v2f64(%v2f64) #0
580 declare %v2f64 @llvm.log.v2f64(%v2f64) #0
581 declare %v2f64 @llvm.log10.v2f64(%v2f64) #0
582 declare %v2f64 @llvm.log2.v2f64(%v2f64) #0
583 declare %v2f64 @llvm.fma.v2f64(%v2f64, %v2f64, %v2f64) #0
584 declare %v2f64 @llvm.fabs.v2f64(%v2f64) #0
585 declare %v2f64 @llvm.floor.v2f64(%v2f64) #0
586 declare %v2f64 @llvm.ceil.v2f64(%v2f64) #0
587 declare %v2f64 @llvm.trunc.v2f64(%v2f64) #0
588 declare %v2f64 @llvm.rint.v2f64(%v2f64) #0
589 declare %v2f64 @llvm.nearbyint.v2f64(%v2f64) #0
591 attributes #0 = { nounwind readonly }