1; RUN: llc -mtriple=arm64-linux-gnu -o - %s | FileCheck %s
2
3define float @test_fminv_v2f32(<2 x float> %in) {
4; CHECK: test_fminv_v2f32:
5; CHECK: fminp s0, v0.2s
6  %min = call float @llvm.aarch64.neon.fminv.f32.v2f32(<2 x float> %in)
7  ret float %min
8}
9
10define float @test_fminv_v4f32(<4 x float> %in) {
11; CHECK: test_fminv_v4f32:
12; CHECK: fminv s0, v0.4s
13  %min = call float @llvm.aarch64.neon.fminv.f32.v4f32(<4 x float> %in)
14  ret float %min
15}
16
17define double @test_fminv_v2f64(<2 x double> %in) {
18; CHECK: test_fminv_v2f64:
19; CHECK: fminp d0, v0.2d
20  %min = call double @llvm.aarch64.neon.fminv.f64.v2f64(<2 x double> %in)
21  ret double %min
22}
23
24declare float @llvm.aarch64.neon.fminv.f32.v2f32(<2 x float>)
25declare float @llvm.aarch64.neon.fminv.f32.v4f32(<4 x float>)
26declare double @llvm.aarch64.neon.fminv.f64.v2f64(<2 x double>)
27
28define float @test_fmaxv_v2f32(<2 x float> %in) {
29; CHECK: test_fmaxv_v2f32:
30; CHECK: fmaxp s0, v0.2s
31  %max = call float @llvm.aarch64.neon.fmaxv.f32.v2f32(<2 x float> %in)
32  ret float %max
33}
34
35define float @test_fmaxv_v4f32(<4 x float> %in) {
36; CHECK: test_fmaxv_v4f32:
37; CHECK: fmaxv s0, v0.4s
38  %max = call float @llvm.aarch64.neon.fmaxv.f32.v4f32(<4 x float> %in)
39  ret float %max
40}
41
42define double @test_fmaxv_v2f64(<2 x double> %in) {
43; CHECK: test_fmaxv_v2f64:
44; CHECK: fmaxp d0, v0.2d
45  %max = call double @llvm.aarch64.neon.fmaxv.f64.v2f64(<2 x double> %in)
46  ret double %max
47}
48
49declare float @llvm.aarch64.neon.fmaxv.f32.v2f32(<2 x float>)
50declare float @llvm.aarch64.neon.fmaxv.f32.v4f32(<4 x float>)
51declare double @llvm.aarch64.neon.fmaxv.f64.v2f64(<2 x double>)
52
53define float @test_fminnmv_v2f32(<2 x float> %in) {
54; CHECK: test_fminnmv_v2f32:
55; CHECK: fminnmp s0, v0.2s
56  %minnm = call float @llvm.aarch64.neon.fminnmv.f32.v2f32(<2 x float> %in)
57  ret float %minnm
58}
59
60define float @test_fminnmv_v4f32(<4 x float> %in) {
61; CHECK: test_fminnmv_v4f32:
62; CHECK: fminnmv s0, v0.4s
63  %minnm = call float @llvm.aarch64.neon.fminnmv.f32.v4f32(<4 x float> %in)
64  ret float %minnm
65}
66
67define double @test_fminnmv_v2f64(<2 x double> %in) {
68; CHECK: test_fminnmv_v2f64:
69; CHECK: fminnmp d0, v0.2d
70  %minnm = call double @llvm.aarch64.neon.fminnmv.f64.v2f64(<2 x double> %in)
71  ret double %minnm
72}
73
74declare float @llvm.aarch64.neon.fminnmv.f32.v2f32(<2 x float>)
75declare float @llvm.aarch64.neon.fminnmv.f32.v4f32(<4 x float>)
76declare double @llvm.aarch64.neon.fminnmv.f64.v2f64(<2 x double>)
77
78define float @test_fmaxnmv_v2f32(<2 x float> %in) {
79; CHECK: test_fmaxnmv_v2f32:
80; CHECK: fmaxnmp s0, v0.2s
81  %maxnm = call float @llvm.aarch64.neon.fmaxnmv.f32.v2f32(<2 x float> %in)
82  ret float %maxnm
83}
84
85define float @test_fmaxnmv_v4f32(<4 x float> %in) {
86; CHECK: test_fmaxnmv_v4f32:
87; CHECK: fmaxnmv s0, v0.4s
88  %maxnm = call float @llvm.aarch64.neon.fmaxnmv.f32.v4f32(<4 x float> %in)
89  ret float %maxnm
90}
91
92define double @test_fmaxnmv_v2f64(<2 x double> %in) {
93; CHECK: test_fmaxnmv_v2f64:
94; CHECK: fmaxnmp d0, v0.2d
95  %maxnm = call double @llvm.aarch64.neon.fmaxnmv.f64.v2f64(<2 x double> %in)
96  ret double %maxnm
97}
98
99declare float @llvm.aarch64.neon.fmaxnmv.f32.v2f32(<2 x float>)
100declare float @llvm.aarch64.neon.fmaxnmv.f32.v4f32(<4 x float>)
101declare double @llvm.aarch64.neon.fmaxnmv.f64.v2f64(<2 x double>)
102