brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.6 KiB · e985828 Raw
58 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 52; RUN: opt -S -scalarizer -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s3 4; Make sure dxil operation function calls for frac are generated for float and half.5 6define noundef half @frac_half(half noundef %a) {7; CHECK-LABEL: define noundef half @frac_half(8; CHECK-SAME: half noundef [[A:%.*]]) {9; CHECK-NEXT:  [[ENTRY:.*:]]10; CHECK-NEXT:    [[DX_FRAC1:%.*]] = call half @dx.op.unary.f16(i32 22, half [[A]]) #[[#ATTR:]]11; CHECK-NEXT:    ret half [[DX_FRAC1]]12;13entry:14  %dx.frac = call half @llvm.dx.frac.f16(half %a)15  ret half %dx.frac16}17 18define noundef float @frac_float(float noundef %a) #0 {19; CHECK-LABEL: define noundef float @frac_float(20; CHECK-SAME: float noundef [[A:%.*]]) {21; CHECK-NEXT:  [[ENTRY:.*:]]22; CHECK-NEXT:    [[DX_FRAC1:%.*]] = call float @dx.op.unary.f32(i32 22, float [[A]]) #[[#ATTR]]23; CHECK-NEXT:    ret float [[DX_FRAC1]]24;25entry:26  %dx.frac = call float @llvm.dx.frac.f32(float %a)27  ret float %dx.frac28}29 30define noundef <4 x float> @frac_float4(<4 x float> noundef %a) #0 {31; CHECK-LABEL: define noundef <4 x float> @frac_float4(32; CHECK-SAME: <4 x float> noundef [[A:%.*]]) {33; CHECK-NEXT:  [[ENTRY:.*:]]34; CHECK-NEXT:    [[A_I0:%.*]] = extractelement <4 x float> [[A]], i64 035; CHECK-NEXT:    [[DOTI04:%.*]] = call float @dx.op.unary.f32(i32 22, float [[A_I0]]) #[[#ATTR]]36; CHECK-NEXT:    [[A_I1:%.*]] = extractelement <4 x float> [[A]], i64 137; CHECK-NEXT:    [[DOTI13:%.*]] = call float @dx.op.unary.f32(i32 22, float [[A_I1]]) #[[#ATTR]]38; CHECK-NEXT:    [[A_I2:%.*]] = extractelement <4 x float> [[A]], i64 239; CHECK-NEXT:    [[DOTI22:%.*]] = call float @dx.op.unary.f32(i32 22, float [[A_I2]]) #[[#ATTR]]40; CHECK-NEXT:    [[A_I3:%.*]] = extractelement <4 x float> [[A]], i64 341; CHECK-NEXT:    [[DOTI31:%.*]] = call float @dx.op.unary.f32(i32 22, float [[A_I3]]) #[[#ATTR]]42; CHECK-NEXT:    [[DOTUPTO0:%.*]] = insertelement <4 x float> poison, float [[DOTI04]], i64 043; CHECK-NEXT:    [[DOTUPTO1:%.*]] = insertelement <4 x float> [[DOTUPTO0]], float [[DOTI13]], i64 144; CHECK-NEXT:    [[DOTUPTO2:%.*]] = insertelement <4 x float> [[DOTUPTO1]], float [[DOTI22]], i64 245; CHECK-NEXT:    [[TMP0:%.*]] = insertelement <4 x float> [[DOTUPTO2]], float [[DOTI31]], i64 346; CHECK-NEXT:    ret <4 x float> [[TMP0]]47;48entry:49  %2 = call <4 x float> @llvm.dx.frac.v4f32(<4 x float> %a)50  ret <4 x float> %251}52 53; CHECK: attributes #[[#ATTR]] = {{{.*}} memory(none) {{.*}}}54 55declare half  @llvm.dx.frac.f16(half)56declare float @llvm.dx.frac.f32(float)57declare <4 x float> @llvm.dx.frac.v4f32(<4 x float>)58