1 ; RUN: opt -S -scalarizer -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s
3 ; Make sure dxil operation function calls for acos are generated for float and half.
5 define noundef float @acos_float(float noundef %a) {
7 ; CHECK:call float @dx.op.unary.f32(i32 15, float %{{.*}})
8 %elt.acos = call float @llvm.acos.f32(float %a)
12 define noundef half @acos_half(half noundef %a) {
14 ; CHECK:call half @dx.op.unary.f16(i32 15, half %{{.*}})
15 %elt.acos = call half @llvm.acos.f16(half %a)
19 define noundef <4 x float> @acos_float4(<4 x float> noundef %a) {
21 ; CHECK: [[ee0:%.*]] = extractelement <4 x float> %a, i64 0
22 ; CHECK: [[ie0:%.*]] = call float @dx.op.unary.f32(i32 15, float [[ee0]])
23 ; CHECK: [[ee1:%.*]] = extractelement <4 x float> %a, i64 1
24 ; CHECK: [[ie1:%.*]] = call float @dx.op.unary.f32(i32 15, float [[ee1]])
25 ; CHECK: [[ee2:%.*]] = extractelement <4 x float> %a, i64 2
26 ; CHECK: [[ie2:%.*]] = call float @dx.op.unary.f32(i32 15, float [[ee2]])
27 ; CHECK: [[ee3:%.*]] = extractelement <4 x float> %a, i64 3
28 ; CHECK: [[ie3:%.*]] = call float @dx.op.unary.f32(i32 15, float [[ee3]])
29 ; CHECK: insertelement <4 x float> poison, float [[ie0]], i64 0
30 ; CHECK: insertelement <4 x float> %{{.*}}, float [[ie1]], i64 1
31 ; CHECK: insertelement <4 x float> %{{.*}}, float [[ie2]], i64 2
32 ; CHECK: insertelement <4 x float> %{{.*}}, float [[ie3]], i64 3
33 %2 = call <4 x float> @llvm.acos.v4f32(<4 x float> %a)
37 declare half @llvm.acos.f16(half)
38 declare float @llvm.acos.f32(float)
39 declare <4 x float> @llvm.acos.v4f32(<4 x float>)