| 1 |
// RUN: %clang_cc1 -O1 -triple spirv64 -fsycl-is-device -x c++ %s -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK |
| 2 |
// RUN: %clang_cc1 -O1 -triple spirv64 -cl-std=CL3.0 -x cl %s -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK |
| 3 |
// RUN: %clang_cc1 -O1 -triple spirv32 -cl-std=CL3.0 -x cl %s -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK |
| 4 |
|
| 5 |
#if defined(__cplusplus) |
| 6 |
typedef bool _Bool; |
| 7 |
#endif |
| 8 |
typedef unsigned __attribute__((ext_vector_type(4))) int4; |
| 9 |
|
| 10 |
// CHECK: @{{.*}}test_subgroup_ballot{{.*}}( |
| 11 |
// CHECK-NEXT: [[ENTRY:.*:]] |
| 12 |
// CHECK-NEXT: tail call <4 x i32> @llvm.spv.wave.ballot(i1 %i) |
| 13 |
[[clang::sycl_external]] int4 test_subgroup_ballot(_Bool i) { |
| 14 |
return __builtin_spirv_subgroup_ballot(i); |
| 15 |
} |
| 16 |
|
| 17 |
// CHECK: @{{.*}}test_subgroup_shuffle{{.*}}( |
| 18 |
// CHECK-NEXT: [[ENTRY:.*:]] |
| 19 |
// CHECK-NEXT: tail call float @llvm.spv.wave.readlane.f32(float %f, i32 %i) |
| 20 |
// |
| 21 |
[[clang::sycl_external]] float test_subgroup_shuffle(float f, int i) { |
| 22 |
return __builtin_spirv_subgroup_shuffle(f, i); |
| 23 |
} |