1 // RUN: mlir-opt -split-input-file -verify-diagnostics %s | FileCheck %s
3 //===----------------------------------------------------------------------===//
4 // spirv.GroupNonUniformBallot
5 //===----------------------------------------------------------------------===//
7 func.func @group_non_uniform_ballot(%predicate: i1) -> vector<4xi32> {
8 // CHECK: %{{.*}} = spirv.GroupNonUniformBallot <Workgroup> %{{.*}}: vector<4xi32>
9 %0 = spirv.GroupNonUniformBallot <Workgroup> %predicate : vector<4xi32>
10 return %0: vector<4xi32>
15 func.func @group_non_uniform_ballot(%predicate: i1) -> vector<4xi32> {
16 // expected-error @+1 {{execution scope must be 'Workgroup' or 'Subgroup'}}
17 %0 = spirv.GroupNonUniformBallot <Device> %predicate : vector<4xi32>
18 return %0: vector<4xi32>
23 func.func @group_non_uniform_ballot(%predicate: i1) -> vector<4xsi32> {
24 // expected-error @+1 {{op result #0 must be vector of 8/16/32/64-bit signless/unsigned integer values of length 4, but got 'vector<4xsi32>'}}
25 %0 = spirv.GroupNonUniformBallot <Workgroup> %predicate : vector<4xsi32>
26 return %0: vector<4xsi32>
31 //===----------------------------------------------------------------------===//
32 // spirv.GroupNonUniformBallotFindLSB
33 //===----------------------------------------------------------------------===//
35 func.func @group_non_uniform_ballot_find_lsb(%value : vector<4xi32>) -> i32 {
36 // CHECK: %{{.*}} = spirv.GroupNonUniformBallotFindLSB <Subgroup> %{{.*}}: vector<4xi32>, i32
37 %0 = spirv.GroupNonUniformBallotFindLSB <Subgroup> %value : vector<4xi32>, i32
43 func.func @group_non_uniform_ballot_find_lsb(%value : vector<4xi32>) -> i32 {
44 // expected-error @+1 {{execution scope must be 'Workgroup' or 'Subgroup'}}
45 %0 = spirv.GroupNonUniformBallotFindLSB <Device> %value : vector<4xi32>, i32
51 func.func @group_non_uniform_ballot_find_lsb(%value : vector<4xi32>) -> si32 {
52 // expected-error @+1 {{op result #0 must be 8/16/32/64-bit signless/unsigned integer, but got 'si32'}}
53 %0 = spirv.GroupNonUniformBallotFindLSB <Subgroup> %value : vector<4xi32>, si32
59 //===----------------------------------------------------------------------===//
60 // spirv.GroupNonUniformBallotFindLSB
61 //===----------------------------------------------------------------------===//
63 func.func @group_non_uniform_ballot_find_msb(%value : vector<4xi32>) -> i32 {
64 // CHECK: %{{.*}} = spirv.GroupNonUniformBallotFindMSB <Subgroup> %{{.*}}: vector<4xi32>, i32
65 %0 = spirv.GroupNonUniformBallotFindMSB <Subgroup> %value : vector<4xi32>, i32
71 func.func @group_non_uniform_ballot_find_msb(%value : vector<4xi32>) -> i32 {
72 // expected-error @+1 {{execution scope must be 'Workgroup' or 'Subgroup'}}
73 %0 = spirv.GroupNonUniformBallotFindMSB <Device> %value : vector<4xi32>, i32
79 func.func @group_non_uniform_ballot_find_msb(%value : vector<4xi32>) -> si32 {
80 // expected-error @+1 {{op result #0 must be 8/16/32/64-bit signless/unsigned integer, but got 'si32'}}
81 %0 = spirv.GroupNonUniformBallotFindMSB <Subgroup> %value : vector<4xi32>, si32
87 //===----------------------------------------------------------------------===//
88 // spirv.NonUniformGroupBroadcast
89 //===----------------------------------------------------------------------===//
91 func.func @group_non_uniform_broadcast_scalar(%value: f32) -> f32 {
92 %one = spirv.Constant 1 : i32
93 // CHECK: spirv.GroupNonUniformBroadcast <Workgroup> %{{.*}}, %{{.*}} : f32, i32
94 %0 = spirv.GroupNonUniformBroadcast <Workgroup> %value, %one : f32, i32
100 func.func @group_non_uniform_broadcast_vector(%value: vector<4xf32>) -> vector<4xf32> {
101 %one = spirv.Constant 1 : i32
102 // CHECK: spirv.GroupNonUniformBroadcast <Subgroup> %{{.*}}, %{{.*}} : vector<4xf32>, i32
103 %0 = spirv.GroupNonUniformBroadcast <Subgroup> %value, %one : vector<4xf32>, i32
104 return %0: vector<4xf32>
109 func.func @group_non_uniform_broadcast_negative_scope(%value: f32, %localid: i32 ) -> f32 {
110 %one = spirv.Constant 1 : i32
111 // expected-error @+1 {{execution scope must be 'Workgroup' or 'Subgroup'}}
112 %0 = spirv.GroupNonUniformBroadcast <Device> %value, %one : f32, i32
118 func.func @group_non_uniform_broadcast_negative_non_const(%value: f32, %localid: i32) -> f32 {
119 // expected-error @+1 {{id must be the result of a constant op}}
120 %0 = spirv.GroupNonUniformBroadcast <Subgroup> %value, %localid : f32, i32
126 //===----------------------------------------------------------------------===//
127 // spirv.GroupNonUniformElect
128 //===----------------------------------------------------------------------===//
130 // CHECK-LABEL: @group_non_uniform_elect
131 func.func @group_non_uniform_elect() -> i1 {
132 // CHECK: %{{.+}} = spirv.GroupNonUniformElect <Workgroup> : i1
133 %0 = spirv.GroupNonUniformElect <Workgroup> : i1
139 func.func @group_non_uniform_elect() -> i1 {
140 // expected-error @+1 {{execution scope must be 'Workgroup' or 'Subgroup'}}
141 %0 = spirv.GroupNonUniformElect <CrossDevice> : i1
147 //===----------------------------------------------------------------------===//
148 // spirv.GroupNonUniformFAdd
149 //===----------------------------------------------------------------------===//
151 // CHECK-LABEL: @group_non_uniform_fadd_reduce
152 func.func @group_non_uniform_fadd_reduce(%val: f32) -> f32 {
153 // CHECK: %{{.+}} = spirv.GroupNonUniformFAdd <Workgroup> <Reduce> %{{.+}} : f32 -> f32
154 %0 = spirv.GroupNonUniformFAdd <Workgroup> <Reduce> %val : f32 -> f32
158 // CHECK-LABEL: @group_non_uniform_fadd_clustered_reduce
159 func.func @group_non_uniform_fadd_clustered_reduce(%val: vector<2xf32>) -> vector<2xf32> {
160 %four = spirv.Constant 4 : i32
161 // CHECK: %{{.+}} = spirv.GroupNonUniformFAdd <Workgroup> <ClusteredReduce> %{{.+}} cluster_size(%{{.+}}) : vector<2xf32>, i32 -> vector<2xf32>
162 %0 = spirv.GroupNonUniformFAdd <Workgroup> <ClusteredReduce> %val cluster_size(%four) : vector<2xf32>, i32 -> vector<2xf32>
163 return %0: vector<2xf32>
166 //===----------------------------------------------------------------------===//
167 // spirv.GroupNonUniformFMul
168 //===----------------------------------------------------------------------===//
170 // CHECK-LABEL: @group_non_uniform_fmul_reduce
171 func.func @group_non_uniform_fmul_reduce(%val: f32) -> f32 {
172 // CHECK: %{{.+}} = spirv.GroupNonUniformFMul <Workgroup> <Reduce> %{{.+}} : f32 -> f32
173 %0 = spirv.GroupNonUniformFMul <Workgroup> <Reduce> %val : f32 -> f32
177 // CHECK-LABEL: @group_non_uniform_fmul_clustered_reduce
178 func.func @group_non_uniform_fmul_clustered_reduce(%val: vector<2xf32>) -> vector<2xf32> {
179 %four = spirv.Constant 4 : i32
180 // CHECK: %{{.+}} = spirv.GroupNonUniformFMul <Workgroup> <ClusteredReduce> %{{.+}} cluster_size(%{{.+}}) : vector<2xf32>, i32 -> vector<2xf32>
181 %0 = spirv.GroupNonUniformFMul <Workgroup> <ClusteredReduce> %val cluster_size(%four) : vector<2xf32>, i32 -> vector<2xf32>
182 return %0: vector<2xf32>
187 //===----------------------------------------------------------------------===//
188 // spirv.GroupNonUniformFMax
189 //===----------------------------------------------------------------------===//
191 // CHECK-LABEL: @group_non_uniform_fmax_reduce
192 func.func @group_non_uniform_fmax_reduce(%val: f32) -> f32 {
193 // CHECK: %{{.+}} = spirv.GroupNonUniformFMax <Workgroup> <Reduce> %{{.+}} : f32 -> f32
194 %0 = spirv.GroupNonUniformFMax <Workgroup> <Reduce> %val : f32 -> f32
200 //===----------------------------------------------------------------------===//
201 // spirv.GroupNonUniformFMin
202 //===----------------------------------------------------------------------===//
204 // CHECK-LABEL: @group_non_uniform_fmin_reduce
205 func.func @group_non_uniform_fmin_reduce(%val: f32) -> f32 {
206 // CHECK: %{{.+}} = spirv.GroupNonUniformFMin <Workgroup> <Reduce> %{{.+}} : f32 -> f32
207 %0 = spirv.GroupNonUniformFMin <Workgroup> <Reduce> %val : f32 -> f32
213 //===----------------------------------------------------------------------===//
214 // spirv.GroupNonUniformIAdd
215 //===----------------------------------------------------------------------===//
217 // CHECK-LABEL: @group_non_uniform_iadd_reduce
218 func.func @group_non_uniform_iadd_reduce(%val: i32) -> i32 {
219 // CHECK: %{{.+}} = spirv.GroupNonUniformIAdd <Workgroup> <Reduce> %{{.+}} : i32 -> i32
220 %0 = spirv.GroupNonUniformIAdd <Workgroup> <Reduce> %val : i32 -> i32
224 // CHECK-LABEL: @group_non_uniform_iadd_clustered_reduce
225 func.func @group_non_uniform_iadd_clustered_reduce(%val: vector<2xi32>) -> vector<2xi32> {
226 %four = spirv.Constant 4 : i32
227 // CHECK: %{{.+}} = spirv.GroupNonUniformIAdd <Workgroup> <ClusteredReduce> %{{.+}} cluster_size(%{{.+}}) : vector<2xi32>, i32 -> vector<2xi32>
228 %0 = spirv.GroupNonUniformIAdd <Workgroup> <ClusteredReduce> %val cluster_size(%four) : vector<2xi32>, i32 -> vector<2xi32>
229 return %0: vector<2xi32>
234 func.func @group_non_uniform_iadd_reduce(%val: i32) -> i32 {
235 // expected-error @+1 {{execution scope must be 'Workgroup' or 'Subgroup'}}
236 %0 = spirv.GroupNonUniformIAdd <Device> <Reduce> %val : i32 -> i32
242 func.func @group_non_uniform_iadd_clustered_reduce(%val: vector<2xi32>) -> vector<2xi32> {
243 // expected-error @+1 {{cluster size operand must be provided for 'ClusteredReduce' group operation}}
244 %0 = spirv.GroupNonUniformIAdd <Workgroup> <ClusteredReduce> %val : vector<2xi32> -> vector<2xi32>
245 return %0: vector<2xi32>
250 func.func @group_non_uniform_iadd_clustered_reduce(%val: vector<2xi32>, %size: i32) -> vector<2xi32> {
251 // expected-error @+1 {{cluster size operand must come from a constant op}}
252 %0 = spirv.GroupNonUniformIAdd <Workgroup> <ClusteredReduce> %val cluster_size(%size) : vector<2xi32>, i32 -> vector<2xi32>
253 return %0: vector<2xi32>
258 func.func @group_non_uniform_iadd_clustered_reduce(%val: vector<2xi32>) -> vector<2xi32> {
259 %five = spirv.Constant 5 : i32
260 // expected-error @+1 {{cluster size operand must be a power of two}}
261 %0 = spirv.GroupNonUniformIAdd <Workgroup> <ClusteredReduce> %val cluster_size(%five) : vector<2xi32>, i32 -> vector<2xi32>
262 return %0: vector<2xi32>
267 //===----------------------------------------------------------------------===//
268 // spirv.GroupNonUniformIMul
269 //===----------------------------------------------------------------------===//
271 // CHECK-LABEL: @group_non_uniform_imul_reduce
272 func.func @group_non_uniform_imul_reduce(%val: i32) -> i32 {
273 // CHECK: %{{.+}} = spirv.GroupNonUniformIMul <Workgroup> <Reduce> %{{.+}} : i32 -> i32
274 %0 = spirv.GroupNonUniformIMul <Workgroup> <Reduce> %val : i32 -> i32
278 // CHECK-LABEL: @group_non_uniform_imul_clustered_reduce
279 func.func @group_non_uniform_imul_clustered_reduce(%val: vector<2xi32>) -> vector<2xi32> {
280 %four = spirv.Constant 4 : i32
281 // CHECK: %{{.+}} = spirv.GroupNonUniformIMul <Workgroup> <ClusteredReduce> %{{.+}} cluster_size(%{{.+}}) : vector<2xi32>, i32 -> vector<2xi32>
282 %0 = spirv.GroupNonUniformIMul <Workgroup> <ClusteredReduce> %val cluster_size(%four) : vector<2xi32>, i32 -> vector<2xi32>
283 return %0: vector<2xi32>
288 //===----------------------------------------------------------------------===//
289 // spirv.GroupNonUniformSMax
290 //===----------------------------------------------------------------------===//
292 // CHECK-LABEL: @group_non_uniform_smax_reduce
293 func.func @group_non_uniform_smax_reduce(%val: i32) -> i32 {
294 // CHECK: %{{.+}} = spirv.GroupNonUniformSMax <Workgroup> <Reduce> %{{.+}} : i32 -> i32
295 %0 = spirv.GroupNonUniformSMax <Workgroup> <Reduce> %val : i32 -> i32
301 //===----------------------------------------------------------------------===//
302 // spirv.GroupNonUniformSMin
303 //===----------------------------------------------------------------------===//
305 // CHECK-LABEL: @group_non_uniform_smin_reduce
306 func.func @group_non_uniform_smin_reduce(%val: i32) -> i32 {
307 // CHECK: %{{.+}} = spirv.GroupNonUniformSMin <Workgroup> <Reduce> %{{.+}} : i32 -> i32
308 %0 = spirv.GroupNonUniformSMin <Workgroup> <Reduce> %val : i32 -> i32
314 //===----------------------------------------------------------------------===//
315 // spirv.GroupNonUniformShuffle
316 //===----------------------------------------------------------------------===//
318 // CHECK-LABEL: @group_non_uniform_shuffle1
319 func.func @group_non_uniform_shuffle1(%val: f32, %id: i32) -> f32 {
320 // CHECK: %{{.+}} = spirv.GroupNonUniformShuffle <Subgroup> %{{.+}}, %{{.+}} : f32, i32
321 %0 = spirv.GroupNonUniformShuffle <Subgroup> %val, %id : f32, i32
325 // CHECK-LABEL: @group_non_uniform_shuffle2
326 func.func @group_non_uniform_shuffle2(%val: vector<2xf32>, %id: i32) -> vector<2xf32> {
327 // CHECK: %{{.+}} = spirv.GroupNonUniformShuffle <Subgroup> %{{.+}}, %{{.+}} : vector<2xf32>, i32
328 %0 = spirv.GroupNonUniformShuffle <Subgroup> %val, %id : vector<2xf32>, i32
329 return %0: vector<2xf32>
334 func.func @group_non_uniform_shuffle(%val: vector<2xf32>, %id: i32) -> vector<2xf32> {
335 // expected-error @+1 {{execution scope must be 'Workgroup' or 'Subgroup'}}
336 %0 = spirv.GroupNonUniformShuffle <Device> %val, %id : vector<2xf32>, i32
337 return %0: vector<2xf32>
342 func.func @group_non_uniform_shuffle(%val: vector<2xf32>, %id: si32) -> vector<2xf32> {
343 // expected-error @+1 {{second operand must be a singless/unsigned integer}}
344 %0 = spirv.GroupNonUniformShuffle <Subgroup> %val, %id : vector<2xf32>, si32
345 return %0: vector<2xf32>
350 //===----------------------------------------------------------------------===//
351 // spirv.GroupNonUniformShuffleXor
352 //===----------------------------------------------------------------------===//
354 // CHECK-LABEL: @group_non_uniform_shuffle1
355 func.func @group_non_uniform_shuffle1(%val: f32, %id: i32) -> f32 {
356 // CHECK: %{{.+}} = spirv.GroupNonUniformShuffleXor <Subgroup> %{{.+}}, %{{.+}} : f32, i32
357 %0 = spirv.GroupNonUniformShuffleXor <Subgroup> %val, %id : f32, i32
361 // CHECK-LABEL: @group_non_uniform_shuffle2
362 func.func @group_non_uniform_shuffle2(%val: vector<2xf32>, %id: i32) -> vector<2xf32> {
363 // CHECK: %{{.+}} = spirv.GroupNonUniformShuffleXor <Subgroup> %{{.+}}, %{{.+}} : vector<2xf32>, i32
364 %0 = spirv.GroupNonUniformShuffleXor <Subgroup> %val, %id : vector<2xf32>, i32
365 return %0: vector<2xf32>
370 func.func @group_non_uniform_shuffle(%val: vector<2xf32>, %id: i32) -> vector<2xf32> {
371 // expected-error @+1 {{execution scope must be 'Workgroup' or 'Subgroup'}}
372 %0 = spirv.GroupNonUniformShuffleXor <Device> %val, %id : vector<2xf32>, i32
373 return %0: vector<2xf32>
378 func.func @group_non_uniform_shuffle(%val: vector<2xf32>, %id: si32) -> vector<2xf32> {
379 // expected-error @+1 {{second operand must be a singless/unsigned integer}}
380 %0 = spirv.GroupNonUniformShuffleXor <Subgroup> %val, %id : vector<2xf32>, si32
381 return %0: vector<2xf32>
386 //===----------------------------------------------------------------------===//
387 // spirv.GroupNonUniformShuffleUp
388 //===----------------------------------------------------------------------===//
390 // CHECK-LABEL: @group_non_uniform_shuffle1
391 func.func @group_non_uniform_shuffle1(%val: f32, %id: i32) -> f32 {
392 // CHECK: %{{.+}} = spirv.GroupNonUniformShuffleUp <Subgroup> %{{.+}}, %{{.+}} : f32, i32
393 %0 = spirv.GroupNonUniformShuffleUp <Subgroup> %val, %id : f32, i32
397 // CHECK-LABEL: @group_non_uniform_shuffle2
398 func.func @group_non_uniform_shuffle2(%val: vector<2xf32>, %id: i32) -> vector<2xf32> {
399 // CHECK: %{{.+}} = spirv.GroupNonUniformShuffleUp <Subgroup> %{{.+}}, %{{.+}} : vector<2xf32>, i32
400 %0 = spirv.GroupNonUniformShuffleUp <Subgroup> %val, %id : vector<2xf32>, i32
401 return %0: vector<2xf32>
406 func.func @group_non_uniform_shuffle(%val: vector<2xf32>, %id: i32) -> vector<2xf32> {
407 // expected-error @+1 {{execution scope must be 'Workgroup' or 'Subgroup'}}
408 %0 = spirv.GroupNonUniformShuffleUp <Device> %val, %id : vector<2xf32>, i32
409 return %0: vector<2xf32>
414 func.func @group_non_uniform_shuffle(%val: vector<2xf32>, %id: si32) -> vector<2xf32> {
415 // expected-error @+1 {{second operand must be a singless/unsigned integer}}
416 %0 = spirv.GroupNonUniformShuffleUp <Subgroup> %val, %id : vector<2xf32>, si32
417 return %0: vector<2xf32>
422 //===----------------------------------------------------------------------===//
423 // spirv.GroupNonUniformShuffleDown
424 //===----------------------------------------------------------------------===//
426 // CHECK-LABEL: @group_non_uniform_shuffle1
427 func.func @group_non_uniform_shuffle1(%val: f32, %id: i32) -> f32 {
428 // CHECK: %{{.+}} = spirv.GroupNonUniformShuffleDown <Subgroup> %{{.+}}, %{{.+}} : f32, i32
429 %0 = spirv.GroupNonUniformShuffleDown <Subgroup> %val, %id : f32, i32
433 // CHECK-LABEL: @group_non_uniform_shuffle2
434 func.func @group_non_uniform_shuffle2(%val: vector<2xf32>, %id: i32) -> vector<2xf32> {
435 // CHECK: %{{.+}} = spirv.GroupNonUniformShuffleDown <Subgroup> %{{.+}}, %{{.+}} : vector<2xf32>, i32
436 %0 = spirv.GroupNonUniformShuffleDown <Subgroup> %val, %id : vector<2xf32>, i32
437 return %0: vector<2xf32>
442 func.func @group_non_uniform_shuffle(%val: vector<2xf32>, %id: i32) -> vector<2xf32> {
443 // expected-error @+1 {{execution scope must be 'Workgroup' or 'Subgroup'}}
444 %0 = spirv.GroupNonUniformShuffleDown <Device> %val, %id : vector<2xf32>, i32
445 return %0: vector<2xf32>
450 func.func @group_non_uniform_shuffle(%val: vector<2xf32>, %id: si32) -> vector<2xf32> {
451 // expected-error @+1 {{second operand must be a singless/unsigned integer}}
452 %0 = spirv.GroupNonUniformShuffleDown <Subgroup> %val, %id : vector<2xf32>, si32
453 return %0: vector<2xf32>
458 //===----------------------------------------------------------------------===//
459 // spirv.GroupNonUniformUMax
460 //===----------------------------------------------------------------------===//
462 // CHECK-LABEL: @group_non_uniform_umax_reduce
463 func.func @group_non_uniform_umax_reduce(%val: i32) -> i32 {
464 // CHECK: %{{.+}} = spirv.GroupNonUniformUMax <Workgroup> <Reduce> %{{.+}} : i32 -> i32
465 %0 = spirv.GroupNonUniformUMax <Workgroup> <Reduce> %val : i32 -> i32
471 //===----------------------------------------------------------------------===//
472 // spirv.GroupNonUniformUMin
473 //===----------------------------------------------------------------------===//
475 // CHECK-LABEL: @group_non_uniform_umin_reduce
476 func.func @group_non_uniform_umin_reduce(%val: i32) -> i32 {
477 // CHECK: %{{.+}} = spirv.GroupNonUniformUMin <Workgroup> <Reduce> %{{.+}} : i32 -> i32
478 %0 = spirv.GroupNonUniformUMin <Workgroup> <Reduce> %val : i32 -> i32
484 //===----------------------------------------------------------------------===//
485 // spirv.GroupNonUniformBitwiseAnd
486 //===----------------------------------------------------------------------===//
488 // CHECK-LABEL: @group_non_uniform_bitwise_and
489 func.func @group_non_uniform_bitwise_and(%val: i32) -> i32 {
490 // CHECK: %{{.+}} = spirv.GroupNonUniformBitwiseAnd <Workgroup> <Reduce> %{{.+}} : i32 -> i32
491 %0 = spirv.GroupNonUniformBitwiseAnd <Workgroup> <Reduce> %val : i32 -> i32
497 func.func @group_non_uniform_bitwise_and(%val: i1) -> i1 {
498 // expected-error @+1 {{operand #0 must be 8/16/32/64-bit integer or vector of 8/16/32/64-bit integer values of length 2/3/4/8/16, but got 'i1'}}
499 %0 = spirv.GroupNonUniformBitwiseAnd <Workgroup> <Reduce> %val : i1 -> i1
505 //===----------------------------------------------------------------------===//
506 // spirv.GroupNonUniformBitwiseOr
507 //===----------------------------------------------------------------------===//
509 // CHECK-LABEL: @group_non_uniform_bitwise_or
510 func.func @group_non_uniform_bitwise_or(%val: i32) -> i32 {
511 // CHECK: %{{.+}} = spirv.GroupNonUniformBitwiseOr <Workgroup> <Reduce> %{{.+}} : i32 -> i32
512 %0 = spirv.GroupNonUniformBitwiseOr <Workgroup> <Reduce> %val : i32 -> i32
518 func.func @group_non_uniform_bitwise_or(%val: i1) -> i1 {
519 // expected-error @+1 {{operand #0 must be 8/16/32/64-bit integer or vector of 8/16/32/64-bit integer values of length 2/3/4/8/16, but got 'i1'}}
520 %0 = spirv.GroupNonUniformBitwiseOr <Workgroup> <Reduce> %val : i1 -> i1
526 //===----------------------------------------------------------------------===//
527 // spirv.GroupNonUniformBitwiseXor
528 //===----------------------------------------------------------------------===//
530 // CHECK-LABEL: @group_non_uniform_bitwise_xor
531 func.func @group_non_uniform_bitwise_xor(%val: i32) -> i32 {
532 // CHECK: %{{.+}} = spirv.GroupNonUniformBitwiseXor <Workgroup> <Reduce> %{{.+}} : i32 -> i32
533 %0 = spirv.GroupNonUniformBitwiseXor <Workgroup> <Reduce> %val : i32 -> i32
539 func.func @group_non_uniform_bitwise_xor(%val: i1) -> i1 {
540 // expected-error @+1 {{operand #0 must be 8/16/32/64-bit integer or vector of 8/16/32/64-bit integer values of length 2/3/4/8/16, but got 'i1'}}
541 %0 = spirv.GroupNonUniformBitwiseXor <Workgroup> <Reduce> %val : i1 -> i1
547 //===----------------------------------------------------------------------===//
548 // spirv.GroupNonUniformLogicalAnd
549 //===----------------------------------------------------------------------===//
551 // CHECK-LABEL: @group_non_uniform_logical_and
552 func.func @group_non_uniform_logical_and(%val: i1) -> i1 {
553 // CHECK: %{{.+}} = spirv.GroupNonUniformLogicalAnd <Workgroup> <Reduce> %{{.+}} : i1 -> i1
554 %0 = spirv.GroupNonUniformLogicalAnd <Workgroup> <Reduce> %val : i1 -> i1
560 func.func @group_non_uniform_logical_and(%val: i32) -> i32 {
561 // expected-error @+1 {{operand #0 must be bool or vector of bool values of length 2/3/4/8/16, but got 'i32'}}
562 %0 = spirv.GroupNonUniformLogicalAnd <Workgroup> <Reduce> %val : i32 -> i32
568 //===----------------------------------------------------------------------===//
569 // spirv.GroupNonUniformLogicalOr
570 //===----------------------------------------------------------------------===//
572 // CHECK-LABEL: @group_non_uniform_logical_or
573 func.func @group_non_uniform_logical_or(%val: i1) -> i1 {
574 // CHECK: %{{.+}} = spirv.GroupNonUniformLogicalOr <Workgroup> <Reduce> %{{.+}} : i1 -> i1
575 %0 = spirv.GroupNonUniformLogicalOr <Workgroup> <Reduce> %val : i1 -> i1
581 func.func @group_non_uniform_logical_or(%val: i32) -> i32 {
582 // expected-error @+1 {{operand #0 must be bool or vector of bool values of length 2/3/4/8/16, but got 'i32'}}
583 %0 = spirv.GroupNonUniformLogicalOr <Workgroup> <Reduce> %val : i32 -> i32
589 //===----------------------------------------------------------------------===//
590 // spirv.GroupNonUniformLogicalXor
591 //===----------------------------------------------------------------------===//
593 // CHECK-LABEL: @group_non_uniform_logical_xor
594 func.func @group_non_uniform_logical_xor(%val: i1) -> i1 {
595 // CHECK: %{{.+}} = spirv.GroupNonUniformLogicalXor <Workgroup> <Reduce> %{{.+}} : i1 -> i1
596 %0 = spirv.GroupNonUniformLogicalXor <Workgroup> <Reduce> %val : i1 -> i1
602 func.func @group_non_uniform_logical_xor(%val: i32) -> i32 {
603 // expected-error @+1 {{operand #0 must be bool or vector of bool values of length 2/3/4/8/16, but got 'i32'}}
604 %0 = spirv.GroupNonUniformLogicalXor <Workgroup> <Reduce> %val : i32 -> i32