[libc-commits] [libc] [libc][math][c23] Add {nearbyint, rint, lrint, llrint, lround, llround}f16 C23 math functions (PR #94218)

via libc-commits libc-commits at lists.llvm.org
Mon Jun 3 21:12:15 PDT 2024


================
@@ -0,0 +1,21 @@
+//===-- Implementation of llrintf16 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/llrintf16.h"
+#include "src/__support/FPUtil/NearestIntegerOperations.h"
+#include "src/__support/common.h"
+
+namespace LIBC_NAMESPACE {
+
+LLVM_LIBC_FUNCTION(long long, llrintf16, (float16 x)) {
+  return fputil::round_to_signed_integer_using_current_rounding_mode<float128,
----------------
lntue wrote:

`float16`?

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


More information about the libc-commits mailing list