[libc-commits] [libc] [libc] Allow LLVM_LIBC_FUNCTION macro to take another parameter for function alias. (PR #187154)

via libc-commits libc-commits at lists.llvm.org
Thu Mar 19 07:16:41 PDT 2026


================
@@ -7,10 +7,33 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/mathvec/expf.h"
+#include "src/__support/common.h"
+#include "src/__support/macros/properties/cpu_features.h"
 #include "src/__support/mathvec/expf.h"
 
+#ifndef LIBC_MATHVEC_EXPF_SYM
+#if defined(LIBC_TARGET_CPU_HAS_AVX512F)
+#define LIBC_MATHVEC_EXPF_SYM_PREFIX "_ZGVeN16v_"
----------------
lntue wrote:

So I could see the next step is to refactor `PREFIX` macro to somewhere, maybe `simd.h`, then in each file, it will only be
```
#ifndef LIBC_MATHVEC_FUNC_SYM
#define LIBC_MATHVEC_FUNC_SYM LIBC_MATHVEC_COMMON_PREFIX "func"
#endif
```
And we only manage a few simple, common prefix schemes, and let other downstream users to override them with `-DLIBC_MATHVEC_FUNC_SYM=...` however they like.

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


More information about the libc-commits mailing list