Merging r259740:
[oota-llvm.git] / test / CodeGen / PowerPC / fmaxnum.ll
1 ; RUN: llc -march=ppc32 -mtriple=powerpc-unknown-linux-gnu < %s | FileCheck %s
2
3 declare float @fmaxf(float, float)
4 declare double @fmax(double, double)
5 declare ppc_fp128 @fmaxl(ppc_fp128, ppc_fp128)
6 declare float @llvm.maxnum.f32(float, float)
7 declare double @llvm.maxnum.f64(double, double)
8 declare ppc_fp128 @llvm.maxnum.ppcf128(ppc_fp128, ppc_fp128)
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 <8 x float> @llvm.maxnum.v8f32(<8 x float>, <8 x float>)
13
14 ; CHECK-LABEL: @test_fmaxf
15 ; CHECK: bl fmaxf
16 define float @test_fmaxf(float %x, float %y) {
17   %z = call float @fmaxf(float %x, float %y) readnone
18   ret float %z
19 }
20
21 ; CHECK-LABEL: @test_fmax
22 ; CHECK: bl fmax
23 define double @test_fmax(double %x, double %y) {
24   %z = call double @fmax(double %x, double %y) readnone
25   ret double %z
26 }
27
28 ; CHECK-LABEL: @test_fmaxl
29 ; CHECK: bl fmaxl
30 define ppc_fp128 @test_fmaxl(ppc_fp128 %x, ppc_fp128 %y) {
31   %z = call ppc_fp128 @fmaxl(ppc_fp128 %x, ppc_fp128 %y) readnone
32   ret ppc_fp128 %z
33 }
34
35 ; CHECK-LABEL: @test_intrinsic_fmaxf
36 ; CHECK: bl fmaxf
37 define float @test_intrinsic_fmaxf(float %x, float %y) {
38   %z = call float @llvm.maxnum.f32(float %x, float %y) readnone
39   ret float %z
40 }
41
42 ; CHECK-LABEL: @test_intrinsic_fmax
43 ; CHECK: bl fmax
44 define double @test_intrinsic_fmax(double %x, double %y) {
45   %z = call double @llvm.maxnum.f64(double %x, double %y) readnone
46   ret double %z
47 }
48
49 ; CHECK-LABEL: @test_intrinsic_fmaxl
50 ; CHECK: bl fmaxl
51 define ppc_fp128 @test_intrinsic_fmaxl(ppc_fp128 %x, ppc_fp128 %y) {
52   %z = call ppc_fp128 @llvm.maxnum.ppcf128(ppc_fp128 %x, ppc_fp128 %y) readnone
53   ret ppc_fp128 %z
54 }
55
56 ; CHECK-LABEL: @test_intrinsic_fmaxf_v2f32
57 ; CHECK: bl fmaxf
58 ; CHECK: bl fmaxf
59 define <2 x float> @test_intrinsic_fmaxf_v2f32(<2 x float> %x, <2 x float> %y) {
60   %z = call <2 x float> @llvm.maxnum.v2f32(<2 x float> %x, <2 x float> %y) readnone
61   ret <2 x float> %z
62 }
63
64 ; CHECK-LABEL: @test_intrinsic_fmaxf_v4f32
65 ; CHECK: bl fmaxf
66 ; CHECK: bl fmaxf
67 ; CHECK: bl fmaxf
68 ; CHECK: bl fmaxf
69 define <4 x float> @test_intrinsic_fmaxf_v4f32(<4 x float> %x, <4 x float> %y) {
70   %z = call <4 x float> @llvm.maxnum.v4f32(<4 x float> %x, <4 x float> %y) readnone
71   ret <4 x float> %z
72 }
73
74 ; CHECK-LABEL: @test_intrinsic_fmaxf_v8f32
75 ; CHECK: bl fmaxf
76 ; CHECK: bl fmaxf
77 ; CHECK: bl fmaxf
78 ; CHECK: bl fmaxf
79 ; CHECK: bl fmaxf
80 ; CHECK: bl fmaxf
81 ; CHECK: bl fmaxf
82 ; CHECK: bl fmaxf
83 define <8 x float> @test_intrinsic_fmaxf_v8f32(<8 x float> %x, <8 x float> %y) {
84   %z = call <8 x float> @llvm.maxnum.v8f32(<8 x float> %x, <8 x float> %y) readnone
85   ret <8 x float> %z
86 }