1 ; RUN: opt -S -dxil-intrinsic-expansion < %s | FileCheck %s --check-prefixes=CHECK,EXPCHECK
2 ; RUN: opt -S -dxil-op-lower < %s | FileCheck %s --check-prefixes=CHECK,DOPCHECK
4 ; Make sure dxil operation function calls for pow are generated.
6 define noundef float @pow_float(float noundef %a, float noundef %b) {
8 ; DOPCHECK: call float @dx.op.unary.f32(i32 23, float %a)
9 ; EXPCHECK: call float @llvm.log2.f32(float %a)
10 ; CHECK: fmul float %{{.*}}, %b
11 ; DOPCHECK: call float @dx.op.unary.f32(i32 21, float %{{.*}})
12 ; EXPCHECK: call float @llvm.exp2.f32(float %{{.*}})
13 %elt.pow = call float @llvm.pow.f32(float %a, float %b)
17 define noundef half @pow_half(half noundef %a, half noundef %b) {
19 ; DOPCHECK: call half @dx.op.unary.f16(i32 23, half %a)
20 ; EXPCHECK: call half @llvm.log2.f16(half %a)
21 ; CHECK: fmul half %{{.*}}, %b
22 ; DOPCHECK: call half @dx.op.unary.f16(i32 21, half %{{.*}})
23 ; EXPCHECK: call half @llvm.exp2.f16(half %{{.*}})
24 %elt.pow = call half @llvm.pow.f16(half %a, half %b)
28 declare half @llvm.pow.f16(half,half)
29 declare float @llvm.pow.f32(float,float)