|
1 | 1 | // RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
|
2 | 2 | // RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \
|
3 | 3 | // RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \
|
4 |
| -// RUN: --check-prefixes=CHECK,DXIL_CHECK,DXIL_NATIVE_HALF,NATIVE_HALF |
| 4 | +// RUN: --check-prefixes=CHECK,NATIVE_HALF \ |
| 5 | +// RUN: -DFNATTRS=noundef -DTARGET=dx |
5 | 6 | // RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
|
6 | 7 | // RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \
|
7 |
| -// RUN: -o - | FileCheck %s --check-prefixes=CHECK,DXIL_CHECK,NO_HALF,DXIL_NO_HALF |
| 8 | +// RUN: -o - | FileCheck %s --check-prefixes=CHECK,NO_HALF \ |
| 9 | +// RUN: -DFNATTRS=noundef -DTARGET=dx |
8 | 10 | // RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
|
9 | 11 | // RUN: spirv-unknown-vulkan-compute %s -fnative-half-type \
|
10 | 12 | // RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \
|
11 |
| -// RUN: --check-prefixes=CHECK,NATIVE_HALF,SPIR_NATIVE_HALF,SPIR_CHECK |
| 13 | +// RUN: --check-prefixes=CHECK,NATIVE_HALF \ |
| 14 | +// RUN: -DFNATTRS="spir_func noundef" -DTARGET=spv |
12 | 15 | // RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
|
13 | 16 | // RUN: spirv-unknown-vulkan-compute %s -emit-llvm -disable-llvm-passes \
|
14 |
| -// RUN: -o - | FileCheck %s --check-prefixes=CHECK,NO_HALF,SPIR_NO_HALF,SPIR_CHECK |
| 17 | +// RUN: -o - | FileCheck %s --check-prefixes=CHECK,NO_HALF \ |
| 18 | +// RUN: -DFNATTRS="spir_func noundef" -DTARGET=spv |
15 | 19 |
|
16 |
| - |
17 |
| -// DXIL_NATIVE_HALF: %hlsl.lerp = call half @llvm.dx.lerp.f16(half %{{.*}}, half %{{.*}}, half %{{.*}}) |
18 |
| -// SPIR_NATIVE_HALF: %hlsl.lerp = call half @llvm.spv.lerp.f16(half %{{.*}}, half %{{.*}}, half %{{.*}}) |
| 20 | +// NATIVE_HALF: %hlsl.lerp = call half @llvm.[[TARGET]].lerp.f16(half %{{.*}}, half %{{.*}}, half %{{.*}}) |
19 | 21 | // NATIVE_HALF: ret half %hlsl.lerp
|
20 |
| -// DXIL_NO_HALF: %hlsl.lerp = call float @llvm.dx.lerp.f32(float %{{.*}}, float %{{.*}}, float %{{.*}}) |
21 |
| -// SPIR_NO_HALF: %hlsl.lerp = call float @llvm.spv.lerp.f32(float %{{.*}}, float %{{.*}}, float %{{.*}}) |
| 22 | +// NO_HALF: %hlsl.lerp = call float @llvm.[[TARGET]].lerp.f32(float %{{.*}}, float %{{.*}}, float %{{.*}}) |
22 | 23 | // NO_HALF: ret float %hlsl.lerp
|
23 | 24 | half test_lerp_half(half p0) { return lerp(p0, p0, p0); }
|
24 | 25 |
|
25 |
| -// DXIL_NATIVE_HALF: %hlsl.lerp = call <2 x half> @llvm.dx.lerp.v2f16(<2 x half> %{{.*}}, <2 x half> %{{.*}}, <2 x half> %{{.*}}) |
26 |
| -// SPIR_NATIVE_HALF: %hlsl.lerp = call <2 x half> @llvm.spv.lerp.v2f16(<2 x half> %{{.*}}, <2 x half> %{{.*}}, <2 x half> %{{.*}}) |
| 26 | +// NATIVE_HALF: %hlsl.lerp = call <2 x half> @llvm.[[TARGET]].lerp.v2f16(<2 x half> %{{.*}}, <2 x half> %{{.*}}, <2 x half> %{{.*}}) |
27 | 27 | // NATIVE_HALF: ret <2 x half> %hlsl.lerp
|
28 |
| -// DXIL_NO_HALF: %hlsl.lerp = call <2 x float> @llvm.dx.lerp.v2f32(<2 x float> %{{.*}}, <2 x float> %{{.*}}, <2 x float> %{{.*}}) |
29 |
| -// SPIR_NO_HALF: %hlsl.lerp = call <2 x float> @llvm.spv.lerp.v2f32(<2 x float> %{{.*}}, <2 x float> %{{.*}}, <2 x float> %{{.*}}) |
| 28 | +// NO_HALF: %hlsl.lerp = call <2 x float> @llvm.[[TARGET]].lerp.v2f32(<2 x float> %{{.*}}, <2 x float> %{{.*}}, <2 x float> %{{.*}}) |
30 | 29 | // NO_HALF: ret <2 x float> %hlsl.lerp
|
31 | 30 | half2 test_lerp_half2(half2 p0) { return lerp(p0, p0, p0); }
|
32 | 31 |
|
33 |
| -// DXIL_NATIVE_HALF: %hlsl.lerp = call <3 x half> @llvm.dx.lerp.v3f16(<3 x half> %{{.*}}, <3 x half> %{{.*}}, <3 x half> %{{.*}}) |
34 |
| -// SPIR_NATIVE_HALF: %hlsl.lerp = call <3 x half> @llvm.spv.lerp.v3f16(<3 x half> %{{.*}}, <3 x half> %{{.*}}, <3 x half> %{{.*}}) |
| 32 | +// NATIVE_HALF: %hlsl.lerp = call <3 x half> @llvm.[[TARGET]].lerp.v3f16(<3 x half> %{{.*}}, <3 x half> %{{.*}}, <3 x half> %{{.*}}) |
35 | 33 | // NATIVE_HALF: ret <3 x half> %hlsl.lerp
|
36 |
| -// DXIL_NO_HALF: %hlsl.lerp = call <3 x float> @llvm.dx.lerp.v3f32(<3 x float> %{{.*}}, <3 x float> %{{.*}}, <3 x float> %{{.*}}) |
37 |
| -// SPIR_NO_HALF: %hlsl.lerp = call <3 x float> @llvm.spv.lerp.v3f32(<3 x float> %{{.*}}, <3 x float> %{{.*}}, <3 x float> %{{.*}}) |
| 34 | +// NO_HALF: %hlsl.lerp = call <3 x float> @llvm.[[TARGET]].lerp.v3f32(<3 x float> %{{.*}}, <3 x float> %{{.*}}, <3 x float> %{{.*}}) |
38 | 35 | // NO_HALF: ret <3 x float> %hlsl.lerp
|
39 | 36 | half3 test_lerp_half3(half3 p0) { return lerp(p0, p0, p0); }
|
40 | 37 |
|
41 |
| -// DXIL_NATIVE_HALF: %hlsl.lerp = call <4 x half> @llvm.dx.lerp.v4f16(<4 x half> %{{.*}}, <4 x half> %{{.*}}, <4 x half> %{{.*}}) |
42 |
| -// SPIR_NATIVE_HALF: %hlsl.lerp = call <4 x half> @llvm.spv.lerp.v4f16(<4 x half> %{{.*}}, <4 x half> %{{.*}}, <4 x half> %{{.*}}) |
| 38 | +// NATIVE_HALF: %hlsl.lerp = call <4 x half> @llvm.[[TARGET]].lerp.v4f16(<4 x half> %{{.*}}, <4 x half> %{{.*}}, <4 x half> %{{.*}}) |
43 | 39 | // NATIVE_HALF: ret <4 x half> %hlsl.lerp
|
44 |
| -// DXIL_NO_HALF: %hlsl.lerp = call <4 x float> @llvm.dx.lerp.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}}) |
45 |
| -// SPIR_NO_HALF: %hlsl.lerp = call <4 x float> @llvm.spv.lerp.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}}) |
| 40 | +// NO_HALF: %hlsl.lerp = call <4 x float> @llvm.[[TARGET]].lerp.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}}) |
46 | 41 | // NO_HALF: ret <4 x float> %hlsl.lerp
|
47 | 42 | half4 test_lerp_half4(half4 p0) { return lerp(p0, p0, p0); }
|
48 | 43 |
|
49 |
| -// DXIL_CHECK: %hlsl.lerp = call float @llvm.dx.lerp.f32(float %{{.*}}, float %{{.*}}, float %{{.*}}) |
50 |
| -// SPIR_CHECK: %hlsl.lerp = call float @llvm.spv.lerp.f32(float %{{.*}}, float %{{.*}}, float %{{.*}}) |
| 44 | +// CHECK: %hlsl.lerp = call float @llvm.[[TARGET]].lerp.f32(float %{{.*}}, float %{{.*}}, float %{{.*}}) |
51 | 45 | // CHECK: ret float %hlsl.lerp
|
52 | 46 | float test_lerp_float(float p0) { return lerp(p0, p0, p0); }
|
53 | 47 |
|
54 |
| -// DXIL_CHECK: %hlsl.lerp = call <2 x float> @llvm.dx.lerp.v2f32(<2 x float> %{{.*}}, <2 x float> %{{.*}}, <2 x float> %{{.*}}) |
55 |
| -// SPIR_CHECK: %hlsl.lerp = call <2 x float> @llvm.spv.lerp.v2f32(<2 x float> %{{.*}}, <2 x float> %{{.*}}, <2 x float> %{{.*}}) |
| 48 | +// CHECK: %hlsl.lerp = call <2 x float> @llvm.[[TARGET]].lerp.v2f32(<2 x float> %{{.*}}, <2 x float> %{{.*}}, <2 x float> %{{.*}}) |
56 | 49 | // CHECK: ret <2 x float> %hlsl.lerp
|
57 | 50 | float2 test_lerp_float2(float2 p0) { return lerp(p0, p0, p0); }
|
58 | 51 |
|
59 |
| -// DXIL_CHECK: %hlsl.lerp = call <3 x float> @llvm.dx.lerp.v3f32(<3 x float> %{{.*}}, <3 x float> %{{.*}}, <3 x float> %{{.*}}) |
60 |
| -// SPIR_CHECK: %hlsl.lerp = call <3 x float> @llvm.spv.lerp.v3f32(<3 x float> %{{.*}}, <3 x float> %{{.*}}, <3 x float> %{{.*}}) |
| 52 | +// CHECK: %hlsl.lerp = call <3 x float> @llvm.[[TARGET]].lerp.v3f32(<3 x float> %{{.*}}, <3 x float> %{{.*}}, <3 x float> %{{.*}}) |
61 | 53 | // CHECK: ret <3 x float> %hlsl.lerp
|
62 | 54 | float3 test_lerp_float3(float3 p0) { return lerp(p0, p0, p0); }
|
63 | 55 |
|
64 |
| -// DXIL_CHECK: %hlsl.lerp = call <4 x float> @llvm.dx.lerp.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}}) |
65 |
| -// SPIR_CHECK: %hlsl.lerp = call <4 x float> @llvm.spv.lerp.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}}) |
| 56 | +// CHECK: %hlsl.lerp = call <4 x float> @llvm.[[TARGET]].lerp.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}}) |
66 | 57 | // CHECK: ret <4 x float> %hlsl.lerp
|
67 | 58 | float4 test_lerp_float4(float4 p0) { return lerp(p0, p0, p0); }
|
68 | 59 |
|
69 | 60 | // CHECK: %[[b:.*]] = load <2 x float>, ptr %p1.addr, align 8
|
70 | 61 | // CHECK: %[[c:.*]] = load <2 x float>, ptr %p1.addr, align 8
|
71 |
| -// DXIL_CHECK: %hlsl.lerp = call <2 x float> @llvm.dx.lerp.v2f32(<2 x float> %splat.splat, <2 x float> %[[b]], <2 x float> %[[c]]) |
72 |
| -// SPIR_CHECK: %hlsl.lerp = call <2 x float> @llvm.spv.lerp.v2f32(<2 x float> %splat.splat, <2 x float> %[[b]], <2 x float> %[[c]]) |
| 62 | +// CHECK: %hlsl.lerp = call <2 x float> @llvm.[[TARGET]].lerp.v2f32(<2 x float> %splat.splat, <2 x float> %[[b]], <2 x float> %[[c]]) |
73 | 63 | // CHECK: ret <2 x float> %hlsl.lerp
|
74 | 64 | float2 test_lerp_float2_splat(float p0, float2 p1) { return lerp(p0, p1, p1); }
|
75 | 65 |
|
76 | 66 | // CHECK: %[[b:.*]] = load <3 x float>, ptr %p1.addr, align 16
|
77 | 67 | // CHECK: %[[c:.*]] = load <3 x float>, ptr %p1.addr, align 16
|
78 |
| -// DXIL_CHECK: %hlsl.lerp = call <3 x float> @llvm.dx.lerp.v3f32(<3 x float> %splat.splat, <3 x float> %[[b]], <3 x float> %[[c]]) |
79 |
| -// SPIR_CHECK: %hlsl.lerp = call <3 x float> @llvm.spv.lerp.v3f32(<3 x float> %splat.splat, <3 x float> %[[b]], <3 x float> %[[c]]) |
| 68 | +// CHECK: %hlsl.lerp = call <3 x float> @llvm.[[TARGET]].lerp.v3f32(<3 x float> %splat.splat, <3 x float> %[[b]], <3 x float> %[[c]]) |
80 | 69 | // CHECK: ret <3 x float> %hlsl.lerp
|
81 | 70 | float3 test_lerp_float3_splat(float p0, float3 p1) { return lerp(p0, p1, p1); }
|
82 | 71 |
|
83 | 72 | // CHECK: %[[b:.*]] = load <4 x float>, ptr %p1.addr, align 16
|
84 | 73 | // CHECK: %[[c:.*]] = load <4 x float>, ptr %p1.addr, align 16
|
85 |
| -// DXIL_CHECK: %hlsl.lerp = call <4 x float> @llvm.dx.lerp.v4f32(<4 x float> %splat.splat, <4 x float> %[[b]], <4 x float> %[[c]]) |
86 |
| -// SPIR_CHECK: %hlsl.lerp = call <4 x float> @llvm.spv.lerp.v4f32(<4 x float> %splat.splat, <4 x float> %[[b]], <4 x float> %[[c]]) |
| 74 | +// CHECK: %hlsl.lerp = call <4 x float> @llvm.[[TARGET]].lerp.v4f32(<4 x float> %splat.splat, <4 x float> %[[b]], <4 x float> %[[c]]) |
87 | 75 | // CHECK: ret <4 x float> %hlsl.lerp
|
88 | 76 | float4 test_lerp_float4_splat(float p0, float4 p1) { return lerp(p0, p1, p1); }
|
0 commit comments