[libc-commits] [libc] [libc][math][c23] Add asinhf16() function (PR #131351)
Tejas Vipin via libc-commits
libc-commits at lists.llvm.org
Mon Mar 17 02:34:06 PDT 2025
================
@@ -0,0 +1,84 @@
+//===-- Half-precision asinhf16(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/asinhf16.h"
+#include "src/__support/FPUtil/except_value_utils.h"
+#include "src/__support/FPUtil/generic/sqrt.h"
+#include "src/__support/FPUtil/multiply_add.h"
+#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
+#include "src/__support/macros/properties/types.h"
+#include "src/math/generic/explogxf.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+#ifndef LIBC_MATH_HAS_SKIP_ACCURATE_PASS
+static constexpr size_t N_EXCEPTS = 8;
+
+static constexpr fputil::ExceptValues<float16, N_EXCEPTS> ASINHF16_EXCEPTS{
+ {// (input, RZ output, RU offset, RD offset, RN offset)
+ {0x3769, 0x372A, 1, 0, 1},
+ {0x3B5B, 0x3A96, 1, 0, 0},
+ {0x4B1F, 0x42B3, 1, 0, 0},
+ {0x4C9B, 0x4336, 1, 0, 1},
+ {0xB769, 0xB72A, 0, 1, 1},
+ {0xBB5B, 0xBA96, 0, 1, 0},
+ {0xCB1F, 0xC2B3, 0, 1, 0},
+ {0xCC9B, 0xC336, 0, 1, 1}}};
----------------
meltq wrote:
I agree that the formatting is weird, unfortunately git clang-format seems to prefer it.
https://github.com/llvm/llvm-project/pull/131351
More information about the libc-commits
mailing list