23 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 log2 are generated for float and half.4 5define noundef float @log2_float(float noundef %a) #0 {6entry:7; CHECK:call float @dx.op.unary.f32(i32 23, float %{{.*}}) #[[#ATTR:]]8 %elt.log2 = call float @llvm.log2.f32(float %a)9 ret float %elt.log210}11 12define noundef half @log2_half(half noundef %a) #0 {13entry:14; CHECK:call half @dx.op.unary.f16(i32 23, half %{{.*}}) #[[#ATTR]]15 %elt.log2 = call half @llvm.log2.f16(half %a)16 ret half %elt.log217}18 19; CHECK: attributes #[[#ATTR]] = {{{.*}} memory(none) {{.*}}}20 21declare half @llvm.log2.f16(half)22declare float @llvm.log2.f32(float)23