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 @fminf(float, float) 5 declare double @fmin(double, double) 6 declare x86_fp80 @fminl(x86_fp80, x86_fp80) 7 declare float @llvm.minnum.f32(float, float) 8 declare double @llvm.minnum.f64(double, double) 9 declare x86_fp80 @llvm.minnum.f80(x86_fp80, x86_fp80) 10 11 declare <2 x float> @llvm.minnum.v2f32(<2 x float>, <2 x float>) 12 declare <4 x float> @llvm.minnum.v4f32(<4 x float>, <4 x float>) 13 declare <2 x double> @llvm.minnum.v2f64(<2 x double>, <2 x double>) 14 declare <4 x double> @llvm.minnum.v4f64(<4 x double>, <4 x double>) 15 declare <8 x double> @llvm.minnum.v8f64(<8 x double>, <8 x double>) 16 17 ; CHECK-LABEL: @test_fminf 18 ; CHECK: jmp fminf 19 define 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 26 define 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 33 define 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 40 define 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 47 define 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 54 define 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 62 define <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 72 define <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 80 define <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 90 define <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 104 define <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