1 ; RUN: opt -S -dxil-op-lower < %s | FileCheck %s
3 ; Make sure dxil operation function calls for rsqrt are generated for float and half.
5 ; CHECK-LABEL: rsqrt_float
6 ; CHECK: call float @dx.op.unary.f32(i32 25, float %{{.*}})
7 define noundef float @rsqrt_float(float noundef %a) {
9 %a.addr = alloca float, align 4
10 store float %a, ptr %a.addr, align 4
11 %0 = load float, ptr %a.addr, align 4
12 %dx.rsqrt = call float @llvm.dx.rsqrt.f32(float %0)
16 ; CHECK-LABEL: rsqrt_half
17 ; CHECK: call half @dx.op.unary.f16(i32 25, half %{{.*}})
18 define noundef half @rsqrt_half(half noundef %a) {
20 %a.addr = alloca half, align 2
21 store half %a, ptr %a.addr, align 2
22 %0 = load half, ptr %a.addr, align 2
23 %dx.rsqrt = call half @llvm.dx.rsqrt.f16(half %0)
27 declare half @llvm.dx.rsqrt.f16(half)
28 declare float @llvm.dx.rsqrt.f32(float)