1 ; RUN: opt -S -dxil-intrinsic-expansion -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s --check-prefixes=CHECK,EXPCHECK
2 ; RUN: opt -S -dxil-intrinsic-expansion -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s --check-prefixes=CHECK,DOPCHECK
4 ; Make sure dxil operation function calls for log are generated.
6 define noundef float @log_float(float noundef %a) #0 {
8 ; DOPCHECK: call float @dx.op.unary.f32(i32 23, float %{{.*}})
9 ; EXPCHECK: call float @llvm.log2.f32(float %a)
10 ; CHECK: fmul float 0x3FE62E4300000000, %{{.*}}
11 %elt.log = call float @llvm.log.f32(float %a)
15 define noundef half @log_half(half noundef %a) #0 {
17 ; DOPCHECK: call half @dx.op.unary.f16(i32 23, half %{{.*}})
18 ; EXPCHECK: call half @llvm.log2.f16(half %a)
19 ; CHECK: fmul half 0xH398C, %{{.*}}
20 %elt.log = call half @llvm.log.f16(half %a)
24 declare half @llvm.log.f16(half)
25 declare float @llvm.log.f32(float)