34 lines · plain
1; RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s2 3; Make sure dxil operation function calls for fmax are generated for half/float/double.4 5; CHECK-LABEL:test_fmax_half6define noundef half @test_fmax_half(half noundef %a, half noundef %b) {7entry:8; CHECK: call half @dx.op.binary.f16(i32 35, half %{{.*}}, half %{{.*}}) #[[#ATTR:]]9 %0 = call half @llvm.maxnum.f16(half %a, half %b)10 ret half %011}12 13; CHECK-LABEL:test_fmax_float14define noundef float @test_fmax_float(float noundef %a, float noundef %b) {15entry:16; CHECK: call float @dx.op.binary.f32(i32 35, float %{{.*}}, float %{{.*}}) #[[#ATTR]]17 %0 = call float @llvm.maxnum.f32(float %a, float %b)18 ret float %019}20 21; CHECK-LABEL:test_fmax_double22define noundef double @test_fmax_double(double noundef %a, double noundef %b) {23entry:24; CHECK: call double @dx.op.binary.f64(i32 35, double %{{.*}}, double %{{.*}}) #[[#ATTR]]25 %0 = call double @llvm.maxnum.f64(double %a, double %b)26 ret double %027}28 29; CHECK: attributes #[[#ATTR]] = {{{.*}} memory(none) {{.*}}}30 31declare half @llvm.maxnum.f16(half, half)32declare float @llvm.maxnum.f32(float, float)33declare double @llvm.maxnum.f64(double, double)34