[libclc] [libclc] Move several integer functions to CLC library (PR #116786)

Matt Arsenault via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 5 16:05:27 PST 2024


================
@@ -0,0 +1,21 @@
+#ifndef __CLC_INTEGER_CLC_CLZ_H__
+#define __CLC_INTEGER_CLC_CLZ_H__
+
+#if defined(CLC_CLSPV) || defined(CLC_SPIRV)
+// clspv and spir-v targets provide their own OpenCL-compatible clz
+#define __clc_clz clz
----------------
arsenm wrote:

> In this context of this PR, what are you proposing? That no such redirections should take place, or just that ones that map to intrinsics specifically should not be redirected?

I mean __clc_ functions should not be implemented by directly calling the opencl public name, that's backwards. Targets should be implementing __clc override implementations, not directly providing their own opencl public entrypoints. It sounds like that's the end goal, not sure how this step gets you there though. I won't hold this up if it's in service of reaching that end 

https://github.com/llvm/llvm-project/pull/116786


More information about the cfe-commits mailing list