• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -mtriple=x86_64-unknown-unknown -mattr=sse2 < %s | FileCheck %s
2; RUN: llc -mtriple=x86_64-unknown-unknown -mattr=avx < %s | FileCheck %s
3
4declare float @fminf(float, float)
5declare double @fmin(double, double)
6declare x86_fp80 @fminl(x86_fp80, x86_fp80)
7declare float @llvm.minnum.f32(float, float)
8declare double @llvm.minnum.f64(double, double)
9declare x86_fp80 @llvm.minnum.f80(x86_fp80, x86_fp80)
10
11declare <2 x float> @llvm.minnum.v2f32(<2 x float>, <2 x float>)
12declare <4 x float> @llvm.minnum.v4f32(<4 x float>, <4 x float>)
13declare <2 x double> @llvm.minnum.v2f64(<2 x double>, <2 x double>)
14declare <4 x double> @llvm.minnum.v4f64(<4 x double>, <4 x double>)
15declare <8 x double> @llvm.minnum.v8f64(<8 x double>, <8 x double>)
16
17; CHECK-LABEL: @test_fminf
18; CHECK: jmp fminf
19define float @test_fminf(float %x, float %y) {
20  %z = call float @fminf(float %x, float %y) readnone
21  ret float %z
22}
23
24; CHECK-LABEL: @test_fmin
25; CHECK: jmp fmin
26define double @test_fmin(double %x, double %y) {
27  %z = call double @fmin(double %x, double %y) readnone
28  ret double %z
29}
30
31; CHECK-LABEL: @test_fminl
32; CHECK: callq fminl
33define x86_fp80 @test_fminl(x86_fp80 %x, x86_fp80 %y) {
34  %z = call x86_fp80 @fminl(x86_fp80 %x, x86_fp80 %y) readnone
35  ret x86_fp80 %z
36}
37
38; CHECK-LABEL: @test_intrinsic_fminf
39; CHECK: jmp fminf
40define float @test_intrinsic_fminf(float %x, float %y) {
41  %z = call float @llvm.minnum.f32(float %x, float %y) readnone
42  ret float %z
43}
44
45; CHECK-LABEL: @test_intrinsic_fmin
46; CHECK: jmp fmin
47define double @test_intrinsic_fmin(double %x, double %y) {
48  %z = call double @llvm.minnum.f64(double %x, double %y) readnone
49  ret double %z
50}
51
52; CHECK-LABEL: @test_intrinsic_fminl
53; CHECK: callq fminl
54define x86_fp80 @test_intrinsic_fminl(x86_fp80 %x, x86_fp80 %y) {
55  %z = call x86_fp80 @llvm.minnum.f80(x86_fp80 %x, x86_fp80 %y) readnone
56  ret x86_fp80 %z
57}
58
59; CHECK-LABEL: @test_intrinsic_fmin_v2f32
60; CHECK: callq fminf
61; CHECK: callq fminf
62define <2 x float> @test_intrinsic_fmin_v2f32(<2 x float> %x, <2 x float> %y) {
63  %z = call <2 x float> @llvm.minnum.v2f32(<2 x float> %x, <2 x float> %y) readnone
64  ret <2 x float> %z
65}
66
67; CHECK-LABEL: @test_intrinsic_fmin_v4f32
68; CHECK: callq fminf
69; CHECK: callq fminf
70; CHECK: callq fminf
71; CHECK: callq fminf
72define <4 x float> @test_intrinsic_fmin_v4f32(<4 x float> %x, <4 x float> %y) {
73  %z = call <4 x float> @llvm.minnum.v4f32(<4 x float> %x, <4 x float> %y) readnone
74  ret <4 x float> %z
75}
76
77; CHECK-LABEL: @test_intrinsic_fmin_v2f64
78; CHECK: callq fmin
79; CHECK: callq fmin
80define <2 x double> @test_intrinsic_fmin_v2f64(<2 x double> %x, <2 x double> %y) {
81  %z = call <2 x double> @llvm.minnum.v2f64(<2 x double> %x, <2 x double> %y) readnone
82  ret <2 x double> %z
83}
84
85; CHECK-LABEL: @test_intrinsic_fmin_v4f64
86; CHECK: callq fmin
87; CHECK: callq fmin
88; CHECK: callq fmin
89; CHECK: callq fmin
90define <4 x double> @test_intrinsic_fmin_v4f64(<4 x double> %x, <4 x double> %y) {
91  %z = call <4 x double> @llvm.minnum.v4f64(<4 x double> %x, <4 x double> %y) readnone
92  ret <4 x double> %z
93}
94
95; CHECK-LABEL: @test_intrinsic_fmin_v8f64
96; CHECK: callq fmin
97; CHECK: callq fmin
98; CHECK: callq fmin
99; CHECK: callq fmin
100; CHECK: callq fmin
101; CHECK: callq fmin
102; CHECK: callq fmin
103; CHECK: callq fmin
104define <8 x double> @test_intrinsic_fmin_v8f64(<8 x double> %x, <8 x double> %y) {
105  %z = call <8 x double> @llvm.minnum.v8f64(<8 x double> %x, <8 x double> %y) readnone
106  ret <8 x double> %z
107}
108