|
1 | 1 | // RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \ |
2 | 2 | // RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \ |
3 | | -// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \ |
4 | | -// RUN: --check-prefixes=CHECK,NATIVE_HALF |
| 3 | +// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \ |
| 4 | +// RUN: --check-prefixes=CHECK,DXIL_CHECK,DXIL_NATIVE_HALF,NATIVE_HALF |
5 | 5 | // RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \ |
6 | 6 | // RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \ |
7 | | -// RUN: -o - | FileCheck %s --check-prefixes=CHECK,NO_HALF |
| 7 | +// RUN: -o - | FileCheck %s --check-prefixes=CHECK,DXIL_CHECK,NO_HALF,DXIL_NO_HALF |
| 8 | +// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \ |
| 9 | +// RUN: spirv-unknown-vulkan-compute %s -fnative-half-type \ |
| 10 | +// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \ |
| 11 | +// RUN: --check-prefixes=CHECK,SPIR_CHECK,NATIVE_HALF,SPIR_NATIVE_HALF |
| 12 | +// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \ |
| 13 | +// RUN: spirv-unknown-vulkan-compute %s -emit-llvm -disable-llvm-passes \ |
| 14 | +// RUN: -o - | FileCheck %s --check-prefixes=CHECK,SPIR_CHECK,NO_HALF,SPIR_NO_HALF |
8 | 15 |
|
9 | | -// NATIVE_HALF: define noundef half @ |
10 | | -// NATIVE_HALF: %dx.frac = call half @llvm.dx.frac.f16( |
11 | | -// NATIVE_HALF: ret half %dx.frac |
12 | | -// NO_HALF: define noundef float @"?test_frac_half@@YA$halff@$halff@@Z"( |
13 | | -// NO_HALF: %dx.frac = call float @llvm.dx.frac.f32( |
14 | | -// NO_HALF: ret float %dx.frac |
| 16 | +// DXIL_NATIVE_HALF: define noundef half @ |
| 17 | +// SPIR_NATIVE_HALF: define spir_func noundef half @ |
| 18 | +// DXIL_NATIVE_HALF: %hlsl.frac = call half @llvm.dx.frac.f16( |
| 19 | +// SPIR_NATIVE_HALF: %hlsl.frac = call half @llvm.spv.frac.f16( |
| 20 | +// NATIVE_HALF: ret half %hlsl.frac |
| 21 | +// DXIL_NO_HALF: define noundef float @ |
| 22 | +// SPIR_NO_HALF: define spir_func noundef float @ |
| 23 | +// DXIL_NO_HALF: %hlsl.frac = call float @llvm.dx.frac.f32( |
| 24 | +// SPIR_NO_HALF: %hlsl.frac = call float @llvm.spv.frac.f32( |
| 25 | +// NO_HALF: ret float %hlsl.frac |
15 | 26 | half test_frac_half(half p0) { return frac(p0); } |
16 | | -// NATIVE_HALF: define noundef <2 x half> @ |
17 | | -// NATIVE_HALF: %dx.frac = call <2 x half> @llvm.dx.frac.v2f16 |
18 | | -// NATIVE_HALF: ret <2 x half> %dx.frac |
19 | | -// NO_HALF: define noundef <2 x float> @ |
20 | | -// NO_HALF: %dx.frac = call <2 x float> @llvm.dx.frac.v2f32( |
21 | | -// NO_HALF: ret <2 x float> %dx.frac |
| 27 | +// DXIL_NATIVE_HALF: define noundef <2 x half> @ |
| 28 | +// SPIR_NATIVE_HALF: define spir_func noundef <2 x half> @ |
| 29 | +// DXIL_NATIVE_HALF: %hlsl.frac = call <2 x half> @llvm.dx.frac.v2f16 |
| 30 | +// SPIR_NATIVE_HALF: %hlsl.frac = call <2 x half> @llvm.spv.frac.v2f16 |
| 31 | +// NATIVE_HALF: ret <2 x half> %hlsl.frac |
| 32 | +// DXIL_NO_HALF: define noundef <2 x float> @ |
| 33 | +// SPIR_NO_HALF: define spir_func noundef <2 x float> @ |
| 34 | +// DXIL_NO_HALF: %hlsl.frac = call <2 x float> @llvm.dx.frac.v2f32( |
| 35 | +// SPIR_NO_HALF: %hlsl.frac = call <2 x float> @llvm.spv.frac.v2f32( |
| 36 | +// NO_HALF: ret <2 x float> %hlsl.frac |
22 | 37 | half2 test_frac_half2(half2 p0) { return frac(p0); } |
23 | | -// NATIVE_HALF: define noundef <3 x half> @ |
24 | | -// NATIVE_HALF: %dx.frac = call <3 x half> @llvm.dx.frac.v3f16 |
25 | | -// NATIVE_HALF: ret <3 x half> %dx.frac |
26 | | -// NO_HALF: define noundef <3 x float> @ |
27 | | -// NO_HALF: %dx.frac = call <3 x float> @llvm.dx.frac.v3f32( |
28 | | -// NO_HALF: ret <3 x float> %dx.frac |
| 38 | +// DXIL_NATIVE_HALF: define noundef <3 x half> @ |
| 39 | +// SPIR_NATIVE_HALF: define spir_func noundef <3 x half> @ |
| 40 | +// DXIL_NATIVE_HALF: %hlsl.frac = call <3 x half> @llvm.dx.frac.v3f16 |
| 41 | +// SPIR_NATIVE_HALF: %hlsl.frac = call <3 x half> @llvm.spv.frac.v3f16 |
| 42 | +// NATIVE_HALF: ret <3 x half> %hlsl.frac |
| 43 | +// DXIL_NO_HALF: define noundef <3 x float> @ |
| 44 | +// SPIR_NO_HALF: define spir_func noundef <3 x float> @ |
| 45 | +// DXIL_NO_HALF: %hlsl.frac = call <3 x float> @llvm.dx.frac.v3f32( |
| 46 | +// SPIR_NO_HALF: %hlsl.frac = call <3 x float> @llvm.spv.frac.v3f32( |
| 47 | +// NO_HALF: ret <3 x float> %hlsl.frac |
29 | 48 | half3 test_frac_half3(half3 p0) { return frac(p0); } |
30 | | -// NATIVE_HALF: define noundef <4 x half> @ |
31 | | -// NATIVE_HALF: %dx.frac = call <4 x half> @llvm.dx.frac.v4f16 |
32 | | -// NATIVE_HALF: ret <4 x half> %dx.frac |
33 | | -// NO_HALF: define noundef <4 x float> @ |
34 | | -// NO_HALF: %dx.frac = call <4 x float> @llvm.dx.frac.v4f32( |
35 | | -// NO_HALF: ret <4 x float> %dx.frac |
| 49 | +// DXIL_NATIVE_HALF: define noundef <4 x half> @ |
| 50 | +// SPIR_NATIVE_HALF: define spir_func noundef <4 x half> @ |
| 51 | +// DXIL_NATIVE_HALF: %hlsl.frac = call <4 x half> @llvm.dx.frac.v4f16 |
| 52 | +// SPIR_NATIVE_HALF: %hlsl.frac = call <4 x half> @llvm.spv.frac.v4f16 |
| 53 | +// NATIVE_HALF: ret <4 x half> %hlsl.frac |
| 54 | +// DXIL_NO_HALF: define noundef <4 x float> @ |
| 55 | +// SPIR_NO_HALF: define spir_func noundef <4 x float> @ |
| 56 | +// DXIL_NO_HALF: %hlsl.frac = call <4 x float> @llvm.dx.frac.v4f32( |
| 57 | +// SPIR_NO_HALF: %hlsl.frac = call <4 x float> @llvm.spv.frac.v4f32( |
| 58 | +// NO_HALF: ret <4 x float> %hlsl.frac |
36 | 59 | half4 test_frac_half4(half4 p0) { return frac(p0); } |
37 | 60 |
|
38 | | -// CHECK: define noundef float @ |
39 | | -// CHECK: %dx.frac = call float @llvm.dx.frac.f32( |
40 | | -// CHECK: ret float %dx.frac |
| 61 | +// DXIL_CHECK: define noundef float @ |
| 62 | +// SPIR_CHECK: define spir_func noundef float @ |
| 63 | +// DXIL_CHECK: %hlsl.frac = call float @llvm.dx.frac.f32( |
| 64 | +// SPIR_CHECK: %hlsl.frac = call float @llvm.spv.frac.f32( |
| 65 | +// CHECK: ret float %hlsl.frac |
41 | 66 | float test_frac_float(float p0) { return frac(p0); } |
42 | | -// CHECK: define noundef <2 x float> @ |
43 | | -// CHECK: %dx.frac = call <2 x float> @llvm.dx.frac.v2f32 |
44 | | -// CHECK: ret <2 x float> %dx.frac |
| 67 | +// DXIL_CHECK: define noundef <2 x float> @ |
| 68 | +// SPIR_CHECK: define spir_func noundef <2 x float> @ |
| 69 | +// DXIL_CHECK: %hlsl.frac = call <2 x float> @llvm.dx.frac.v2f32 |
| 70 | +// SPIR_CHECK: %hlsl.frac = call <2 x float> @llvm.spv.frac.v2f32 |
| 71 | +// CHECK: ret <2 x float> %hlsl.frac |
45 | 72 | float2 test_frac_float2(float2 p0) { return frac(p0); } |
46 | | -// CHECK: define noundef <3 x float> @ |
47 | | -// CHECK: %dx.frac = call <3 x float> @llvm.dx.frac.v3f32 |
48 | | -// CHECK: ret <3 x float> %dx.frac |
| 73 | +// DXIL_CHECK: define noundef <3 x float> @ |
| 74 | +// SPIR_CHECK: define spir_func noundef <3 x float> @ |
| 75 | +// DXIL_CHECK: %hlsl.frac = call <3 x float> @llvm.dx.frac.v3f32 |
| 76 | +// SPIR_CHECK: %hlsl.frac = call <3 x float> @llvm.spv.frac.v3f32 |
| 77 | +// CHECK: ret <3 x float> %hlsl.frac |
49 | 78 | float3 test_frac_float3(float3 p0) { return frac(p0); } |
50 | | -// CHECK: define noundef <4 x float> @ |
51 | | -// CHECK: %dx.frac = call <4 x float> @llvm.dx.frac.v4f32 |
52 | | -// CHECK: ret <4 x float> %dx.frac |
| 79 | +// DXIL_CHECK: define noundef <4 x float> @ |
| 80 | +// SPIR_CHECK: define spir_func noundef <4 x float> @ |
| 81 | +// DXIL_CHECK: %hlsl.frac = call <4 x float> @llvm.dx.frac.v4f32 |
| 82 | +// SPIR_CHECK: %hlsl.frac = call <4 x float> @llvm.spv.frac.v4f32 |
| 83 | +// CHECK: ret <4 x float> %hlsl.frac |
53 | 84 | float4 test_frac_float4(float4 p0) { return frac(p0); } |
0 commit comments