|
1 | 1 | // RUN: %clang_cc1 -finclude-default-header -x hlsl -triple dxil-pc-shadermodel6.3-library %s \ |
2 | 2 | // RUN: -emit-llvm -disable-llvm-passes -fnative-half-type -o - | \ |
3 | 3 | // RUN: FileCheck %s --check-prefixes=CHECK |
| 4 | +// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple spirv-pc-vulkan-compute %s \ |
| 5 | +// RUN: -emit-llvm -disable-llvm-passes -fnative-half-type -o - | \ |
| 6 | +// RUN: FileCheck %s --check-prefixes=CHECK-SPIRV |
4 | 7 |
|
5 | | -using hlsl::ddx_coarse; |
6 | | - |
7 | | -// CHECK: define linkonce_odr hidden noundef nofpclass(nan inf) half @ |
8 | | -// CHECK: %hlsl.ddx.coarse = call reassoc nnan ninf nsz arcp afn half @llvm.dx.ddx.coarse.f16(half %{{.*}}) |
| 8 | +// CHECK-LABEL: half @_Z19test_f16_ddx_coarseDh |
| 9 | +// CHECK: %hlsl.ddx.coarse = call {{.*}} half @llvm.dx.ddx.coarse.f16(half %{{.*}}) |
9 | 10 | // CHECK: ret half %hlsl.ddx.coarse |
| 11 | +// CHECK-LABEL-SPIRV: half @_Z19test_f16_ddx_coarseDh |
| 12 | +// CHECK-SPIRV: %hlsl.ddx.coarse = call {{.*}} half @llvm.spv.ddx.coarse.f16(half %{{.*}}) |
| 13 | +// CHECK-SPIRV: ret half %hlsl.ddx.coarse |
10 | 14 | half test_f16_ddx_coarse(half val) { |
11 | 15 | return ddx_coarse(val); |
12 | 16 | } |
13 | 17 |
|
14 | | -// CHECK: define linkonce_odr hidden noundef nofpclass(nan inf) <2 x half> @ |
15 | | -// CHECK: %hlsl.ddx.coarse = call reassoc nnan ninf nsz arcp afn <2 x half> @llvm.dx.ddx.coarse.v2f16(<2 x half> %{{.*}}) |
| 18 | +// CHECK-LABEL: <2 x half> @_Z20test_f16_ddx_coarse2Dv2_Dh |
| 19 | +// CHECK: %hlsl.ddx.coarse = call {{.*}} <2 x half> @llvm.dx.ddx.coarse.v2f16(<2 x half> %{{.*}}) |
16 | 20 | // CHECK: ret <2 x half> %hlsl.ddx.coarse |
| 21 | +// CHECK-LABEL-SPIRV: <2 x half> @_Z20test_f16_ddx_coarse2Dv2_Dh |
| 22 | +// CHECK-SPIRV: %hlsl.ddx.coarse = call {{.*}} <2 x half> @llvm.spv.ddx.coarse.v2f16(<2 x half> %{{.*}}) |
| 23 | +// CHECK-SPIRV: ret <2 x half> %hlsl.ddx.coarse |
17 | 24 | half2 test_f16_ddx_coarse2(half2 val) { |
18 | 25 | return ddx_coarse(val); |
19 | 26 | } |
20 | 27 |
|
21 | | -// CHECK: define linkonce_odr hidden noundef nofpclass(nan inf) <3 x half> @ |
22 | | -// CHECK: %hlsl.ddx.coarse = call reassoc nnan ninf nsz arcp afn <3 x half> @llvm.dx.ddx.coarse.v3f16(<3 x half> %{{.*}}) |
| 28 | +// CHECK-LABEL: <3 x half> @_Z20test_f16_ddx_coarse3Dv3_Dh |
| 29 | +// CHECK: %hlsl.ddx.coarse = call {{.*}} <3 x half> @llvm.dx.ddx.coarse.v3f16(<3 x half> %{{.*}}) |
23 | 30 | // CHECK: ret <3 x half> %hlsl.ddx.coarse |
| 31 | +// CHECK-LABEL-SPIRV: <3 x half> @_Z20test_f16_ddx_coarse3Dv3_Dh |
| 32 | +// CHECK-SPIRV: %hlsl.ddx.coarse = call {{.*}} <3 x half> @llvm.spv.ddx.coarse.v3f16(<3 x half> %{{.*}}) |
| 33 | +// CHECK-SPIRV: ret <3 x half> %hlsl.ddx.coarse |
24 | 34 | half3 test_f16_ddx_coarse3(half3 val) { |
25 | 35 | return ddx_coarse(val); |
26 | 36 | } |
27 | 37 |
|
28 | | -// CHECK: define linkonce_odr hidden noundef nofpclass(nan inf) <4 x half> @ |
29 | | -// CHECK: %hlsl.ddx.coarse = call reassoc nnan ninf nsz arcp afn <4 x half> @llvm.dx.ddx.coarse.v4f16(<4 x half> %{{.*}}) |
| 38 | +// CHECK-LABEL: <4 x half> @_Z20test_f16_ddx_coarse4Dv4_Dh |
| 39 | +// CHECK: %hlsl.ddx.coarse = call {{.*}} <4 x half> @llvm.dx.ddx.coarse.v4f16(<4 x half> %{{.*}}) |
30 | 40 | // CHECK: ret <4 x half> %hlsl.ddx.coarse |
| 41 | +// CHECK-LABEL-SPIRV: <4 x half> @_Z20test_f16_ddx_coarse4Dv4_Dh |
| 42 | +// CHECK-SPIRV: %hlsl.ddx.coarse = call {{.*}} <4 x half> @llvm.spv.ddx.coarse.v4f16(<4 x half> %{{.*}}) |
| 43 | +// CHECK-SPIRV: ret <4 x half> %hlsl.ddx.coarse |
31 | 44 | half4 test_f16_ddx_coarse4(half4 val) { |
32 | 45 | return ddx_coarse(val); |
33 | 46 | } |
34 | 47 |
|
35 | | -// CHECK: define linkonce_odr hidden noundef nofpclass(nan inf) float @ |
36 | | -// CHECK: %hlsl.ddx.coarse = call reassoc nnan ninf nsz arcp afn float @llvm.dx.ddx.coarse.f32(float %{{.*}}) |
| 48 | +// CHECK-LABEL: float @_Z19test_f32_ddx_coarsef |
| 49 | +// CHECK: %hlsl.ddx.coarse = call {{.*}} float @llvm.dx.ddx.coarse.f32(float %{{.*}}) |
37 | 50 | // CHECK: ret float %hlsl.ddx.coarse |
| 51 | +// CHECK-LABEL-SPIRV: float @_Z19test_f32_ddx_coarsef |
| 52 | +// CHECK-SPIRV: %hlsl.ddx.coarse = call {{.*}} float @llvm.spv.ddx.coarse.f32(float %{{.*}}) |
| 53 | +// CHECK-SPIRV: ret float %hlsl.ddx.coarse |
38 | 54 | float test_f32_ddx_coarse(float val) { |
39 | 55 | return ddx_coarse(val); |
40 | 56 | } |
41 | 57 |
|
42 | | -// CHECK: define linkonce_odr hidden noundef nofpclass(nan inf) <2 x float> @ |
43 | | -// CHECK: %hlsl.ddx.coarse = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.dx.ddx.coarse.v2f32(<2 x float> %{{.*}}) |
| 58 | +// CHECK-LABEL: <2 x float> @_Z20test_f32_ddx_coarse2Dv2_f |
| 59 | +// CHECK: %hlsl.ddx.coarse = call {{.*}} <2 x float> @llvm.dx.ddx.coarse.v2f32(<2 x float> %{{.*}}) |
44 | 60 | // CHECK: ret <2 x float> %hlsl.ddx.coarse |
| 61 | +// CHECK-LABEL-SPIRV: <2 x float> @_Z20test_f32_ddx_coarse2Dv2_f |
| 62 | +// CHECK-SPIRV: %hlsl.ddx.coarse = call {{.*}} <2 x float> @llvm.spv.ddx.coarse.v2f32(<2 x float> %{{.*}}) |
| 63 | +// CHECK-SPIRV: ret <2 x float> %hlsl.ddx.coarse |
45 | 64 | float2 test_f32_ddx_coarse2(float2 val) { |
46 | 65 | return ddx_coarse(val); |
47 | 66 | } |
48 | 67 |
|
49 | | -// CHECK: define linkonce_odr hidden noundef nofpclass(nan inf) <3 x float> @ |
50 | | -// CHECK: %hlsl.ddx.coarse = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.dx.ddx.coarse.v3f32(<3 x float> %{{.*}}) |
| 68 | +// CHECK-LABEL: <3 x float> @_Z20test_f32_ddx_coarse3Dv3_f |
| 69 | +// CHECK: %hlsl.ddx.coarse = call {{.*}} <3 x float> @llvm.dx.ddx.coarse.v3f32(<3 x float> %{{.*}}) |
51 | 70 | // CHECK: ret <3 x float> %hlsl.ddx.coarse |
| 71 | +// CHECK-LABEL-SPIRV: <3 x float> @_Z20test_f32_ddx_coarse3Dv3_f |
| 72 | +// CHECK-SPIRV: %hlsl.ddx.coarse = call {{.*}} <3 x float> @llvm.spv.ddx.coarse.v3f32(<3 x float> %{{.*}}) |
| 73 | +// CHECK-SPIRV: ret <3 x float> %hlsl.ddx.coarse |
52 | 74 | float3 test_f32_ddx_coarse3(float3 val) { |
53 | 75 | return ddx_coarse(val); |
54 | 76 | } |
55 | 77 |
|
56 | | -// CHECK: define linkonce_odr hidden noundef nofpclass(nan inf) <4 x float> @ |
57 | | -// CHECK: %hlsl.ddx.coarse = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.dx.ddx.coarse.v4f32(<4 x float> %{{.*}}) |
| 78 | +// CHECK-LABEL: <4 x float> @_Z20test_f32_ddx_coarse4Dv4_f |
| 79 | +// CHECK: %hlsl.ddx.coarse = call {{.*}} <4 x float> @llvm.dx.ddx.coarse.v4f32(<4 x float> %{{.*}}) |
58 | 80 | // CHECK: ret <4 x float> %hlsl.ddx.coarse |
| 81 | +// CHECK-LABEL-SPIRV: <4 x float> @_Z20test_f32_ddx_coarse4Dv4_f |
| 82 | +// CHECK-SPIRV: %hlsl.ddx.coarse = call {{.*}} <4 x float> @llvm.spv.ddx.coarse.v4f32(<4 x float> %{{.*}}) |
| 83 | +// CHECK-SPIRV: ret <4 x float> %hlsl.ddx.coarse |
59 | 84 | float4 test_f32_ddx_coarse4(float4 val) { |
60 | 85 | return ddx_coarse(val); |
61 | 86 | } |
0 commit comments