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
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)
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>)
18 ; CHECK-LABEL: @test_fmaxf
20 define float @test_fmaxf(float %x, float %y) {
21 %z = call float @fmaxf(float %x, float %y) readnone
25 ; CHECK-LABEL: @test_fmax
27 define double @test_fmax(double %x, double %y) {
28 %z = call double @fmax(double %x, double %y) readnone
32 ; CHECK-LABEL: @test_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
39 ; CHECK-LABEL: @test_intrinsic_fmaxf
41 define float @test_intrinsic_fmaxf(float %x, float %y) {
42 %z = call float @llvm.maxnum.f32(float %x, float %y) readnone
46 ; CHECK-LABEL: @test_intrinsic_fmax
48 define double @test_intrinsic_fmax(double %x, double %y) {
49 %z = call double @llvm.maxnum.f64(double %x, double %y) readnone
53 ; CHECK-LABEL: @test_intrinsic_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
60 ; CHECK-LABEL: @test_intrinsic_fmax_v2f32
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
68 ; CHECK-LABEL: @test_intrinsic_fmax_v4f32
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
78 ; CHECK-LABEL: @test_intrinsic_fmax_v2f64
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
86 ; CHECK-LABEL: @test_intrinsic_fmax_v4f64
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
96 ; CHECK-LABEL: @test_intrinsic_fmax_v8f64
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