|
1 | | -; RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s |
| 1 | +; RUN: opt -S -scalarizer -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s |
2 | 2 |
|
3 | 3 | ; Make sure dxil operation function calls for acos are generated for float and half. |
4 | 4 |
|
5 | | -define noundef float @tan_float(float noundef %a) { |
| 5 | +define noundef float @acos_float(float noundef %a) { |
6 | 6 | entry: |
7 | 7 | ; CHECK:call float @dx.op.unary.f32(i32 15, float %{{.*}}) |
8 | 8 | %elt.acos = call float @llvm.acos.f32(float %a) |
9 | 9 | ret float %elt.acos |
10 | 10 | } |
11 | 11 |
|
12 | | -define noundef half @tan_half(half noundef %a) { |
| 12 | +define noundef half @acos_half(half noundef %a) { |
13 | 13 | entry: |
14 | 14 | ; CHECK:call half @dx.op.unary.f16(i32 15, half %{{.*}}) |
15 | 15 | %elt.acos = call half @llvm.acos.f16(half %a) |
16 | 16 | ret half %elt.acos |
17 | 17 | } |
18 | 18 |
|
| 19 | +define noundef <4 x float> @acos_float4(<4 x float> noundef %a) { |
| 20 | +entry: |
| 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) |
| 34 | + ret <4 x float> %2 |
| 35 | +} |
| 36 | + |
19 | 37 | declare half @llvm.acos.f16(half) |
20 | 38 | declare float @llvm.acos.f32(float) |
| 39 | +declare <4 x float> @llvm.acos.v4f32(<4 x float>) |
0 commit comments