1 ; RUN: opt -S -dxil-intrinsic-expansion -scalarizer -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s
3 ; Make sure dxil operation function calls for clamp/uclamp are generated for half/float/double/i16/i32/i64.
5 ; CHECK-LABEL:test_clamp_i16
6 define noundef i16 @test_clamp_i16(i16 noundef %a, i16 noundef %b, i16 noundef %c) {
8 ; CHECK: call i16 @dx.op.binary.i16(i32 37, i16 %{{.*}}, i16 %{{.*}})
9 ; CHECK: call i16 @dx.op.binary.i16(i32 38, i16 %{{.*}}, i16 %{{.*}})
10 %0 = call i16 @llvm.dx.sclamp.i16(i16 %a, i16 %b, i16 %c)
14 ; CHECK-LABEL:test_clamp_i32
15 define noundef i32 @test_clamp_i32(i32 noundef %a, i32 noundef %b, i32 noundef %c) {
17 ; CHECK: call i32 @dx.op.binary.i32(i32 37, i32 %{{.*}}, i32 %{{.*}})
18 ; CHECK: call i32 @dx.op.binary.i32(i32 38, i32 %{{.*}}, i32 %{{.*}})
19 %0 = call i32 @llvm.dx.sclamp.i32(i32 %a, i32 %b, i32 %c)
23 ; CHECK-LABEL:test_clamp_i64
24 define noundef i64 @test_clamp_i64(i64 noundef %a, i64 noundef %b, i64 noundef %c) {
26 ; CHECK: call i64 @dx.op.binary.i64(i32 37, i64 %a, i64 %b)
27 ; CHECK: call i64 @dx.op.binary.i64(i32 38, i64 %{{.*}}, i64 %c)
28 %0 = call i64 @llvm.dx.sclamp.i64(i64 %a, i64 %b, i64 %c)
32 ; CHECK-LABEL:test_clamp_half
33 define noundef half @test_clamp_half(half noundef %a, half noundef %b, half noundef %c) {
35 ; CHECK: call half @dx.op.binary.f16(i32 35, half %{{.*}}, half %{{.*}})
36 ; CHECK: call half @dx.op.binary.f16(i32 36, half %{{.*}}, half %{{.*}})
37 %0 = call half @llvm.dx.nclamp.f16(half %a, half %b, half %c)
41 ; CHECK-LABEL:test_clamp_float
42 define noundef float @test_clamp_float(float noundef %a, float noundef %b, float noundef %c) {
44 ; CHECK: call float @dx.op.binary.f32(i32 35, float %{{.*}}, float %{{.*}})
45 ; CHECK: call float @dx.op.binary.f32(i32 36, float %{{.*}}, float %{{.*}})
46 %0 = call float @llvm.dx.nclamp.f32(float %a, float %b, float %c)
50 ; CHECK-LABEL:test_clamp_double
51 define noundef double @test_clamp_double(double noundef %a, double noundef %b, double noundef %c) {
53 ; CHECK: call double @dx.op.binary.f64(i32 35, double %{{.*}}, double %{{.*}})
54 ; CHECK: call double @dx.op.binary.f64(i32 36, double %{{.*}}, double %{{.*}})
55 %0 = call double @llvm.dx.nclamp.f64(double %a, double %b, double %c)
59 ; CHECK-LABEL:test_uclamp_i16
60 define noundef i16 @test_uclamp_i16(i16 noundef %a, i16 noundef %b, i16 noundef %c) {
62 ; CHECK: call i16 @dx.op.binary.i16(i32 39, i16 %{{.*}}, i16 %{{.*}})
63 ; CHECK: call i16 @dx.op.binary.i16(i32 40, i16 %{{.*}}, i16 %{{.*}})
64 %0 = call i16 @llvm.dx.uclamp.i16(i16 %a, i16 %b, i16 %c)
68 ; CHECK-LABEL:test_uclamp_i32
69 define noundef i32 @test_uclamp_i32(i32 noundef %a, i32 noundef %b, i32 noundef %c) {
71 ; CHECK: call i32 @dx.op.binary.i32(i32 39, i32 %{{.*}}, i32 %{{.*}})
72 ; CHECK: call i32 @dx.op.binary.i32(i32 40, i32 %{{.*}}, i32 %{{.*}})
73 %0 = call i32 @llvm.dx.uclamp.i32(i32 %a, i32 %b, i32 %c)
77 ; CHECK-LABEL:test_uclamp_i64
78 define noundef i64 @test_uclamp_i64(i64 noundef %a, i64 noundef %b, i64 noundef %c) {
80 ; CHECK: call i64 @dx.op.binary.i64(i32 39, i64 %a, i64 %b)
81 ; CHECK: call i64 @dx.op.binary.i64(i32 40, i64 %{{.*}}, i64 %c)
82 %0 = call i64 @llvm.dx.uclamp.i64(i64 %a, i64 %b, i64 %c)
86 declare half @llvm.dx.nclamp.f16(half, half, half)
87 declare float @llvm.dx.nclamp.f32(float, float, float)
88 declare double @llvm.dx.nclamp.f64(double, double, double)
89 declare i16 @llvm.dx.sclamp.i16(i16, i16, i16)
90 declare i32 @llvm.dx.sclamp.i32(i32, i32, i32)
91 declare i64 @llvm.dx.sclamp.i64(i64, i64, i64)
92 declare i16 @llvm.dx.uclamp.i16(i16, i16, i16)
93 declare i32 @llvm.dx.uclamp.i32(i32, i32, i32)
94 declare i64 @llvm.dx.uclamp.i64(i64, i64, i64)
96 ; CHECK-LABEL: clamp_half3
97 define noundef <3 x half> @clamp_half3(<3 x half> noundef %a, <3 x half> noundef %b, <3 x half> noundef %c) {
99 ; CHECK-DAG: %[[a0:.+]] = extractelement <3 x half> %a, i64 0
100 ; CHECK-DAG: %[[a1:.+]] = extractelement <3 x half> %a, i64 1
101 ; CHECK-DAG: %[[a2:.+]] = extractelement <3 x half> %a, i64 2
102 ; CHECK-DAG: %[[b0:.+]] = extractelement <3 x half> %b, i64 0
103 ; CHECK-DAG: %[[b1:.+]] = extractelement <3 x half> %b, i64 1
104 ; CHECK-DAG: %[[b2:.+]] = extractelement <3 x half> %b, i64 2
105 ; CHECK-DAG: %[[c0:.+]] = extractelement <3 x half> %c, i64 0
106 ; CHECK-DAG: %[[c1:.+]] = extractelement <3 x half> %c, i64 1
107 ; CHECK-DAG: %[[c2:.+]] = extractelement <3 x half> %c, i64 2
108 ; CHECK-DAG: %[[max0:.+]] = call half @dx.op.binary.f16(i32 35, half %[[a0]], half %[[b0]])
109 ; CHECK-DAG: %[[max1:.+]] = call half @dx.op.binary.f16(i32 35, half %[[a1]], half %[[b1]])
110 ; CHECK-DAG: %[[max2:.+]] = call half @dx.op.binary.f16(i32 35, half %[[a2]], half %[[b2]])
111 ; CHECK-DAG: %[[min0:.+]] = call half @dx.op.binary.f16(i32 36, half %[[max0]], half %[[c0]])
112 ; CHECK-DAG: %[[min1:.+]] = call half @dx.op.binary.f16(i32 36, half %[[max1]], half %[[c1]])
113 ; CHECK-DAG: %[[min2:.+]] = call half @dx.op.binary.f16(i32 36, half %[[max2]], half %[[c2]])
114 ; CHECK-DAG: %[[ret0:.+]] = insertelement <3 x half> poison, half %[[min0]], i64 0
115 ; CHECK-DAG: %[[ret1:.+]] = insertelement <3 x half> %[[ret0]], half %[[min1]], i64 1
116 ; CHECK-DAG: %[[ret2:.+]] = insertelement <3 x half> %[[ret1]], half %[[min2]], i64 2
117 ; CHECK: ret <3 x half> %[[ret2]]
118 %dx.clamp = call <3 x half> @llvm.dx.nclamp.v3f16(<3 x half> %a, <3 x half> %b, <3 x half> %c)
119 ret <3 x half> %dx.clamp
122 ; CHECK-LABEL: clamp_float4
123 define noundef <4 x float> @clamp_float4(<4 x float> noundef %a, <4 x float> noundef %b, <4 x float> noundef %c) {
125 ; CHECK-DAG: %[[a0:.+]] = extractelement <4 x float> %a, i64 0
126 ; CHECK-DAG: %[[a1:.+]] = extractelement <4 x float> %a, i64 1
127 ; CHECK-DAG: %[[a2:.+]] = extractelement <4 x float> %a, i64 2
128 ; CHECK-DAG: %[[a3:.+]] = extractelement <4 x float> %a, i64 3
129 ; CHECK-DAG: %[[b0:.+]] = extractelement <4 x float> %b, i64 0
130 ; CHECK-DAG: %[[b1:.+]] = extractelement <4 x float> %b, i64 1
131 ; CHECK-DAG: %[[b2:.+]] = extractelement <4 x float> %b, i64 2
132 ; CHECK-DAG: %[[b3:.+]] = extractelement <4 x float> %b, i64 3
133 ; CHECK-DAG: %[[c0:.+]] = extractelement <4 x float> %c, i64 0
134 ; CHECK-DAG: %[[c1:.+]] = extractelement <4 x float> %c, i64 1
135 ; CHECK-DAG: %[[c2:.+]] = extractelement <4 x float> %c, i64 2
136 ; CHECK-DAG: %[[c3:.+]] = extractelement <4 x float> %c, i64 3
137 ; CHECK-DAG: %[[max0:.+]] = call float @dx.op.binary.f32(i32 35, float %[[a0]], float %[[b0]])
138 ; CHECK-DAG: %[[max1:.+]] = call float @dx.op.binary.f32(i32 35, float %[[a1]], float %[[b1]])
139 ; CHECK-DAG: %[[max2:.+]] = call float @dx.op.binary.f32(i32 35, float %[[a2]], float %[[b2]])
140 ; CHECK-DAG: %[[max3:.+]] = call float @dx.op.binary.f32(i32 35, float %[[a3]], float %[[b3]])
141 ; CHECK-DAG: %[[min0:.+]] = call float @dx.op.binary.f32(i32 36, float %[[max0]], float %[[c0]])
142 ; CHECK-DAG: %[[min1:.+]] = call float @dx.op.binary.f32(i32 36, float %[[max1]], float %[[c1]])
143 ; CHECK-DAG: %[[min2:.+]] = call float @dx.op.binary.f32(i32 36, float %[[max2]], float %[[c2]])
144 ; CHECK-DAG: %[[min3:.+]] = call float @dx.op.binary.f32(i32 36, float %[[max3]], float %[[c3]])
145 ; CHECK-DAG: %[[ret0:.+]] = insertelement <4 x float> poison, float %[[min0]], i64 0
146 ; CHECK-DAG: %[[ret1:.+]] = insertelement <4 x float> %[[ret0]], float %[[min1]], i64 1
147 ; CHECK-DAG: %[[ret2:.+]] = insertelement <4 x float> %[[ret1]], float %[[min2]], i64 2
148 ; CHECK-DAG: %[[ret3:.+]] = insertelement <4 x float> %[[ret2]], float %[[min3]], i64 3
149 ; CHECK: ret <4 x float> %[[ret3]]
150 %dx.clamp = call <4 x float> @llvm.dx.nclamp.v4f32(<4 x float> %a, <4 x float> %b, <4 x float> %c)
151 ret <4 x float> %dx.clamp
154 ; CHECK-LABEL: clamp_double2
155 define noundef <2 x double> @clamp_double2(<2 x double> noundef %a, <2 x double> noundef %b, <2 x double> noundef %c) {
157 ; CHECK-DAG: %[[a0:.+]] = extractelement <2 x double> %a, i64 0
158 ; CHECK-DAG: %[[a1:.+]] = extractelement <2 x double> %a, i64 1
159 ; CHECK-DAG: %[[b0:.+]] = extractelement <2 x double> %b, i64 0
160 ; CHECK-DAG: %[[b1:.+]] = extractelement <2 x double> %b, i64 1
161 ; CHECK-DAG: %[[c0:.+]] = extractelement <2 x double> %c, i64 0
162 ; CHECK-DAG: %[[c1:.+]] = extractelement <2 x double> %c, i64 1
163 ; CHECK-DAG: %[[max0:.+]] = call double @dx.op.binary.f64(i32 35, double %[[a0]], double %[[b0]])
164 ; CHECK-DAG: %[[max1:.+]] = call double @dx.op.binary.f64(i32 35, double %[[a1]], double %[[b1]])
165 ; CHECK-DAG: %[[min0:.+]] = call double @dx.op.binary.f64(i32 36, double %[[max0]], double %[[c0]])
166 ; CHECK-DAG: %[[min1:.+]] = call double @dx.op.binary.f64(i32 36, double %[[max1]], double %[[c1]])
167 ; CHECK-DAG: %[[ret0:.+]] = insertelement <2 x double> poison, double %[[min0]], i64 0
168 ; CHECK-DAG: %[[ret1:.+]] = insertelement <2 x double> %[[ret0]], double %[[min1]], i64 1
169 ; CHECK: ret <2 x double> %[[ret1]]
170 %dx.clamp = call <2 x double> @llvm.dx.nclamp.v2f64(<2 x double> %a, <2 x double> %b, <2 x double> %c)
171 ret <2 x double> %dx.clamp
174 ; CHECK-LABEL: clamp_int4
175 define noundef <4 x i32> @clamp_int4(<4 x i32> noundef %a, <4 x i32> noundef %b, <4 x i32> noundef %c) {
177 ; CHECK-DAG: %[[a0:.+]] = extractelement <4 x i32> %a, i64 0
178 ; CHECK-DAG: %[[a1:.+]] = extractelement <4 x i32> %a, i64 1
179 ; CHECK-DAG: %[[a2:.+]] = extractelement <4 x i32> %a, i64 2
180 ; CHECK-DAG: %[[a3:.+]] = extractelement <4 x i32> %a, i64 3
181 ; CHECK-DAG: %[[b0:.+]] = extractelement <4 x i32> %b, i64 0
182 ; CHECK-DAG: %[[b1:.+]] = extractelement <4 x i32> %b, i64 1
183 ; CHECK-DAG: %[[b2:.+]] = extractelement <4 x i32> %b, i64 2
184 ; CHECK-DAG: %[[b3:.+]] = extractelement <4 x i32> %b, i64 3
185 ; CHECK-DAG: %[[c0:.+]] = extractelement <4 x i32> %c, i64 0
186 ; CHECK-DAG: %[[c1:.+]] = extractelement <4 x i32> %c, i64 1
187 ; CHECK-DAG: %[[c2:.+]] = extractelement <4 x i32> %c, i64 2
188 ; CHECK-DAG: %[[c3:.+]] = extractelement <4 x i32> %c, i64 3
189 ; CHECK-DAG: %[[max0:.+]] = call i32 @dx.op.binary.i32(i32 37, i32 %[[a0]], i32 %[[b0]])
190 ; CHECK-DAG: %[[max1:.+]] = call i32 @dx.op.binary.i32(i32 37, i32 %[[a1]], i32 %[[b1]])
191 ; CHECK-DAG: %[[max2:.+]] = call i32 @dx.op.binary.i32(i32 37, i32 %[[a2]], i32 %[[b2]])
192 ; CHECK-DAG: %[[max3:.+]] = call i32 @dx.op.binary.i32(i32 37, i32 %[[a3]], i32 %[[b3]])
193 ; CHECK-DAG: %[[min0:.+]] = call i32 @dx.op.binary.i32(i32 38, i32 %[[max0]], i32 %[[c0]])
194 ; CHECK-DAG: %[[min1:.+]] = call i32 @dx.op.binary.i32(i32 38, i32 %[[max1]], i32 %[[c1]])
195 ; CHECK-DAG: %[[min2:.+]] = call i32 @dx.op.binary.i32(i32 38, i32 %[[max2]], i32 %[[c2]])
196 ; CHECK-DAG: %[[min3:.+]] = call i32 @dx.op.binary.i32(i32 38, i32 %[[max3]], i32 %[[c3]])
197 ; CHECK-DAG: %[[ret0:.+]] = insertelement <4 x i32> poison, i32 %[[min0]], i64 0
198 ; CHECK-DAG: %[[ret1:.+]] = insertelement <4 x i32> %[[ret0]], i32 %[[min1]], i64 1
199 ; CHECK-DAG: %[[ret2:.+]] = insertelement <4 x i32> %[[ret1]], i32 %[[min2]], i64 2
200 ; CHECK-DAG: %[[ret3:.+]] = insertelement <4 x i32> %[[ret2]], i32 %[[min3]], i64 3
201 ; CHECK: ret <4 x i32> %[[ret3]]
202 %dx.clamp = call <4 x i32> @llvm.dx.sclamp.v4i32(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c)
203 ret <4 x i32> %dx.clamp
206 ; CHECK-LABEL: clamp_uint16_t3
207 define noundef <3 x i16> @clamp_uint16_t3(<3 x i16> noundef %a, <3 x i16> noundef %b, <3 x i16> noundef %c) {
209 ; CHECK-DAG: %[[a0:.+]] = extractelement <3 x i16> %a, i64 0
210 ; CHECK-DAG: %[[a1:.+]] = extractelement <3 x i16> %a, i64 1
211 ; CHECK-DAG: %[[a2:.+]] = extractelement <3 x i16> %a, i64 2
212 ; CHECK-DAG: %[[b0:.+]] = extractelement <3 x i16> %b, i64 0
213 ; CHECK-DAG: %[[b1:.+]] = extractelement <3 x i16> %b, i64 1
214 ; CHECK-DAG: %[[b2:.+]] = extractelement <3 x i16> %b, i64 2
215 ; CHECK-DAG: %[[c0:.+]] = extractelement <3 x i16> %c, i64 0
216 ; CHECK-DAG: %[[c1:.+]] = extractelement <3 x i16> %c, i64 1
217 ; CHECK-DAG: %[[c2:.+]] = extractelement <3 x i16> %c, i64 2
218 ; CHECK-DAG: %[[max0:.+]] = call i16 @dx.op.binary.i16(i32 39, i16 %[[a0]], i16 %[[b0]])
219 ; CHECK-DAG: %[[max1:.+]] = call i16 @dx.op.binary.i16(i32 39, i16 %[[a1]], i16 %[[b1]])
220 ; CHECK-DAG: %[[max2:.+]] = call i16 @dx.op.binary.i16(i32 39, i16 %[[a2]], i16 %[[b2]])
221 ; CHECK-DAG: %[[min0:.+]] = call i16 @dx.op.binary.i16(i32 40, i16 %[[max0]], i16 %[[c0]])
222 ; CHECK-DAG: %[[min1:.+]] = call i16 @dx.op.binary.i16(i32 40, i16 %[[max1]], i16 %[[c1]])
223 ; CHECK-DAG: %[[min2:.+]] = call i16 @dx.op.binary.i16(i32 40, i16 %[[max2]], i16 %[[c2]])
224 ; CHECK-DAG: %[[ret0:.+]] = insertelement <3 x i16> poison, i16 %[[min0]], i64 0
225 ; CHECK-DAG: %[[ret1:.+]] = insertelement <3 x i16> %[[ret0]], i16 %[[min1]], i64 1
226 ; CHECK-DAG: %[[ret2:.+]] = insertelement <3 x i16> %[[ret1]], i16 %[[min2]], i64 2
227 ; CHECK: ret <3 x i16> %[[ret2]]
228 %dx.clamp = call <3 x i16> @llvm.dx.uclamp.v3i16(<3 x i16> %a, <3 x i16> %b, <3 x i16> %c)
229 ret <3 x i16> %dx.clamp
232 ; CHECK-LABEL: clamp_uint4
233 define noundef <4 x i32> @clamp_uint4(<4 x i32> noundef %a, <4 x i32> noundef %b, <4 x i32> noundef %c) {
235 ; CHECK-DAG: %[[a0:.+]] = extractelement <4 x i32> %a, i64 0
236 ; CHECK-DAG: %[[a1:.+]] = extractelement <4 x i32> %a, i64 1
237 ; CHECK-DAG: %[[a2:.+]] = extractelement <4 x i32> %a, i64 2
238 ; CHECK-DAG: %[[a3:.+]] = extractelement <4 x i32> %a, i64 3
239 ; CHECK-DAG: %[[b0:.+]] = extractelement <4 x i32> %b, i64 0
240 ; CHECK-DAG: %[[b1:.+]] = extractelement <4 x i32> %b, i64 1
241 ; CHECK-DAG: %[[b2:.+]] = extractelement <4 x i32> %b, i64 2
242 ; CHECK-DAG: %[[b3:.+]] = extractelement <4 x i32> %b, i64 3
243 ; CHECK-DAG: %[[c0:.+]] = extractelement <4 x i32> %c, i64 0
244 ; CHECK-DAG: %[[c1:.+]] = extractelement <4 x i32> %c, i64 1
245 ; CHECK-DAG: %[[c2:.+]] = extractelement <4 x i32> %c, i64 2
246 ; CHECK-DAG: %[[c3:.+]] = extractelement <4 x i32> %c, i64 3
247 ; CHECK-DAG: %[[max0:.+]] = call i32 @dx.op.binary.i32(i32 39, i32 %[[a0]], i32 %[[b0]])
248 ; CHECK-DAG: %[[max1:.+]] = call i32 @dx.op.binary.i32(i32 39, i32 %[[a1]], i32 %[[b1]])
249 ; CHECK-DAG: %[[max2:.+]] = call i32 @dx.op.binary.i32(i32 39, i32 %[[a2]], i32 %[[b2]])
250 ; CHECK-DAG: %[[max3:.+]] = call i32 @dx.op.binary.i32(i32 39, i32 %[[a3]], i32 %[[b3]])
251 ; CHECK-DAG: %[[min0:.+]] = call i32 @dx.op.binary.i32(i32 40, i32 %[[max0]], i32 %[[c0]])
252 ; CHECK-DAG: %[[min1:.+]] = call i32 @dx.op.binary.i32(i32 40, i32 %[[max1]], i32 %[[c1]])
253 ; CHECK-DAG: %[[min2:.+]] = call i32 @dx.op.binary.i32(i32 40, i32 %[[max2]], i32 %[[c2]])
254 ; CHECK-DAG: %[[min3:.+]] = call i32 @dx.op.binary.i32(i32 40, i32 %[[max3]], i32 %[[c3]])
255 ; CHECK-DAG: %[[ret0:.+]] = insertelement <4 x i32> poison, i32 %[[min0]], i64 0
256 ; CHECK-DAG: %[[ret1:.+]] = insertelement <4 x i32> %[[ret0]], i32 %[[min1]], i64 1
257 ; CHECK-DAG: %[[ret2:.+]] = insertelement <4 x i32> %[[ret1]], i32 %[[min2]], i64 2
258 ; CHECK-DAG: %[[ret3:.+]] = insertelement <4 x i32> %[[ret2]], i32 %[[min3]], i64 3
259 ; CHECK: ret <4 x i32> %[[ret3]]
260 %dx.clamp = call <4 x i32> @llvm.dx.uclamp.v4i32(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c)
261 ret <4 x i32> %dx.clamp
264 ; CHECK-LABEL: clamp_uint64_t4
265 define noundef <2 x i64> @clamp_uint64_t4(<2 x i64> noundef %a, <2 x i64> noundef %b, <2 x i64> noundef %c) {
267 ; CHECK-DAG: %[[a0:.+]] = extractelement <2 x i64> %a, i64 0
268 ; CHECK-DAG: %[[a1:.+]] = extractelement <2 x i64> %a, i64 1
269 ; CHECK-DAG: %[[b0:.+]] = extractelement <2 x i64> %b, i64 0
270 ; CHECK-DAG: %[[b1:.+]] = extractelement <2 x i64> %b, i64 1
271 ; CHECK-DAG: %[[c0:.+]] = extractelement <2 x i64> %c, i64 0
272 ; CHECK-DAG: %[[c1:.+]] = extractelement <2 x i64> %c, i64 1
273 ; CHECK-DAG: %[[max0:.+]] = call i64 @dx.op.binary.i64(i32 39, i64 %[[a0]], i64 %[[b0]])
274 ; CHECK-DAG: %[[max1:.+]] = call i64 @dx.op.binary.i64(i32 39, i64 %[[a1]], i64 %[[b1]])
275 ; CHECK-DAG: %[[min0:.+]] = call i64 @dx.op.binary.i64(i32 40, i64 %[[max0]], i64 %[[c0]])
276 ; CHECK-DAG: %[[min1:.+]] = call i64 @dx.op.binary.i64(i32 40, i64 %[[max1]], i64 %[[c1]])
277 ; CHECK-DAG: %[[ret0:.+]] = insertelement <2 x i64> poison, i64 %[[min0]], i64 0
278 ; CHECK-DAG: %[[ret1:.+]] = insertelement <2 x i64> %[[ret0]], i64 %[[min1]], i64 1
279 ; CHECK: ret <2 x i64> %[[ret1]]
280 %dx.clamp = call <2 x i64> @llvm.dx.uclamp.v2i64(<2 x i64> %a, <2 x i64> %b, <2 x i64> %c)
281 ret <2 x i64> %dx.clamp
285 declare <3 x half> @llvm.dx.nclamp.v3f16(<3 x half>, <3 x half>, <3 x half>)
286 declare <4 x float> @llvm.dx.nclamp.v4f32(<4 x float>, <4 x float>, <4 x float>)
287 declare <2 x double> @llvm.dx.nclamp.v2f64(<2 x double>, <2 x double>, <2 x double>)
288 declare <4 x i32> @llvm.dx.sclamp.v4i32(<4 x i32>, <4 x i32>, <4 x i32>)
289 declare <3 x i16> @llvm.dx.uclamp.v3i32(<3 x i16>, <3 x i32>, <3 x i16>)
290 declare <4 x i32> @llvm.dx.uclamp.v4i32(<4 x i32>, <4 x i32>, <4 x i32>)
291 declare <2 x i64> @llvm.dx.uclamp.v2i64(<2 x i64>, <2 x i64>, <2 x i64>)