|
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,NATIVE_HALF |
| 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 |
8 |
| - |
9 |
| -// NATIVE_HALF: define noundef half @ |
10 |
| -// NATIVE_HALF: %dx.rcp = call half @llvm.dx.rcp.f16( |
11 |
| -// NATIVE_HALF: ret half %dx.rcp |
12 |
| -// NO_HALF: define noundef float @"?test_rcp_half@@YA$halff@$halff@@Z"( |
13 |
| -// NO_HALF: %dx.rcp = call float @llvm.dx.rcp.f32( |
14 |
| -// NO_HALF: ret float %dx.rcp |
| 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,NATIVE_HALF,SPIR_NATIVE_HALF,SPIR_CHECK |
| 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,NO_HALF,SPIR_NO_HALF,SPIR_CHECK |
| 15 | + |
| 16 | +// DXIL_NATIVE_HALF: define noundef half @ |
| 17 | +// SPIR_NATIVE_HALF: define spir_func noundef half @ |
| 18 | +// NATIVE_HALF: %hlsl.rcp = fdiv half 0xH3C00, %{{.*}} |
| 19 | +// NATIVE_HALF: ret half %hlsl.rcp |
| 20 | +// DXIL_NO_HALF: define noundef float @ |
| 21 | +// SPIR_NO_HALF: define spir_func noundef float @ |
| 22 | +// NO_HALF: %hlsl.rcp = fdiv float 1.000000e+00, %{{.*}} |
| 23 | +// NO_HALF: ret float %hlsl.rcp |
15 | 24 | half test_rcp_half(half p0) { return rcp(p0); }
|
16 |
| -// NATIVE_HALF: define noundef <2 x half> @ |
17 |
| -// NATIVE_HALF: %dx.rcp = call <2 x half> @llvm.dx.rcp.v2f16 |
18 |
| -// NATIVE_HALF: ret <2 x half> %dx.rcp |
19 |
| -// NO_HALF: define noundef <2 x float> @ |
20 |
| -// NO_HALF: %dx.rcp = call <2 x float> @llvm.dx.rcp.v2f32( |
21 |
| -// NO_HALF: ret <2 x float> %dx.rcp |
| 25 | + |
| 26 | +// DXIL_NATIVE_HALF: define noundef <2 x half> @ |
| 27 | +// SPIR_NATIVE_HALF: define spir_func noundef <2 x half> @ |
| 28 | +// NATIVE_HALF: %hlsl.rcp = fdiv <2 x half> <half 0xH3C00, half 0xH3C00>, %{{.*}} |
| 29 | +// NATIVE_HALF: ret <2 x half> %hlsl.rcp |
| 30 | +// DXIL_NO_HALF: define noundef <2 x float> @ |
| 31 | +// SPIR_NO_HALF: define spir_func noundef <2 x float> @ |
| 32 | +// NO_HALF: %hlsl.rcp = fdiv <2 x float> <float 1.000000e+00, float 1.000000e+00>, %{{.*}} |
| 33 | +// NO_HALF: ret <2 x float> %hlsl.rcp |
22 | 34 | half2 test_rcp_half2(half2 p0) { return rcp(p0); }
|
23 |
| -// NATIVE_HALF: define noundef <3 x half> @ |
24 |
| -// NATIVE_HALF: %dx.rcp = call <3 x half> @llvm.dx.rcp.v3f16 |
25 |
| -// NATIVE_HALF: ret <3 x half> %dx.rcp |
26 |
| -// NO_HALF: define noundef <3 x float> @ |
27 |
| -// NO_HALF: %dx.rcp = call <3 x float> @llvm.dx.rcp.v3f32( |
28 |
| -// NO_HALF: ret <3 x float> %dx.rcp |
| 35 | + |
| 36 | +// DXIL_NATIVE_HALF: define noundef <3 x half> @ |
| 37 | +// SPIR_NATIVE_HALF: define spir_func noundef <3 x half> @ |
| 38 | +// NATIVE_HALF: %hlsl.rcp = fdiv <3 x half> <half 0xH3C00, half 0xH3C00, half 0xH3C00>, %{{.*}} |
| 39 | +// NATIVE_HALF: ret <3 x half> %hlsl.rcp |
| 40 | +// DXIL_NO_HALF: define noundef <3 x float> @ |
| 41 | +// SPIR_NO_HALF: define spir_func noundef <3 x float> @ |
| 42 | +// NO_HALF: %hlsl.rcp = fdiv <3 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, %{{.*}} |
| 43 | +// NO_HALF: ret <3 x float> %hlsl.rcp |
29 | 44 | half3 test_rcp_half3(half3 p0) { return rcp(p0); }
|
30 |
| -// NATIVE_HALF: define noundef <4 x half> @ |
31 |
| -// NATIVE_HALF: %dx.rcp = call <4 x half> @llvm.dx.rcp.v4f16 |
32 |
| -// NATIVE_HALF: ret <4 x half> %dx.rcp |
33 |
| -// NO_HALF: define noundef <4 x float> @ |
34 |
| -// NO_HALF: %dx.rcp = call <4 x float> @llvm.dx.rcp.v4f32( |
35 |
| -// NO_HALF: ret <4 x float> %dx.rcp |
| 45 | + |
| 46 | +// DXIL_NATIVE_HALF: define noundef <4 x half> @ |
| 47 | +// SPIR_NATIVE_HALF: define spir_func noundef <4 x half> @ |
| 48 | +// NATIVE_HALF: %hlsl.rcp = fdiv <4 x half> <half 0xH3C00, half 0xH3C00, half 0xH3C00, half 0xH3C00>, %{{.*}} |
| 49 | +// NATIVE_HALF: ret <4 x half> %hlsl.rcp |
| 50 | +// DXIL_NO_HALF: define noundef <4 x float> @ |
| 51 | +// SPIR_NO_HALF: define spir_func noundef <4 x float> @ |
| 52 | +// NO_HALF: %hlsl.rcp = fdiv <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, %{{.*}} |
| 53 | +// NO_HALF: ret <4 x float> %hlsl.rcp |
36 | 54 | half4 test_rcp_half4(half4 p0) { return rcp(p0); }
|
37 | 55 |
|
38 |
| -// CHECK: define noundef float @ |
39 |
| -// CHECK: %dx.rcp = call float @llvm.dx.rcp.f32( |
40 |
| -// CHECK: ret float %dx.rcp |
| 56 | +// DXIL_CHECK: define noundef float @ |
| 57 | +// SPIR_CHECK: define spir_func noundef float @ |
| 58 | +// CHECK: %hlsl.rcp = fdiv float 1.000000e+00, %{{.*}} |
| 59 | +// CHECK: ret float %hlsl.rcp |
41 | 60 | float test_rcp_float(float p0) { return rcp(p0); }
|
42 |
| -// CHECK: define noundef <2 x float> @ |
43 |
| -// CHECK: %dx.rcp = call <2 x float> @llvm.dx.rcp.v2f32 |
44 |
| -// CHECK: ret <2 x float> %dx.rcp |
| 61 | + |
| 62 | +// DXIL_CHECK: define noundef <2 x float> @ |
| 63 | +// SPIR_CHECK: define spir_func noundef <2 x float> @ |
| 64 | +// CHECK: %hlsl.rcp = fdiv <2 x float> <float 1.000000e+00, float 1.000000e+00>, %{{.*}} |
| 65 | +// CHECK: ret <2 x float> %hlsl.rcp |
45 | 66 | float2 test_rcp_float2(float2 p0) { return rcp(p0); }
|
46 |
| -// CHECK: define noundef <3 x float> @ |
47 |
| -// CHECK: %dx.rcp = call <3 x float> @llvm.dx.rcp.v3f32 |
48 |
| -// CHECK: ret <3 x float> %dx.rcp |
| 67 | + |
| 68 | +// DXIL_CHECK: define noundef <3 x float> @ |
| 69 | +// SPIR_CHECK: define spir_func noundef <3 x float> @ |
| 70 | +// CHECK: %hlsl.rcp = fdiv <3 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, %{{.*}} |
| 71 | +// CHECK: ret <3 x float> %hlsl.rcp |
49 | 72 | float3 test_rcp_float3(float3 p0) { return rcp(p0); }
|
50 |
| -// CHECK: define noundef <4 x float> @ |
51 |
| -// CHECK: %dx.rcp = call <4 x float> @llvm.dx.rcp.v4f32 |
52 |
| -// CHECK: ret <4 x float> %dx.rcp |
| 73 | + |
| 74 | +// DXIL_CHECK: define noundef <4 x float> @ |
| 75 | +// SPIR_CHECK: define spir_func noundef <4 x float> @ |
| 76 | +// CHECK: %hlsl.rcp = fdiv <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, %{{.*}} |
| 77 | +// CHECK: ret <4 x float> %hlsl.rcp |
53 | 78 | float4 test_rcp_float4(float4 p0) { return rcp(p0); }
|
| 79 | + |
| 80 | +// DXIL_CHECK: define noundef double @ |
| 81 | +// SPIR_CHECK: define spir_func noundef double @ |
| 82 | +// CHECK: %hlsl.rcp = fdiv double 1.000000e+00, %{{.*}} |
| 83 | +// CHECK: ret double %hlsl.rcp |
| 84 | +double test_rcp_double(double p0) { return rcp(p0); } |
| 85 | + |
| 86 | +// DXIL_CHECK: define noundef <2 x double> @ |
| 87 | +// SPIR_CHECK: define spir_func noundef <2 x double> @ |
| 88 | +// CHECK: %hlsl.rcp = fdiv <2 x double> <double 1.000000e+00, double 1.000000e+00>, %{{.*}} |
| 89 | +// CHECK: ret <2 x double> %hlsl.rcp |
| 90 | +double2 test_rcp_double2(double2 p0) { return rcp(p0); } |
| 91 | + |
| 92 | +// DXIL_CHECK: define noundef <3 x double> @ |
| 93 | +// SPIR_CHECK: define spir_func noundef <3 x double> @ |
| 94 | +// CHECK: %hlsl.rcp = fdiv <3 x double> <double 1.000000e+00, double 1.000000e+00, double 1.000000e+00>, %{{.*}} |
| 95 | +// CHECK: ret <3 x double> %hlsl.rcp |
| 96 | +double3 test_rcp_double3(double3 p0) { return rcp(p0); } |
| 97 | + |
| 98 | +// DXIL_CHECK: define noundef <4 x double> @ |
| 99 | +// SPIR_CHECK: define spir_func noundef <4 x double> @ |
| 100 | +// CHECK: %hlsl.rcp = fdiv <4 x double> <double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00>, %{{.*}} |
| 101 | +// CHECK: ret <4 x double> %hlsl.rcp |
| 102 | +double4 test_rcp_double4(double4 p0) { return rcp(p0); } |
0 commit comments