[x86] add missing maxnum/minnum tests for 256-bit vectors
[oota-llvm.git] / test / CodeGen / X86 / fmaxnum.ll
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
4 declare float @fmaxf(float, float)
5 declare double @fmax(double, double)
6 declare x86_fp80 @fmaxl(x86_fp80, x86_fp80)
7 declare float @llvm.maxnum.f32(float, float)
8 declare double @llvm.maxnum.f64(double, double)
9 declare x86_fp80 @llvm.maxnum.f80(x86_fp80, x86_fp80)
10
11 declare <2 x float> @llvm.maxnum.v2f32(<2 x float>, <2 x float>)
12 declare <4 x float> @llvm.maxnum.v4f32(<4 x float>, <4 x float>)
13 declare <2 x double> @llvm.maxnum.v2f64(<2 x double>, <2 x double>)
14 declare <4 x double> @llvm.maxnum.v4f64(<4 x double>, <4 x double>)
15 declare <8 x double> @llvm.maxnum.v8f64(<8 x double>, <8 x double>)
16
17
18 ; CHECK-LABEL: @test_fmaxf
19 ; CHECK: jmp fmaxf
20 define float @test_fmaxf(float %x, float %y) {
21   %z = call float @fmaxf(float %x, float %y) readnone
22   ret float %z
23 }
24
25 ; CHECK-LABEL: @test_fmax
26 ; CHECK: jmp fmax
27 define double @test_fmax(double %x, double %y) {
28   %z = call double @fmax(double %x, double %y) readnone
29   ret double %z
30 }
31
32 ; CHECK-LABEL: @test_fmaxl
33 ; CHECK: callq fmaxl
34 define x86_fp80 @test_fmaxl(x86_fp80 %x, x86_fp80 %y) {
35   %z = call x86_fp80 @fmaxl(x86_fp80 %x, x86_fp80 %y) readnone
36   ret x86_fp80 %z
37 }
38
39 ; CHECK-LABEL: @test_intrinsic_fmaxf
40 ; CHECK: jmp fmaxf
41 define float @test_intrinsic_fmaxf(float %x, float %y) {
42   %z = call float @llvm.maxnum.f32(float %x, float %y) readnone
43   ret float %z
44 }
45
46 ; CHECK-LABEL: @test_intrinsic_fmax
47 ; CHECK: jmp fmax
48 define double @test_intrinsic_fmax(double %x, double %y) {
49   %z = call double @llvm.maxnum.f64(double %x, double %y) readnone
50   ret double %z
51 }
52
53 ; CHECK-LABEL: @test_intrinsic_fmaxl
54 ; CHECK: callq fmaxl
55 define x86_fp80 @test_intrinsic_fmaxl(x86_fp80 %x, x86_fp80 %y) {
56   %z = call x86_fp80 @llvm.maxnum.f80(x86_fp80 %x, x86_fp80 %y) readnone
57   ret x86_fp80 %z
58 }
59
60 ; CHECK-LABEL: @test_intrinsic_fmax_v2f32
61 ; CHECK: callq fmaxf
62 ; CHECK: callq fmaxf
63 define <2 x float> @test_intrinsic_fmax_v2f32(<2 x float> %x, <2 x float> %y) {
64   %z = call <2 x float> @llvm.maxnum.v2f32(<2 x float> %x, <2 x float> %y) readnone
65   ret <2 x float> %z
66 }
67
68 ; CHECK-LABEL: @test_intrinsic_fmax_v4f32
69 ; CHECK: callq fmaxf
70 ; CHECK: callq fmaxf
71 ; CHECK: callq fmaxf
72 ; CHECK: callq fmaxf
73 define <4 x float> @test_intrinsic_fmax_v4f32(<4 x float> %x, <4 x float> %y) {
74   %z = call <4 x float> @llvm.maxnum.v4f32(<4 x float> %x, <4 x float> %y) readnone
75   ret <4 x float> %z
76 }
77
78 ; CHECK-LABEL: @test_intrinsic_fmax_v2f64
79 ; CHECK: callq fmax
80 ; CHECK: callq fmax
81 define <2 x double> @test_intrinsic_fmax_v2f64(<2 x double> %x, <2 x double> %y) {
82   %z = call <2 x double> @llvm.maxnum.v2f64(<2 x double> %x, <2 x double> %y) readnone
83   ret <2 x double> %z
84 }
85
86 ; CHECK-LABEL: @test_intrinsic_fmax_v4f64
87 ; CHECK: callq fmax
88 ; CHECK: callq fmax
89 ; CHECK: callq fmax
90 ; CHECK: callq fmax
91 define <4 x double> @test_intrinsic_fmax_v4f64(<4 x double> %x, <4 x double> %y) {
92   %z = call <4 x double> @llvm.maxnum.v4f64(<4 x double> %x, <4 x double> %y) readnone
93   ret <4 x double> %z
94 }
95
96 ; CHECK-LABEL: @test_intrinsic_fmax_v8f64
97 ; CHECK: callq fmax
98 ; CHECK: callq fmax
99 ; CHECK: callq fmax
100 ; CHECK: callq fmax
101 ; CHECK: callq fmax
102 ; CHECK: callq fmax
103 ; CHECK: callq fmax
104 ; CHECK: callq fmax
105 define <8 x double> @test_intrinsic_fmax_v8f64(<8 x double> %x, <8 x double> %y) {
106   %z = call <8 x double> @llvm.maxnum.v8f64(<8 x double> %x, <8 x double> %y) readnone
107   ret <8 x double> %z
108 }
109