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

via libc-commits libc-commits at lists.llvm.org
Fri Jul 12 08:31:07 PDT 2024


================
@@ -9,9 +9,17 @@
 #include "src/math/ceilf16.h"
 #include "src/__support/FPUtil/NearestIntegerOperations.h"
 #include "src/__support/common.h"
+#include "src/__support/macros/properties/architectures.h"
 
 namespace LIBC_NAMESPACE {
 
-LLVM_LIBC_FUNCTION(float16, ceilf16, (float16 x)) { return fputil::ceil(x); }
+LLVM_LIBC_FUNCTION(float16, ceilf16, (float16 x)) {
+#if defined(__LIBC_USE_BUILTIN_CEIL_FLOOR_TRUNC) &&                            \
+    defined(LIBC_TARGET_ARCH_IS_AARCH64)
----------------
overmighty wrote:

Relevant: https://github.com/llvm/llvm-project/issues/98630.

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


More information about the libc-commits mailing list