1 ; RUN: opt -S -dxil-op-lower < %s | FileCheck %s
3 ; Make sure dxil operation function calls for abs are generated for float, half, and double.
6 ; CHECK-LABEL: fabs_half
7 define noundef half @fabs_half(half noundef %a) {
9 ; CHECK: call half @dx.op.unary.f16(i32 6, half %{{.*}})
10 %elt.abs = call half @llvm.fabs.f16(half %a)
14 ; CHECK-LABEL: fabs_float
15 define noundef float @fabs_float(float noundef %a) {
17 ; CHECK: call float @dx.op.unary.f32(i32 6, float %{{.*}})
18 %elt.abs = call float @llvm.fabs.f32(float %a)
22 ; CHECK-LABEL: fabs_double
23 define noundef double @fabs_double(double noundef %a) {
25 ; CHECK: call double @dx.op.unary.f64(i32 6, double %{{.*}})
26 %elt.abs = call double @llvm.fabs.f64(double %a)
30 declare half @llvm.fabs.f16(half)
31 declare float @llvm.fabs.f32(float)
32 declare double @llvm.fabs.f64(double)