[libc-commits] [libc] [libc][math][c23] Add exp10f16 C23 math function (PR #101588)
via libc-commits
libc-commits at lists.llvm.org
Wed Aug 7 05:45:13 PDT 2024
================
@@ -0,0 +1,170 @@
+//===-- Half-precision 10^x function --------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "src/math/exp10f16.h"
+#include "expxf16.h"
+#include "hdr/errno_macros.h"
+#include "hdr/fenv_macros.h"
+#include "src/__support/CPP/array.h"
+#include "src/__support/FPUtil/FEnvImpl.h"
+#include "src/__support/FPUtil/FPBits.h"
+#include "src/__support/FPUtil/PolyEval.h"
+#include "src/__support/FPUtil/except_value_utils.h"
+#include "src/__support/FPUtil/multiply_add.h"
+#include "src/__support/FPUtil/nearest_integer.h"
+#include "src/__support/FPUtil/rounding_mode.h"
+#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
+#include "src/__support/macros/optimization.h"
+#include "src/__support/macros/properties/cpu_features.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+static constexpr size_t N_EXP10F16_EXCEPTS = 5
+#ifndef LIBC_TARGET_CPU_HAS_FMA
----------------
lntue wrote:
This is actually harder to read and looks a bit odd. Just do the normal ifdef switch:
```
#ifdef LIBC_TARGET_CPU_HAS_FMA
static constexpr size_t N_EXP10F16_EXCEPTS = 5;
#else
static constexpr size_t N_EXP10F16_EXCEPTS = 8;
#endif
```
https://github.com/llvm/llvm-project/pull/101588
More information about the libc-commits
mailing list