[libc] [llvm] [libc][math] Refactor expf16 implementation to header-only in src/__support/math folder. (PR #147428)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 8 04:41:15 PDT 2025
================
@@ -0,0 +1,38 @@
+//===-- High and Low Excepts for expf16 functions ---------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SRC___SUPPORT_MATH_EXP_FLOAT16_CONSTANTS_H
+#define LLVM_LIBC_SRC___SUPPORT_MATH_EXP_FLOAT16_CONSTANTS_H
+
+#include "src/__support/FPUtil/except_value_utils.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+#ifndef LIBC_MATH_HAS_SKIP_ACCURATE_PASS
+static constexpr fputil::ExceptValues<float16, 2> EXPF16_EXCEPTS_LO = {{
----------------
lntue wrote:
you don't need to separate this into another header. Just keep it in `expf16.h`. And maybe you can define it inside `math::expf16` function itself, and in that case, just use `constexpr` instead of `static constexpr`. That will simplify the build a bit.
https://github.com/llvm/llvm-project/pull/147428
More information about the llvm-commits
mailing list