|
1 |
| -// RUN: %clang_cc1 -finclude-default-header -triple \ |
2 |
| -// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \ |
3 |
| -// RUN: -emit-llvm -O1 -o - | FileCheck %s --check-prefixes=CHECK,DXCHECK \ |
4 |
| -// RUN: -DTARGET=dx |
| 1 | +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5 |
| 2 | +// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \ |
| 3 | +// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \ |
| 4 | +// RUN: -emit-llvm -O1 -o - | FileCheck %s |
5 | 5 |
|
6 | 6 | // RUN: %clang_cc1 -finclude-default-header -triple \
|
7 | 7 | // RUN: spirv-unknown-vulkan-compute %s -fnative-half-type \
|
8 |
| -// RUN: -emit-llvm -O1 -o - | FileCheck %s --check-prefixes=CHECK,SPVCHECK \ |
9 |
| -// RUN: -DTARGET=spv |
| 8 | +// RUN: -emit-llvm -O1 -o - | FileCheck %s --check-prefix=SPVCHECK |
10 | 9 |
|
11 | 10 |
|
12 |
| -// SPVCHECK-LABEL: define spir_func noundef nofpclass(nan inf) half @_Z16test_length_halfDh( |
13 | 11 | // DXCHECK-LABEL: define noundef nofpclass(nan inf) half @_Z16test_length_halfDh(
|
| 12 | +// |
| 13 | + |
| 14 | +// CHECK-LABEL: define noundef nofpclass(nan inf) half @_Z16test_length_halfDh( |
14 | 15 | // CHECK-SAME: half noundef nofpclass(nan inf) [[P0:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] {
|
15 | 16 | // CHECK-NEXT: [[ENTRY:.*:]]
|
16 | 17 | // CHECK-NEXT: [[ELT_ABS_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn noundef half @llvm.fabs.f16(half [[P0]])
|
17 | 18 | // CHECK-NEXT: ret half [[ELT_ABS_I]]
|
18 | 19 | //
|
19 |
| - |
| 20 | +// SPVCHECK-LABEL: define spir_func noundef nofpclass(nan inf) half @_Z16test_length_halfDh( |
| 21 | +// SPVCHECK-SAME: half noundef nofpclass(nan inf) [[P0:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] { |
| 22 | +// SPVCHECK-NEXT: [[ENTRY:.*:]] |
| 23 | +// SPVCHECK-NEXT: [[ELT_ABS_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn noundef half @llvm.fabs.f16(half [[P0]]) |
| 24 | +// SPVCHECK-NEXT: ret half [[ELT_ABS_I]] |
| 25 | +// |
20 | 26 | half test_length_half(half p0)
|
21 | 27 | {
|
22 | 28 | return length(p0);
|
23 | 29 | }
|
24 | 30 |
|
25 |
| -// SPVCHECK-LABEL: define spir_func noundef nofpclass(nan inf) half @_Z17test_length_half2Dv2_Dh( |
26 | 31 | // DXCHECK-LABEL: define noundef nofpclass(nan inf) half @_Z17test_length_half2Dv2_Dh(
|
| 32 | +// |
| 33 | + |
| 34 | + |
| 35 | +// CHECK-LABEL: define noundef nofpclass(nan inf) half @_Z17test_length_half2Dv2_Dh( |
27 | 36 | // CHECK-SAME: <2 x half> noundef nofpclass(nan inf) [[P0:%.*]]) local_unnamed_addr #[[ATTR0]] {
|
28 | 37 | // CHECK-NEXT: [[ENTRY:.*:]]
|
29 |
| -// CHECK-NEXT: [[HLSL_DOT_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn half @llvm.[[TARGET]].fdot.v2f16(<2 x half> [[P0]], <2 x half> [[P0]]) |
| 38 | +// CHECK-NEXT: [[HLSL_DOT_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn half @llvm.dx.fdot.v2f16(<2 x half> [[P0]], <2 x half> [[P0]]) |
30 | 39 | // CHECK-NEXT: [[TMP0:%.*]] = tail call reassoc nnan ninf nsz arcp afn noundef half @llvm.sqrt.f16(half [[HLSL_DOT_I]])
|
31 | 40 | // CHECK-NEXT: ret half [[TMP0]]
|
32 | 41 | //
|
33 |
| - |
34 |
| - |
| 42 | +// SPVCHECK-LABEL: define spir_func noundef nofpclass(nan inf) half @_Z17test_length_half2Dv2_Dh( |
| 43 | +// SPVCHECK-SAME: <2 x half> noundef nofpclass(nan inf) [[P0:%.*]]) local_unnamed_addr #[[ATTR0]] { |
| 44 | +// SPVCHECK-NEXT: [[ENTRY:.*:]] |
| 45 | +// SPVCHECK-NEXT: [[SPV_LENGTH_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn noundef half @llvm.spv.length.v2f16(<2 x half> [[P0]]) |
| 46 | +// SPVCHECK-NEXT: ret half [[SPV_LENGTH_I]] |
| 47 | +// |
35 | 48 | half test_length_half2(half2 p0)
|
36 | 49 | {
|
37 | 50 | return length(p0);
|
38 | 51 | }
|
39 | 52 |
|
40 |
| -// SPVCHECK-LABEL: define spir_func noundef nofpclass(nan inf) half @_Z17test_length_half3Dv3_Dh( |
41 | 53 | // DXCHECK-LABEL: define noundef nofpclass(nan inf) half @_Z17test_length_half3Dv3_Dh(
|
| 54 | +// CHECK-LABEL: define noundef nofpclass(nan inf) half @_Z17test_length_half3Dv3_Dh( |
42 | 55 | // CHECK-SAME: <3 x half> noundef nofpclass(nan inf) [[P0:%.*]]) local_unnamed_addr #[[ATTR0]] {
|
43 | 56 | // CHECK-NEXT: [[ENTRY:.*:]]
|
44 |
| -// CHECK-NEXT: [[HLSL_DOT_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn half @llvm.[[TARGET]].fdot.v3f16(<3 x half> [[P0]], <3 x half> [[P0]]) |
| 57 | +// CHECK-NEXT: [[HLSL_DOT_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn half @llvm.dx.fdot.v3f16(<3 x half> [[P0]], <3 x half> [[P0]]) |
45 | 58 | // CHECK-NEXT: [[TMP0:%.*]] = tail call reassoc nnan ninf nsz arcp afn noundef half @llvm.sqrt.f16(half [[HLSL_DOT_I]])
|
46 | 59 | // CHECK-NEXT: ret half [[TMP0]]
|
47 | 60 | //
|
| 61 | +// SPVCHECK-LABEL: define spir_func noundef nofpclass(nan inf) half @_Z17test_length_half3Dv3_Dh( |
| 62 | +// SPVCHECK-SAME: <3 x half> noundef nofpclass(nan inf) [[P0:%.*]]) local_unnamed_addr #[[ATTR0]] { |
| 63 | +// SPVCHECK-NEXT: [[ENTRY:.*:]] |
| 64 | +// SPVCHECK-NEXT: [[SPV_LENGTH_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn noundef half @llvm.spv.length.v3f16(<3 x half> [[P0]]) |
| 65 | +// SPVCHECK-NEXT: ret half [[SPV_LENGTH_I]] |
| 66 | +// |
48 | 67 | half test_length_half3(half3 p0)
|
49 | 68 | {
|
50 | 69 | return length(p0);
|
51 | 70 | }
|
52 | 71 |
|
53 |
| -// SPVCHECK-LABEL: define spir_func noundef nofpclass(nan inf) half @_Z17test_length_half4Dv4_Dh( |
54 | 72 | // DXCHECK-LABEL: define noundef nofpclass(nan inf) half @_Z17test_length_half4Dv4_Dh(
|
| 73 | +// CHECK-LABEL: define noundef nofpclass(nan inf) half @_Z17test_length_half4Dv4_Dh( |
55 | 74 | // CHECK-SAME: <4 x half> noundef nofpclass(nan inf) [[P0:%.*]]) local_unnamed_addr #[[ATTR0]] {
|
56 | 75 | // CHECK-NEXT: [[ENTRY:.*:]]
|
57 |
| -// CHECK-NEXT: [[HLSL_DOT_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn half @llvm.[[TARGET]].fdot.v4f16(<4 x half> [[P0]], <4 x half> [[P0]]) |
| 76 | +// CHECK-NEXT: [[HLSL_DOT_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn half @llvm.dx.fdot.v4f16(<4 x half> [[P0]], <4 x half> [[P0]]) |
58 | 77 | // CHECK-NEXT: [[TMP0:%.*]] = tail call reassoc nnan ninf nsz arcp afn noundef half @llvm.sqrt.f16(half [[HLSL_DOT_I]])
|
59 | 78 | // CHECK-NEXT: ret half [[TMP0]]
|
60 | 79 | //
|
| 80 | +// SPVCHECK-LABEL: define spir_func noundef nofpclass(nan inf) half @_Z17test_length_half4Dv4_Dh( |
| 81 | +// SPVCHECK-SAME: <4 x half> noundef nofpclass(nan inf) [[P0:%.*]]) local_unnamed_addr #[[ATTR0]] { |
| 82 | +// SPVCHECK-NEXT: [[ENTRY:.*:]] |
| 83 | +// SPVCHECK-NEXT: [[SPV_LENGTH_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn noundef half @llvm.spv.length.v4f16(<4 x half> [[P0]]) |
| 84 | +// SPVCHECK-NEXT: ret half [[SPV_LENGTH_I]] |
| 85 | +// |
61 | 86 | half test_length_half4(half4 p0)
|
62 | 87 | {
|
63 | 88 | return length(p0);
|
64 | 89 | }
|
65 | 90 |
|
66 |
| -// SPVCHECK-LABEL: define spir_func noundef nofpclass(nan inf) float @_Z17test_length_floatf( |
67 | 91 | // DXCHECK-LABEL: define noundef nofpclass(nan inf) float @_Z17test_length_floatf(
|
| 92 | +// CHECK-LABEL: define noundef nofpclass(nan inf) float @_Z17test_length_floatf( |
68 | 93 | // CHECK-SAME: float noundef nofpclass(nan inf) [[P0:%.*]]) local_unnamed_addr #[[ATTR0]] {
|
69 | 94 | // CHECK-NEXT: [[ENTRY:.*:]]
|
70 | 95 | // CHECK-NEXT: [[ELT_ABS_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn noundef float @llvm.fabs.f32(float [[P0]])
|
71 | 96 | // CHECK-NEXT: ret float [[ELT_ABS_I]]
|
72 | 97 | //
|
| 98 | +// SPVCHECK-LABEL: define spir_func noundef nofpclass(nan inf) float @_Z17test_length_floatf( |
| 99 | +// SPVCHECK-SAME: float noundef nofpclass(nan inf) [[P0:%.*]]) local_unnamed_addr #[[ATTR0]] { |
| 100 | +// SPVCHECK-NEXT: [[ENTRY:.*:]] |
| 101 | +// SPVCHECK-NEXT: [[ELT_ABS_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn noundef float @llvm.fabs.f32(float [[P0]]) |
| 102 | +// SPVCHECK-NEXT: ret float [[ELT_ABS_I]] |
| 103 | +// |
73 | 104 | float test_length_float(float p0)
|
74 | 105 | {
|
75 | 106 | return length(p0);
|
76 | 107 | }
|
77 | 108 |
|
78 |
| -// SPVCHECK-LABEL: define spir_func noundef nofpclass(nan inf) float @_Z18test_length_float2Dv2_f( |
79 | 109 | // DXCHECK-LABEL: define noundef nofpclass(nan inf) float @_Z18test_length_float2Dv2_f(
|
| 110 | +// CHECK-LABEL: define noundef nofpclass(nan inf) float @_Z18test_length_float2Dv2_f( |
80 | 111 | // CHECK-SAME: <2 x float> noundef nofpclass(nan inf) [[P0:%.*]]) local_unnamed_addr #[[ATTR0]] {
|
81 | 112 | // CHECK-NEXT: [[ENTRY:.*:]]
|
82 |
| -// CHECK-NEXT: [[HLSL_DOT_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].fdot.v2f32(<2 x float> [[P0]], <2 x float> [[P0]]) |
| 113 | +// CHECK-NEXT: [[HLSL_DOT_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn float @llvm.dx.fdot.v2f32(<2 x float> [[P0]], <2 x float> [[P0]]) |
83 | 114 | // CHECK-NEXT: [[TMP0:%.*]] = tail call reassoc nnan ninf nsz arcp afn noundef float @llvm.sqrt.f32(float [[HLSL_DOT_I]])
|
84 | 115 | // CHECK-NEXT: ret float [[TMP0]]
|
85 | 116 | //
|
| 117 | +// SPVCHECK-LABEL: define spir_func noundef nofpclass(nan inf) float @_Z18test_length_float2Dv2_f( |
| 118 | +// SPVCHECK-SAME: <2 x float> noundef nofpclass(nan inf) [[P0:%.*]]) local_unnamed_addr #[[ATTR0]] { |
| 119 | +// SPVCHECK-NEXT: [[ENTRY:.*:]] |
| 120 | +// SPVCHECK-NEXT: [[SPV_LENGTH_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn noundef float @llvm.spv.length.v2f32(<2 x float> [[P0]]) |
| 121 | +// SPVCHECK-NEXT: ret float [[SPV_LENGTH_I]] |
| 122 | +// |
86 | 123 | float test_length_float2(float2 p0)
|
87 | 124 | {
|
88 | 125 | return length(p0);
|
89 | 126 | }
|
90 | 127 |
|
91 |
| -// SPVCHECK-LABEL: define spir_func noundef nofpclass(nan inf) float @_Z18test_length_float3Dv3_f( |
92 | 128 | // DXCHECK-LABEL: define noundef nofpclass(nan inf) float @_Z18test_length_float3Dv3_f(
|
| 129 | +// CHECK-LABEL: define noundef nofpclass(nan inf) float @_Z18test_length_float3Dv3_f( |
93 | 130 | // CHECK-SAME: <3 x float> noundef nofpclass(nan inf) [[P0:%.*]]) local_unnamed_addr #[[ATTR0]] {
|
94 | 131 | // CHECK-NEXT: [[ENTRY:.*:]]
|
95 |
| -// CHECK-NEXT: [[HLSL_DOT_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].fdot.v3f32(<3 x float> [[P0]], <3 x float> [[P0]]) |
| 132 | +// CHECK-NEXT: [[HLSL_DOT_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn float @llvm.dx.fdot.v3f32(<3 x float> [[P0]], <3 x float> [[P0]]) |
96 | 133 | // CHECK-NEXT: [[TMP0:%.*]] = tail call reassoc nnan ninf nsz arcp afn noundef float @llvm.sqrt.f32(float [[HLSL_DOT_I]])
|
97 | 134 | // CHECK-NEXT: ret float [[TMP0]]
|
98 | 135 | //
|
| 136 | +// SPVCHECK-LABEL: define spir_func noundef nofpclass(nan inf) float @_Z18test_length_float3Dv3_f( |
| 137 | +// SPVCHECK-SAME: <3 x float> noundef nofpclass(nan inf) [[P0:%.*]]) local_unnamed_addr #[[ATTR0]] { |
| 138 | +// SPVCHECK-NEXT: [[ENTRY:.*:]] |
| 139 | +// SPVCHECK-NEXT: [[SPV_LENGTH_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn noundef float @llvm.spv.length.v3f32(<3 x float> [[P0]]) |
| 140 | +// SPVCHECK-NEXT: ret float [[SPV_LENGTH_I]] |
| 141 | +// |
99 | 142 | float test_length_float3(float3 p0)
|
100 | 143 | {
|
101 | 144 | return length(p0);
|
102 | 145 | }
|
103 | 146 |
|
104 |
| -// SPVCHECK-LABEL: define spir_func noundef nofpclass(nan inf) float @_Z18test_length_float4Dv4_f( |
105 | 147 | // DXCHECK-LABEL: define noundef nofpclass(nan inf) float @_Z18test_length_float4Dv4_f(
|
| 148 | +// CHECK-LABEL: define noundef nofpclass(nan inf) float @_Z18test_length_float4Dv4_f( |
106 | 149 | // CHECK-SAME: <4 x float> noundef nofpclass(nan inf) [[P0:%.*]]) local_unnamed_addr #[[ATTR0]] {
|
107 | 150 | // CHECK-NEXT: [[ENTRY:.*:]]
|
108 |
| -// CHECK-NEXT: [[HLSL_DOT_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].fdot.v4f32(<4 x float> [[P0]], <4 x float> [[P0]]) |
| 151 | +// CHECK-NEXT: [[HLSL_DOT_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn float @llvm.dx.fdot.v4f32(<4 x float> [[P0]], <4 x float> [[P0]]) |
109 | 152 | // CHECK-NEXT: [[TMP0:%.*]] = tail call reassoc nnan ninf nsz arcp afn noundef float @llvm.sqrt.f32(float [[HLSL_DOT_I]])
|
110 | 153 | // CHECK-NEXT: ret float [[TMP0]]
|
111 | 154 | //
|
| 155 | +// SPVCHECK-LABEL: define spir_func noundef nofpclass(nan inf) float @_Z18test_length_float4Dv4_f( |
| 156 | +// SPVCHECK-SAME: <4 x float> noundef nofpclass(nan inf) [[P0:%.*]]) local_unnamed_addr #[[ATTR0]] { |
| 157 | +// SPVCHECK-NEXT: [[ENTRY:.*:]] |
| 158 | +// SPVCHECK-NEXT: [[SPV_LENGTH_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn noundef float @llvm.spv.length.v4f32(<4 x float> [[P0]]) |
| 159 | +// SPVCHECK-NEXT: ret float [[SPV_LENGTH_I]] |
| 160 | +// |
112 | 161 | float test_length_float4(float4 p0)
|
113 | 162 | {
|
114 | 163 | return length(p0);
|
|
0 commit comments