1 ; RUN: opt -S -dxil-op-lower < %s | FileCheck %s
3 ; Make sure dxil operation function calls for round are generated for float and half.
5 ; CHECK-LABEL: round_half
6 define noundef half @round_half(half noundef %a) {
8 ; CHECK: call half @dx.op.unary.f16(i32 26, half %{{.*}})
9 %elt.roundeven = call half @llvm.roundeven.f16(half %a)
10 ret half %elt.roundeven
13 ; CHECK-LABEL: round_float
14 define noundef float @round_float(float noundef %a) {
16 ; CHECK: call float @dx.op.unary.f32(i32 26, float %{{.*}})
17 %elt.roundeven = call float @llvm.roundeven.f32(float %a)
18 ret float %elt.roundeven
21 declare half @llvm.roundeven.f16(half)
22 declare float @llvm.roundeven.f32(float)