Add vector fmaxnum tests that correspond to the existing fminnum tests
[oota-llvm.git] / test / CodeGen / X86 / fmaxnum.ll
1 ; RUN: llc  -march=x86 -mtriple=i386-linux-gnu  < %s | FileCheck %s
2
3 declare float @fmaxf(float, float)
4 declare double @fmax(double, double)
5 declare x86_fp80 @fmaxl(x86_fp80, x86_fp80)
6 declare float @llvm.maxnum.f32(float, float)
7 declare double @llvm.maxnum.f64(double, double)
8 declare x86_fp80 @llvm.maxnum.f80(x86_fp80, x86_fp80)
9
10 declare <2 x float> @llvm.maxnum.v2f32(<2 x float>, <2 x float>)
11 declare <4 x float> @llvm.maxnum.v4f32(<4 x float>, <4 x float>)
12 declare <2 x double> @llvm.maxnum.v2f64(<2 x double>, <2 x double>)
13 declare <8 x double> @llvm.maxnum.v8f64(<8 x double>, <8 x double>)
14
15
16 ; CHECK-LABEL: @test_fmaxf
17 ; CHECK: calll fmaxf
18 define float @test_fmaxf(float %x, float %y) {
19   %z = call float @fmaxf(float %x, float %y) readnone
20   ret float %z
21 }
22
23 ; CHECK-LABEL: @test_fmax
24 ; CHECK: calll fmax
25 define double @test_fmax(double %x, double %y) {
26   %z = call double @fmax(double %x, double %y) readnone
27   ret double %z
28 }
29
30 ; CHECK-LABEL: @test_fmaxl
31 ; CHECK: calll fmaxl
32 define x86_fp80 @test_fmaxl(x86_fp80 %x, x86_fp80 %y) {
33   %z = call x86_fp80 @fmaxl(x86_fp80 %x, x86_fp80 %y) readnone
34   ret x86_fp80 %z
35 }
36
37 ; CHECK-LABEL: @test_intrinsic_fmaxf
38 ; CHECK: calll fmaxf
39 define float @test_intrinsic_fmaxf(float %x, float %y) {
40   %z = call float @llvm.maxnum.f32(float %x, float %y) readnone
41   ret float %z
42 }
43
44 ; CHECK-LABEL: @test_intrinsic_fmax
45 ; CHECK: calll fmax
46 define double @test_intrinsic_fmax(double %x, double %y) {
47   %z = call double @llvm.maxnum.f64(double %x, double %y) readnone
48   ret double %z
49 }
50
51 ; CHECK-LABEL: @test_intrinsic_fmaxl
52 ; CHECK: calll fmaxl
53 define x86_fp80 @test_intrinsic_fmaxl(x86_fp80 %x, x86_fp80 %y) {
54   %z = call x86_fp80 @llvm.maxnum.f80(x86_fp80 %x, x86_fp80 %y) readnone
55   ret x86_fp80 %z
56 }
57
58 ; CHECK-LABEL: @test_intrinsic_fmax_v2f32
59 ; CHECK: calll fmaxf
60 ; CHECK: calll fmaxf
61 define <2 x float> @test_intrinsic_fmax_v2f32(<2 x float> %x, <2 x float> %y) {
62   %z = call <2 x float> @llvm.maxnum.v2f32(<2 x float> %x, <2 x float> %y) readnone
63   ret <2 x float> %z
64 }
65
66 ; CHECK-LABEL: @test_intrinsic_fmax_v4f32
67 ; CHECK: calll fmaxf
68 ; CHECK: calll fmaxf
69 ; CHECK: calll fmaxf
70 ; CHECK: calll fmaxf
71 define <4 x float> @test_intrinsic_fmax_v4f32(<4 x float> %x, <4 x float> %y) {
72   %z = call <4 x float> @llvm.maxnum.v4f32(<4 x float> %x, <4 x float> %y) readnone
73   ret <4 x float> %z
74 }
75
76 ; CHECK-LABEL: @test_intrinsic_fmax_v2f64
77 ; CHECK: calll fmax
78 ; CHECK: calll fmax
79 define <2 x double> @test_intrinsic_fmax_v2f64(<2 x double> %x, <2 x double> %y) {
80   %z = call <2 x double> @llvm.maxnum.v2f64(<2 x double> %x, <2 x double> %y) readnone
81   ret <2 x double> %z
82 }
83
84 ; CHECK-LABEL: @test_intrinsic_fmax_v8f64
85 ; CHECK: calll fmax
86 ; CHECK: calll fmax
87 ; CHECK: calll fmax
88 ; CHECK: calll fmax
89 ; CHECK: calll fmax
90 ; CHECK: calll fmax
91 ; CHECK: calll fmax
92 ; CHECK: calll fmax
93 define <8 x double> @test_intrinsic_fmax_v8f64(<8 x double> %x, <8 x double> %y) {
94   %z = call <8 x double> @llvm.maxnum.v8f64(<8 x double> %x, <8 x double> %y) readnone
95   ret <8 x double> %z
96 }
97