def FuncExtKhrSubgroups : FunctionExtension<"cl_khr_subgroups">;
def FuncExtKhrSubgroupNonUniformVote : FunctionExtension<"cl_khr_subgroup_non_uniform_vote">;
def FuncExtKhrSubgroupBallot : FunctionExtension<"cl_khr_subgroup_ballot">;
+def FuncExtKhrSubgroupShuffle : FunctionExtension<"cl_khr_subgroup_shuffle">;
+def FuncExtKhrSubgroupShuffleRelative : FunctionExtension<"cl_khr_subgroup_shuffle_relative">;
def FuncExtKhrGlobalInt32BaseAtomics : FunctionExtension<"cl_khr_global_int32_base_atomics">;
def FuncExtKhrGlobalInt32ExtendedAtomics : FunctionExtension<"cl_khr_global_int32_extended_atomics">;
def FuncExtKhrLocalInt32BaseAtomics : FunctionExtension<"cl_khr_local_int32_base_atomics">;
// TODO
// Section 38.8.1 - cl_khr_subgroup_shuffle
-// TODO
+let Extension = FuncExtKhrSubgroupShuffle in {
+ def : Builtin<"sub_group_shuffle", [AGenType1, AGenType1, UInt]>;
+ def : Builtin<"sub_group_shuffle_xor", [AGenType1, AGenType1, UInt]>;
+}
// Section 38.9.1 - cl_khr_subgroup_shuffle_relative
-// TODO
+let Extension = FuncExtKhrSubgroupShuffleRelative in {
+ def : Builtin<"sub_group_shuffle_up", [AGenType1, AGenType1, UInt]>;
+ def : Builtin<"sub_group_shuffle_down", [AGenType1, AGenType1, UInt]>;
+}
// Section 38.10.1 - cl_khr_subgroup_clustered_reduce
// TODO