[libc-commits] [libc] [libc][math] Implement nearest integer functions using builtins when available (PR #98376)

via libc-commits libc-commits at lists.llvm.org
Wed Jul 10 13:46:12 PDT 2024


================
@@ -12,6 +12,12 @@
 
 namespace LIBC_NAMESPACE {
 
-LLVM_LIBC_FUNCTION(float, ceilf, (float x)) { return fputil::ceil(x); }
+LLVM_LIBC_FUNCTION(float, ceilf, (float x)) {
+#ifdef __LIBC_USE_BUILTIN_CEIL_FLOOR_TRUNC
----------------
overmighty wrote:

libc/cmake/modules/LLVMLibCCompileOptionRules.cmake defines `__LIBC_RISCV_USE_FMA` and `__LIBC_EXPLICIT_SIMD_OPT`. I guessed that a macro defined through compile options should have `__`.

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


More information about the libc-commits mailing list