Author: Sven van Haastregt
Date: 2021-02-05T14:16:13Z
New Revision: 42e018997b23af74eee4acdc0388ae44b36d69f9

URL: 
https://github.com/llvm/llvm-project/commit/42e018997b23af74eee4acdc0388ae44b36d69f9
DIFF: 
https://github.com/llvm/llvm-project/commit/42e018997b23af74eee4acdc0388ae44b36d69f9.diff

LOG: [OpenCL] Add cl_khr_subgroup_shuffle* to TableGen BIFs

Add the builtin functions brought by the cl_khr_subgroup_shuffle and
cl_khr_subgroup_shuffle_relative extensions to
`-fdeclare-opencl-builtins`.

Added: 
    

Modified: 
    clang/lib/Sema/OpenCLBuiltins.td

Removed: 
    


################################################################################
diff  --git a/clang/lib/Sema/OpenCLBuiltins.td 
b/clang/lib/Sema/OpenCLBuiltins.td
index cad0f57e8051..7c4b81967695 100644
--- a/clang/lib/Sema/OpenCLBuiltins.td
+++ b/clang/lib/Sema/OpenCLBuiltins.td
@@ -55,6 +55,8 @@ def FuncExtNone                          : 
FunctionExtension<"">;
 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">;
@@ -1524,10 +1526,16 @@ let Extension = FuncExtKhrSubgroupBallot in {
 // 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


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to