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
3
4;;; Float vectors
5
6%v2f32 = type <2 x float>
7%v4f16 = type <4 x half>
8%v8f16 = type <8 x half>
9
10; CHECK-LABEL: test_v2f32.sqrt:
11define %v2f32 @test_v2f32.sqrt(%v2f32 %a) {
12  ; CHECK: fsqrt.2s
13  %1 = call %v2f32 @llvm.sqrt.v2f32(%v2f32 %a)
14  ret %v2f32 %1
15}
16define %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{{.}}
22
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
29}
30define %v8f16 @test_v8f16.sqrt(%v8f16 %a) {
31; Filechecks are unwieldy with 16 fcvt and 8 fsqrt tests, so skipped for -fullfp16.
32
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
39}
40; CHECK: test_v2f32.powi:
41define %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
45}
46; CHECK: test_v2f32.sin:
47define %v2f32 @test_v2f32.sin(%v2f32 %a) {
48  ; CHECK: sin
49  %1 = call %v2f32 @llvm.sin.v2f32(%v2f32 %a)
50  ret %v2f32 %1
51}
52; CHECK: test_v2f32.cos:
53define %v2f32 @test_v2f32.cos(%v2f32 %a) {
54  ; CHECK: cos
55  %1 = call %v2f32 @llvm.cos.v2f32(%v2f32 %a)
56  ret %v2f32 %1
57}
58; CHECK: test_v2f32.pow:
59define %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
63}
64; CHECK: test_v2f32.exp:
65define %v2f32 @test_v2f32.exp(%v2f32 %a) {
66  ; CHECK: exp
67  %1 = call %v2f32 @llvm.exp.v2f32(%v2f32 %a)
68  ret %v2f32 %1
69}
70; CHECK: test_v2f32.exp2:
71define %v2f32 @test_v2f32.exp2(%v2f32 %a) {
72  ; CHECK: exp
73  %1 = call %v2f32 @llvm.exp2.v2f32(%v2f32 %a)
74  ret %v2f32 %1
75}
76; CHECK: test_v2f32.log:
77define %v2f32 @test_v2f32.log(%v2f32 %a) {
78  ; CHECK: log
79  %1 = call %v2f32 @llvm.log.v2f32(%v2f32 %a)
80  ret %v2f32 %1
81}
82; CHECK: test_v2f32.log10:
83define %v2f32 @test_v2f32.log10(%v2f32 %a) {
84  ; CHECK: log
85  %1 = call %v2f32 @llvm.log10.v2f32(%v2f32 %a)
86  ret %v2f32 %1
87}
88; CHECK: test_v2f32.log2:
89define %v2f32 @test_v2f32.log2(%v2f32 %a) {
90  ; CHECK: log
91  %1 = call %v2f32 @llvm.log2.v2f32(%v2f32 %a)
92  ret %v2f32 %1
93}
94; CHECK-LABEL: test_v2f32.fma:
95define %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
99}
100define %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{{.}}
106
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
112}
113define %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.
115
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
121}
122; CHECK-LABEL: test_v2f32.fabs:
123define %v2f32 @test_v2f32.fabs(%v2f32 %a) {
124  ; CHECK: fabs.2s
125  %1 = call %v2f32 @llvm.fabs.v2f32(%v2f32 %a)
126  ret %v2f32 %1
127}
128define %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{{.}}
134
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
141}
142define %v8f16 @test_v8f16.fabs(%v8f16 %a) {
143; Filechecks are unwieldy with 16 fcvt and 8 fabs tests, so skipped for -fullfp16.
144
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
151}
152; CHECK-LABEL: test_v2f32.floor:
153define %v2f32 @test_v2f32.floor(%v2f32 %a) {
154  ; CHECK: frintm.2s
155  %1 = call %v2f32 @llvm.floor.v2f32(%v2f32 %a)
156  ret %v2f32 %1
157}
158define %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{{.}}
164
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
171}
172define %v8f16 @test_v8f16.floor(%v8f16 %a) {
173; Filechecks are unwieldy with 16 fcvt and 8 frintm tests, so skipped for -fullfp16.
174
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
181}
182; CHECK-LABEL: test_v2f32.ceil:
183define %v2f32 @test_v2f32.ceil(%v2f32 %a) {
184  ; CHECK: frintp.2s
185  %1 = call %v2f32 @llvm.ceil.v2f32(%v2f32 %a)
186  ret %v2f32 %1
187}
188define %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{{.}}
194
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
201}
202define %v8f16 @test_v8f16.ceil(%v8f16 %a) {
203; Filechecks are unwieldy with 16 fcvt and 8 frint tests, so skipped for -fullfp16.
204
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
211}
212; CHECK-LABEL: test_v2f32.trunc:
213define %v2f32 @test_v2f32.trunc(%v2f32 %a) {
214  ; CHECK: frintz.2s
215  %1 = call %v2f32 @llvm.trunc.v2f32(%v2f32 %a)
216  ret %v2f32 %1
217}
218define %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{{.}}
224
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
230}
231define %v8f16 @test_v8f16.trunc(%v8f16 %a) {
232; Filechecks are unwieldy with 16 fcvt and 8 frint tests, so skipped for -fullfp16.
233
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
240}
241; CHECK-LABEL: test_v2f32.rint:
242define %v2f32 @test_v2f32.rint(%v2f32 %a) {
243  ; CHECK: frintx.2s
244  %1 = call %v2f32 @llvm.rint.v2f32(%v2f32 %a)
245  ret %v2f32 %1
246}
247define %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{{.}}
253
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
260}
261define %v8f16 @test_v8f16.rint(%v8f16 %a) {
262; Filechecks are unwieldy with 16 fcvt and 8 frint tests, so skipped for -fullfp16.
263
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
269}
270; CHECK-LABEL: test_v2f32.nearbyint:
271define %v2f32 @test_v2f32.nearbyint(%v2f32 %a) {
272  ; CHECK: frinti.2s
273  %1 = call %v2f32 @llvm.nearbyint.v2f32(%v2f32 %a)
274  ret %v2f32 %1
275}
276define %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{{.}}
282
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
289}
290define %v8f16 @test_v8f16.nearbyint(%v8f16 %a) {
291; Filechecks are unwieldy with 16 fcvt and 8 frint tests, so skipped for -fullfp16.
292
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
299}
300
301declare %v2f32 @llvm.sqrt.v2f32(%v2f32) #0
302declare %v4f16 @llvm.sqrt.v4f16(%v4f16) #0
303declare %v8f16 @llvm.sqrt.v8f16(%v8f16) #0
304
305declare %v2f32 @llvm.powi.v2f32(%v2f32, i32) #0
306declare %v2f32 @llvm.sin.v2f32(%v2f32) #0
307declare %v2f32 @llvm.cos.v2f32(%v2f32) #0
308declare %v2f32 @llvm.pow.v2f32(%v2f32, %v2f32) #0
309declare %v2f32 @llvm.exp.v2f32(%v2f32) #0
310declare %v2f32 @llvm.exp2.v2f32(%v2f32) #0
311declare %v2f32 @llvm.log.v2f32(%v2f32) #0
312declare %v2f32 @llvm.log10.v2f32(%v2f32) #0
313declare %v2f32 @llvm.log2.v2f32(%v2f32) #0
314
315declare %v2f32 @llvm.fma.v2f32(%v2f32, %v2f32, %v2f32) #0
316declare %v4f16 @llvm.fma.v4f16(%v4f16, %v4f16, %v4f16) #0
317declare %v8f16 @llvm.fma.v8f16(%v8f16, %v8f16, %v8f16) #0
318
319declare %v2f32 @llvm.fabs.v2f32(%v2f32) #0
320declare %v4f16 @llvm.fabs.v4f16(%v4f16) #0
321declare %v8f16 @llvm.fabs.v8f16(%v8f16) #0
322
323declare %v2f32 @llvm.floor.v2f32(%v2f32) #0
324declare %v4f16 @llvm.floor.v4f16(%v4f16) #0
325declare %v8f16 @llvm.floor.v8f16(%v8f16) #0
326
327declare %v2f32 @llvm.ceil.v2f32(%v2f32) #0
328declare %v4f16 @llvm.ceil.v4f16(%v4f16) #0
329declare %v8f16 @llvm.ceil.v8f16(%v8f16) #0
330
331declare %v2f32 @llvm.trunc.v2f32(%v2f32) #0
332declare %v4f16 @llvm.trunc.v4f16(%v4f16) #0
333declare %v8f16 @llvm.trunc.v8f16(%v8f16) #0
334
335declare %v2f32 @llvm.rint.v2f32(%v2f32) #0
336declare %v4f16 @llvm.rint.v4f16(%v4f16) #0
337declare %v8f16 @llvm.rint.v8f16(%v8f16) #0
338
339declare %v2f32 @llvm.nearbyint.v2f32(%v2f32) #0
340declare %v4f16 @llvm.nearbyint.v4f16(%v4f16) #0
341declare %v8f16 @llvm.nearbyint.v8f16(%v8f16) #0
342
343;;;
344
345%v4f32 = type <4 x float>
346; CHECK: test_v4f32.sqrt:
347define %v4f32 @test_v4f32.sqrt(%v4f32 %a) {
348  ; CHECK: fsqrt.4s
349  %1 = call %v4f32 @llvm.sqrt.v4f32(%v4f32 %a)
350  ret %v4f32 %1
351}
352; CHECK: test_v4f32.powi:
353define %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
357}
358; CHECK: test_v4f32.sin:
359define %v4f32 @test_v4f32.sin(%v4f32 %a) {
360  ; CHECK: sin
361  %1 = call %v4f32 @llvm.sin.v4f32(%v4f32 %a)
362  ret %v4f32 %1
363}
364; CHECK: test_v4f32.cos:
365define %v4f32 @test_v4f32.cos(%v4f32 %a) {
366  ; CHECK: cos
367  %1 = call %v4f32 @llvm.cos.v4f32(%v4f32 %a)
368  ret %v4f32 %1
369}
370; CHECK: test_v4f32.pow:
371define %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
375}
376; CHECK: test_v4f32.exp:
377define %v4f32 @test_v4f32.exp(%v4f32 %a) {
378  ; CHECK: exp
379  %1 = call %v4f32 @llvm.exp.v4f32(%v4f32 %a)
380  ret %v4f32 %1
381}
382; CHECK: test_v4f32.exp2:
383define %v4f32 @test_v4f32.exp2(%v4f32 %a) {
384  ; CHECK: exp
385  %1 = call %v4f32 @llvm.exp2.v4f32(%v4f32 %a)
386  ret %v4f32 %1
387}
388; CHECK: test_v4f32.log:
389define %v4f32 @test_v4f32.log(%v4f32 %a) {
390  ; CHECK: log
391  %1 = call %v4f32 @llvm.log.v4f32(%v4f32 %a)
392  ret %v4f32 %1
393}
394; CHECK: test_v4f32.log10:
395define %v4f32 @test_v4f32.log10(%v4f32 %a) {
396  ; CHECK: log
397  %1 = call %v4f32 @llvm.log10.v4f32(%v4f32 %a)
398  ret %v4f32 %1
399}
400; CHECK: test_v4f32.log2:
401define %v4f32 @test_v4f32.log2(%v4f32 %a) {
402  ; CHECK: log
403  %1 = call %v4f32 @llvm.log2.v4f32(%v4f32 %a)
404  ret %v4f32 %1
405}
406; CHECK: test_v4f32.fma:
407define %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
411}
412; CHECK: test_v4f32.fabs:
413define %v4f32 @test_v4f32.fabs(%v4f32 %a) {
414  ; CHECK: fabs
415  %1 = call %v4f32 @llvm.fabs.v4f32(%v4f32 %a)
416  ret %v4f32 %1
417}
418; CHECK: test_v4f32.floor:
419define %v4f32 @test_v4f32.floor(%v4f32 %a) {
420  ; CHECK: frintm.4s
421  %1 = call %v4f32 @llvm.floor.v4f32(%v4f32 %a)
422  ret %v4f32 %1
423}
424; CHECK: test_v4f32.ceil:
425define %v4f32 @test_v4f32.ceil(%v4f32 %a) {
426  ; CHECK: frintp.4s
427  %1 = call %v4f32 @llvm.ceil.v4f32(%v4f32 %a)
428  ret %v4f32 %1
429}
430; CHECK: test_v4f32.trunc:
431define %v4f32 @test_v4f32.trunc(%v4f32 %a) {
432  ; CHECK: frintz.4s
433  %1 = call %v4f32 @llvm.trunc.v4f32(%v4f32 %a)
434  ret %v4f32 %1
435}
436; CHECK: test_v4f32.rint:
437define %v4f32 @test_v4f32.rint(%v4f32 %a) {
438  ; CHECK: frintx.4s
439  %1 = call %v4f32 @llvm.rint.v4f32(%v4f32 %a)
440  ret %v4f32 %1
441}
442; CHECK: test_v4f32.nearbyint:
443define %v4f32 @test_v4f32.nearbyint(%v4f32 %a) {
444  ; CHECK: frinti.4s
445  %1 = call %v4f32 @llvm.nearbyint.v4f32(%v4f32 %a)
446  ret %v4f32 %1
447}
448
449declare %v4f32 @llvm.sqrt.v4f32(%v4f32) #0
450declare %v4f32 @llvm.powi.v4f32(%v4f32, i32) #0
451declare %v4f32 @llvm.sin.v4f32(%v4f32) #0
452declare %v4f32 @llvm.cos.v4f32(%v4f32) #0
453declare %v4f32 @llvm.pow.v4f32(%v4f32, %v4f32) #0
454declare %v4f32 @llvm.exp.v4f32(%v4f32) #0
455declare %v4f32 @llvm.exp2.v4f32(%v4f32) #0
456declare %v4f32 @llvm.log.v4f32(%v4f32) #0
457declare %v4f32 @llvm.log10.v4f32(%v4f32) #0
458declare %v4f32 @llvm.log2.v4f32(%v4f32) #0
459declare %v4f32 @llvm.fma.v4f32(%v4f32, %v4f32, %v4f32) #0
460declare %v4f32 @llvm.fabs.v4f32(%v4f32) #0
461declare %v4f32 @llvm.floor.v4f32(%v4f32) #0
462declare %v4f32 @llvm.ceil.v4f32(%v4f32) #0
463declare %v4f32 @llvm.trunc.v4f32(%v4f32) #0
464declare %v4f32 @llvm.rint.v4f32(%v4f32) #0
465declare %v4f32 @llvm.nearbyint.v4f32(%v4f32) #0
466
467;;; Double vector
468
469%v2f64 = type <2 x double>
470; CHECK: test_v2f64.sqrt:
471define %v2f64 @test_v2f64.sqrt(%v2f64 %a) {
472  ; CHECK: fsqrt.2d
473  %1 = call %v2f64 @llvm.sqrt.v2f64(%v2f64 %a)
474  ret %v2f64 %1
475}
476; CHECK: test_v2f64.powi:
477define %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
481}
482; CHECK: test_v2f64.sin:
483define %v2f64 @test_v2f64.sin(%v2f64 %a) {
484  ; CHECK: sin
485  %1 = call %v2f64 @llvm.sin.v2f64(%v2f64 %a)
486  ret %v2f64 %1
487}
488; CHECK: test_v2f64.cos:
489define %v2f64 @test_v2f64.cos(%v2f64 %a) {
490  ; CHECK: cos
491  %1 = call %v2f64 @llvm.cos.v2f64(%v2f64 %a)
492  ret %v2f64 %1
493}
494; CHECK: test_v2f64.pow:
495define %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
499}
500; CHECK: test_v2f64.exp:
501define %v2f64 @test_v2f64.exp(%v2f64 %a) {
502  ; CHECK: exp
503  %1 = call %v2f64 @llvm.exp.v2f64(%v2f64 %a)
504  ret %v2f64 %1
505}
506; CHECK: test_v2f64.exp2:
507define %v2f64 @test_v2f64.exp2(%v2f64 %a) {
508  ; CHECK: exp
509  %1 = call %v2f64 @llvm.exp2.v2f64(%v2f64 %a)
510  ret %v2f64 %1
511}
512; CHECK: test_v2f64.log:
513define %v2f64 @test_v2f64.log(%v2f64 %a) {
514  ; CHECK: log
515  %1 = call %v2f64 @llvm.log.v2f64(%v2f64 %a)
516  ret %v2f64 %1
517}
518; CHECK: test_v2f64.log10:
519define %v2f64 @test_v2f64.log10(%v2f64 %a) {
520  ; CHECK: log
521  %1 = call %v2f64 @llvm.log10.v2f64(%v2f64 %a)
522  ret %v2f64 %1
523}
524; CHECK: test_v2f64.log2:
525define %v2f64 @test_v2f64.log2(%v2f64 %a) {
526  ; CHECK: log
527  %1 = call %v2f64 @llvm.log2.v2f64(%v2f64 %a)
528  ret %v2f64 %1
529}
530; CHECK: test_v2f64.fma:
531define %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
535}
536; CHECK: test_v2f64.fabs:
537define %v2f64 @test_v2f64.fabs(%v2f64 %a) {
538  ; CHECK: fabs
539  %1 = call %v2f64 @llvm.fabs.v2f64(%v2f64 %a)
540  ret %v2f64 %1
541}
542; CHECK: test_v2f64.floor:
543define %v2f64 @test_v2f64.floor(%v2f64 %a) {
544  ; CHECK: frintm.2d
545  %1 = call %v2f64 @llvm.floor.v2f64(%v2f64 %a)
546  ret %v2f64 %1
547}
548; CHECK: test_v2f64.ceil:
549define %v2f64 @test_v2f64.ceil(%v2f64 %a) {
550  ; CHECK: frintp.2d
551  %1 = call %v2f64 @llvm.ceil.v2f64(%v2f64 %a)
552  ret %v2f64 %1
553}
554; CHECK: test_v2f64.trunc:
555define %v2f64 @test_v2f64.trunc(%v2f64 %a) {
556  ; CHECK: frintz.2d
557  %1 = call %v2f64 @llvm.trunc.v2f64(%v2f64 %a)
558  ret %v2f64 %1
559}
560; CHECK: test_v2f64.rint:
561define %v2f64 @test_v2f64.rint(%v2f64 %a) {
562  ; CHECK: frintx.2d
563  %1 = call %v2f64 @llvm.rint.v2f64(%v2f64 %a)
564  ret %v2f64 %1
565}
566; CHECK: test_v2f64.nearbyint:
567define %v2f64 @test_v2f64.nearbyint(%v2f64 %a) {
568  ; CHECK: frinti.2d
569  %1 = call %v2f64 @llvm.nearbyint.v2f64(%v2f64 %a)
570  ret %v2f64 %1
571}
572
573declare %v2f64 @llvm.sqrt.v2f64(%v2f64) #0
574declare %v2f64 @llvm.powi.v2f64(%v2f64, i32) #0
575declare %v2f64 @llvm.sin.v2f64(%v2f64) #0
576declare %v2f64 @llvm.cos.v2f64(%v2f64) #0
577declare %v2f64 @llvm.pow.v2f64(%v2f64, %v2f64) #0
578declare %v2f64 @llvm.exp.v2f64(%v2f64) #0
579declare %v2f64 @llvm.exp2.v2f64(%v2f64) #0
580declare %v2f64 @llvm.log.v2f64(%v2f64) #0
581declare %v2f64 @llvm.log10.v2f64(%v2f64) #0
582declare %v2f64 @llvm.log2.v2f64(%v2f64) #0
583declare %v2f64 @llvm.fma.v2f64(%v2f64, %v2f64, %v2f64) #0
584declare %v2f64 @llvm.fabs.v2f64(%v2f64) #0
585declare %v2f64 @llvm.floor.v2f64(%v2f64) #0
586declare %v2f64 @llvm.ceil.v2f64(%v2f64) #0
587declare %v2f64 @llvm.trunc.v2f64(%v2f64) #0
588declare %v2f64 @llvm.rint.v2f64(%v2f64) #0
589declare %v2f64 @llvm.nearbyint.v2f64(%v2f64) #0
590
591attributes #0 = { nounwind readonly }
592