|
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.rsqrt = call half @llvm.dx.rsqrt.f16( |
11 |
| -// NATIVE_HALF: ret half %dx.rsqrt |
12 |
| -// NO_HALF: define noundef float @"?test_rsqrt_half@@YA$halff@$halff@@Z"( |
13 |
| -// NO_HALF: %dx.rsqrt = call float @llvm.dx.rsqrt.f32( |
14 |
| -// NO_HALF: ret float %dx.rsqrt |
| 16 | +// DXIL_NATIVE_HALF: define noundef half @ |
| 17 | +// SPIR_NATIVE_HALF: define spir_func noundef half @ |
| 18 | +// DXIL_NATIVE_HALF: %hlsl.rsqrt = call half @llvm.dx.rsqrt.f16( |
| 19 | +// SPIR_NATIVE_HALF: %hlsl.rsqrt = call half @llvm.spv.rsqrt.f16( |
| 20 | +// NATIVE_HALF: ret half %hlsl.rsqrt |
| 21 | +// DXIL_NO_HALF: define noundef float @ |
| 22 | +// SPIR_NO_HALF: define spir_func noundef float @ |
| 23 | +// DXIL_NO_HALF: %hlsl.rsqrt = call float @llvm.dx.rsqrt.f32( |
| 24 | +// SPIR_NO_HALF: %hlsl.rsqrt = call float @llvm.spv.rsqrt.f32( |
| 25 | +// NO_HALF: ret float %hlsl.rsqrt |
15 | 26 | half test_rsqrt_half(half p0) { return rsqrt(p0); }
|
16 |
| -// NATIVE_HALF: define noundef <2 x half> @ |
17 |
| -// NATIVE_HALF: %dx.rsqrt = call <2 x half> @llvm.dx.rsqrt.v2f16 |
18 |
| -// NATIVE_HALF: ret <2 x half> %dx.rsqrt |
19 |
| -// NO_HALF: define noundef <2 x float> @ |
20 |
| -// NO_HALF: %dx.rsqrt = call <2 x float> @llvm.dx.rsqrt.v2f32( |
21 |
| -// NO_HALF: ret <2 x float> %dx.rsqrt |
| 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.rsqrt = call <2 x half> @llvm.dx.rsqrt.v2f16 |
| 30 | +// SPIR_NATIVE_HALF: %hlsl.rsqrt = call <2 x half> @llvm.spv.rsqrt.v2f16 |
| 31 | +// NATIVE_HALF: ret <2 x half> %hlsl.rsqrt |
| 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.rsqrt = call <2 x float> @llvm.dx.rsqrt.v2f32( |
| 35 | +// SPIR_NO_HALF: %hlsl.rsqrt = call <2 x float> @llvm.spv.rsqrt.v2f32( |
| 36 | +// NO_HALF: ret <2 x float> %hlsl.rsqrt |
22 | 37 | half2 test_rsqrt_half2(half2 p0) { return rsqrt(p0); }
|
23 |
| -// NATIVE_HALF: define noundef <3 x half> @ |
24 |
| -// NATIVE_HALF: %dx.rsqrt = call <3 x half> @llvm.dx.rsqrt.v3f16 |
25 |
| -// NATIVE_HALF: ret <3 x half> %dx.rsqrt |
26 |
| -// NO_HALF: define noundef <3 x float> @ |
27 |
| -// NO_HALF: %dx.rsqrt = call <3 x float> @llvm.dx.rsqrt.v3f32( |
28 |
| -// NO_HALF: ret <3 x float> %dx.rsqrt |
| 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.rsqrt = call <3 x half> @llvm.dx.rsqrt.v3f16 |
| 41 | +// SPIR_NATIVE_HALF: %hlsl.rsqrt = call <3 x half> @llvm.spv.rsqrt.v3f16 |
| 42 | +// NATIVE_HALF: ret <3 x half> %hlsl.rsqrt |
| 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.rsqrt = call <3 x float> @llvm.dx.rsqrt.v3f32( |
| 46 | +// SPIR_NO_HALF: %hlsl.rsqrt = call <3 x float> @llvm.spv.rsqrt.v3f32( |
| 47 | +// NO_HALF: ret <3 x float> %hlsl.rsqrt |
29 | 48 | half3 test_rsqrt_half3(half3 p0) { return rsqrt(p0); }
|
30 |
| -// NATIVE_HALF: define noundef <4 x half> @ |
31 |
| -// NATIVE_HALF: %dx.rsqrt = call <4 x half> @llvm.dx.rsqrt.v4f16 |
32 |
| -// NATIVE_HALF: ret <4 x half> %dx.rsqrt |
33 |
| -// NO_HALF: define noundef <4 x float> @ |
34 |
| -// NO_HALF: %dx.rsqrt = call <4 x float> @llvm.dx.rsqrt.v4f32( |
35 |
| -// NO_HALF: ret <4 x float> %dx.rsqrt |
| 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.rsqrt = call <4 x half> @llvm.dx.rsqrt.v4f16 |
| 52 | +// SPIR_NATIVE_HALF: %hlsl.rsqrt = call <4 x half> @llvm.spv.rsqrt.v4f16 |
| 53 | +// NATIVE_HALF: ret <4 x half> %hlsl.rsqrt |
| 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.rsqrt = call <4 x float> @llvm.dx.rsqrt.v4f32( |
| 57 | +// SPIR_NO_HALF: %hlsl.rsqrt = call <4 x float> @llvm.spv.rsqrt.v4f32( |
| 58 | +// NO_HALF: ret <4 x float> %hlsl.rsqrt |
36 | 59 | half4 test_rsqrt_half4(half4 p0) { return rsqrt(p0); }
|
37 | 60 |
|
38 |
| -// CHECK: define noundef float @ |
39 |
| -// CHECK: %dx.rsqrt = call float @llvm.dx.rsqrt.f32( |
40 |
| -// CHECK: ret float %dx.rsqrt |
| 61 | +// DXIL_CHECK: define noundef float @ |
| 62 | +// SPIR_CHECK: define spir_func noundef float @ |
| 63 | +// DXIL_CHECK: %hlsl.rsqrt = call float @llvm.dx.rsqrt.f32( |
| 64 | +// SPIR_CHECK: %hlsl.rsqrt = call float @llvm.spv.rsqrt.f32( |
| 65 | +// CHECK: ret float %hlsl.rsqrt |
41 | 66 | float test_rsqrt_float(float p0) { return rsqrt(p0); }
|
42 |
| -// CHECK: define noundef <2 x float> @ |
43 |
| -// CHECK: %dx.rsqrt = call <2 x float> @llvm.dx.rsqrt.v2f32 |
44 |
| -// CHECK: ret <2 x float> %dx.rsqrt |
| 67 | +// DXIL_CHECK: define noundef <2 x float> @ |
| 68 | +// SPIR_CHECK: define spir_func noundef <2 x float> @ |
| 69 | +// DXIL_CHECK: %hlsl.rsqrt = call <2 x float> @llvm.dx.rsqrt.v2f32 |
| 70 | +// SPIR_CHECK: %hlsl.rsqrt = call <2 x float> @llvm.spv.rsqrt.v2f32 |
| 71 | +// CHECK: ret <2 x float> %hlsl.rsqrt |
45 | 72 | float2 test_rsqrt_float2(float2 p0) { return rsqrt(p0); }
|
46 |
| -// CHECK: define noundef <3 x float> @ |
47 |
| -// CHECK: %dx.rsqrt = call <3 x float> @llvm.dx.rsqrt.v3f32 |
48 |
| -// CHECK: ret <3 x float> %dx.rsqrt |
| 73 | +// DXIL_CHECK: define noundef <3 x float> @ |
| 74 | +// SPIR_CHECK: define spir_func noundef <3 x float> @ |
| 75 | +// DXIL_CHECK: %hlsl.rsqrt = call <3 x float> @llvm.dx.rsqrt.v3f32 |
| 76 | +// SPIR_CHECK: %hlsl.rsqrt = call <3 x float> @llvm.spv.rsqrt.v3f32 |
| 77 | +// CHECK: ret <3 x float> %hlsl.rsqrt |
49 | 78 | float3 test_rsqrt_float3(float3 p0) { return rsqrt(p0); }
|
50 |
| -// CHECK: define noundef <4 x float> @ |
51 |
| -// CHECK: %dx.rsqrt = call <4 x float> @llvm.dx.rsqrt.v4f32 |
52 |
| -// CHECK: ret <4 x float> %dx.rsqrt |
| 79 | +// DXIL_CHECK: define noundef <4 x float> @ |
| 80 | +// SPIR_CHECK: define spir_func noundef <4 x float> @ |
| 81 | +// DXIL_CHECK: %hlsl.rsqrt = call <4 x float> @llvm.dx.rsqrt.v4f32 |
| 82 | +// SPIR_CHECK: %hlsl.rsqrt = call <4 x float> @llvm.spv.rsqrt.v4f32 |
| 83 | +// CHECK: ret <4 x float> %hlsl.rsqrt |
53 | 84 | float4 test_rsqrt_float4(float4 p0) { return rsqrt(p0); }
|
0 commit comments