[libc-commits] [libc] [llvm] [libc][math] Refactor lrint_lround family to header-only (PR #195441)
via libc-commits
libc-commits at lists.llvm.org
Sat May 2 04:18:30 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libc
Author: Anonmiraj (AnonMiraj)
<details>
<summary>Changes</summary>
Refactors the lrint_lround math family to be header-only.
part of: #<!-- -->147386
Target Functions:
- llrint
- llrintbf16
- llrintf
- llrintf128
- llrintf16
- llrintl
- llround
- llroundbf16
- llroundf
- llroundf128
- llroundf16
- llroundl
- lrint
- lrintbf16
- lrintf
- lrintf128
- lrintf16
- lrintl
- lround
- lroundbf16
- lroundf
- lroundf128
- lroundf16
- lroundl
---
Patch is 100.92 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/195441.diff
79 Files Affected:
- (modified) libc/shared/math.h (+24)
- (added) libc/shared/math/llrint.h (+23)
- (added) libc/shared/math/llrintbf16.h (+23)
- (added) libc/shared/math/llrintf.h (+23)
- (added) libc/shared/math/llrintf128.h (+29)
- (added) libc/shared/math/llrintf16.h (+29)
- (added) libc/shared/math/llrintl.h (+23)
- (added) libc/shared/math/llround.h (+23)
- (added) libc/shared/math/llroundbf16.h (+23)
- (added) libc/shared/math/llroundf.h (+23)
- (added) libc/shared/math/llroundf128.h (+29)
- (added) libc/shared/math/llroundf16.h (+29)
- (added) libc/shared/math/llroundl.h (+23)
- (added) libc/shared/math/lrint.h (+23)
- (added) libc/shared/math/lrintbf16.h (+23)
- (added) libc/shared/math/lrintf.h (+23)
- (added) libc/shared/math/lrintf128.h (+29)
- (added) libc/shared/math/lrintf16.h (+29)
- (added) libc/shared/math/lrintl.h (+23)
- (added) libc/shared/math/lround.h (+23)
- (added) libc/shared/math/lroundbf16.h (+23)
- (added) libc/shared/math/lroundf.h (+23)
- (added) libc/shared/math/lroundf128.h (+29)
- (added) libc/shared/math/lroundf16.h (+29)
- (added) libc/shared/math/lroundl.h (+23)
- (modified) libc/src/__support/math/CMakeLists.txt (+227)
- (added) libc/src/__support/math/llrint.h (+27)
- (added) libc/src/__support/math/llrintbf16.h (+28)
- (added) libc/src/__support/math/llrintf.h (+27)
- (added) libc/src/__support/math/llrintf128.h (+33)
- (added) libc/src/__support/math/llrintf16.h (+33)
- (added) libc/src/__support/math/llrintl.h (+26)
- (added) libc/src/__support/math/llround.h (+25)
- (added) libc/src/__support/math/llroundbf16.h (+26)
- (added) libc/src/__support/math/llroundf.h (+25)
- (added) libc/src/__support/math/llroundf128.h (+31)
- (added) libc/src/__support/math/llroundf16.h (+31)
- (added) libc/src/__support/math/llroundl.h (+25)
- (added) libc/src/__support/math/lrint.h (+26)
- (added) libc/src/__support/math/lrintbf16.h (+27)
- (added) libc/src/__support/math/lrintf.h (+26)
- (added) libc/src/__support/math/lrintf128.h (+32)
- (added) libc/src/__support/math/lrintf16.h (+32)
- (added) libc/src/__support/math/lrintl.h (+26)
- (added) libc/src/__support/math/lround.h (+25)
- (added) libc/src/__support/math/lroundbf16.h (+26)
- (added) libc/src/__support/math/lroundf.h (+25)
- (added) libc/src/__support/math/lroundf128.h (+31)
- (added) libc/src/__support/math/lroundf16.h (+31)
- (added) libc/src/__support/math/lroundl.h (+25)
- (modified) libc/src/math/generic/CMakeLists.txt (+24-42)
- (modified) libc/src/math/generic/llrint.cpp (+2-8)
- (modified) libc/src/math/generic/llrintbf16.cpp (+2-7)
- (modified) libc/src/math/generic/llrintf.cpp (+2-8)
- (modified) libc/src/math/generic/llrintf128.cpp (+2-6)
- (modified) libc/src/math/generic/llrintf16.cpp (+2-6)
- (modified) libc/src/math/generic/llrintl.cpp (+2-5)
- (modified) libc/src/math/generic/llround.cpp (+2-6)
- (modified) libc/src/math/generic/llroundbf16.cpp (+2-5)
- (modified) libc/src/math/generic/llroundf.cpp (+2-6)
- (modified) libc/src/math/generic/llroundf128.cpp (+2-4)
- (modified) libc/src/math/generic/llroundf16.cpp (+2-4)
- (modified) libc/src/math/generic/llroundl.cpp (+2-4)
- (modified) libc/src/math/generic/lrint.cpp (+2-7)
- (modified) libc/src/math/generic/lrintbf16.cpp (+2-8)
- (modified) libc/src/math/generic/lrintf.cpp (+2-7)
- (modified) libc/src/math/generic/lrintf128.cpp (+2-7)
- (modified) libc/src/math/generic/lrintf16.cpp (+2-7)
- (modified) libc/src/math/generic/lrintl.cpp (+2-7)
- (modified) libc/src/math/generic/lround.cpp (+2-6)
- (modified) libc/src/math/generic/lroundbf16.cpp (+2-5)
- (modified) libc/src/math/generic/lroundf.cpp (+2-6)
- (modified) libc/src/math/generic/lroundf128.cpp (+2-4)
- (modified) libc/src/math/generic/lroundf16.cpp (+2-6)
- (modified) libc/src/math/generic/lroundl.cpp (+2-6)
- (modified) libc/test/shared/CMakeLists.txt (+48)
- (modified) libc/test/shared/shared_math_constexpr_test.cpp (+25)
- (modified) libc/test/shared/shared_math_test.cpp (+25)
- (modified) utils/bazel/llvm-project-overlay/libc/BUILD.bazel (+351-12)
``````````diff
diff --git a/libc/shared/math.h b/libc/shared/math.h
index 4cd943a2435f2..ec1cfba7c0834 100644
--- a/libc/shared/math.h
+++ b/libc/shared/math.h
@@ -293,6 +293,18 @@
#include "math/llogbf128.h"
#include "math/llogbf16.h"
#include "math/llogbl.h"
+#include "math/llrint.h"
+#include "math/llrintbf16.h"
+#include "math/llrintf.h"
+#include "math/llrintf128.h"
+#include "math/llrintf16.h"
+#include "math/llrintl.h"
+#include "math/llround.h"
+#include "math/llroundbf16.h"
+#include "math/llroundf.h"
+#include "math/llroundf128.h"
+#include "math/llroundf16.h"
+#include "math/llroundl.h"
#include "math/log.h"
#include "math/log10.h"
#include "math/log10f.h"
@@ -313,6 +325,18 @@
#include "math/logbl.h"
#include "math/logf.h"
#include "math/logf16.h"
+#include "math/lrint.h"
+#include "math/lrintbf16.h"
+#include "math/lrintf.h"
+#include "math/lrintf128.h"
+#include "math/lrintf16.h"
+#include "math/lrintl.h"
+#include "math/lround.h"
+#include "math/lroundbf16.h"
+#include "math/lroundf.h"
+#include "math/lroundf128.h"
+#include "math/lroundf16.h"
+#include "math/lroundl.h"
#include "math/modf.h"
#include "math/modfbf16.h"
#include "math/modff.h"
diff --git a/libc/shared/math/llrint.h b/libc/shared/math/llrint.h
new file mode 100644
index 0000000000000..b61f670821df3
--- /dev/null
+++ b/libc/shared/math/llrint.h
@@ -0,0 +1,23 @@
+//===-- Shared llrint function ----------------------------------*- 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_SHARED_MATH_LLRINT_H
+#define LLVM_LIBC_SHARED_MATH_LLRINT_H
+
+#include "shared/libc_common.h"
+#include "src/__support/math/llrint.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::llrint;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SHARED_MATH_LLRINT_H
diff --git a/libc/shared/math/llrintbf16.h b/libc/shared/math/llrintbf16.h
new file mode 100644
index 0000000000000..ea51cd2dd2dbb
--- /dev/null
+++ b/libc/shared/math/llrintbf16.h
@@ -0,0 +1,23 @@
+//===-- Shared llrintbf16 function ------------------------------*- 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_SHARED_MATH_LLRINTBF16_H
+#define LLVM_LIBC_SHARED_MATH_LLRINTBF16_H
+
+#include "shared/libc_common.h"
+#include "src/__support/math/llrintbf16.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::llrintbf16;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SHARED_MATH_LLRINTBF16_H
diff --git a/libc/shared/math/llrintf.h b/libc/shared/math/llrintf.h
new file mode 100644
index 0000000000000..645d2cb2e53bc
--- /dev/null
+++ b/libc/shared/math/llrintf.h
@@ -0,0 +1,23 @@
+//===-- Shared llrintf function ---------------------------------*- 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_SHARED_MATH_LLRINTF_H
+#define LLVM_LIBC_SHARED_MATH_LLRINTF_H
+
+#include "shared/libc_common.h"
+#include "src/__support/math/llrintf.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::llrintf;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SHARED_MATH_LLRINTF_H
diff --git a/libc/shared/math/llrintf128.h b/libc/shared/math/llrintf128.h
new file mode 100644
index 0000000000000..02e4edc23573e
--- /dev/null
+++ b/libc/shared/math/llrintf128.h
@@ -0,0 +1,29 @@
+//===-- Shared llrintf128 function ------------------------------*- 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_SHARED_MATH_LLRINTF128_H
+#define LLVM_LIBC_SHARED_MATH_LLRINTF128_H
+
+#include "include/llvm-libc-types/float128.h"
+
+#ifdef LIBC_TYPES_HAS_FLOAT128
+
+#include "shared/libc_common.h"
+#include "src/__support/math/llrintf128.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::llrintf128;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LIBC_TYPES_HAS_FLOAT128
+
+#endif // LLVM_LIBC_SHARED_MATH_LLRINTF128_H
diff --git a/libc/shared/math/llrintf16.h b/libc/shared/math/llrintf16.h
new file mode 100644
index 0000000000000..cde6ac42dde8c
--- /dev/null
+++ b/libc/shared/math/llrintf16.h
@@ -0,0 +1,29 @@
+//===-- Shared llrintf16 function -------------------------------*- 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_SHARED_MATH_LLRINTF16_H
+#define LLVM_LIBC_SHARED_MATH_LLRINTF16_H
+
+#include "include/llvm-libc-macros/float16-macros.h"
+
+#ifdef LIBC_TYPES_HAS_FLOAT16
+
+#include "shared/libc_common.h"
+#include "src/__support/math/llrintf16.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::llrintf16;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LIBC_TYPES_HAS_FLOAT16
+
+#endif // LLVM_LIBC_SHARED_MATH_LLRINTF16_H
diff --git a/libc/shared/math/llrintl.h b/libc/shared/math/llrintl.h
new file mode 100644
index 0000000000000..a2f8721b4b556
--- /dev/null
+++ b/libc/shared/math/llrintl.h
@@ -0,0 +1,23 @@
+//===-- Shared llrintl function ---------------------------------*- 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_SHARED_MATH_LLRINTL_H
+#define LLVM_LIBC_SHARED_MATH_LLRINTL_H
+
+#include "shared/libc_common.h"
+#include "src/__support/math/llrintl.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::llrintl;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SHARED_MATH_LLRINTL_H
diff --git a/libc/shared/math/llround.h b/libc/shared/math/llround.h
new file mode 100644
index 0000000000000..5d6301b68e4cd
--- /dev/null
+++ b/libc/shared/math/llround.h
@@ -0,0 +1,23 @@
+//===-- Shared llround function ---------------------------------*- 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_SHARED_MATH_LLROUND_H
+#define LLVM_LIBC_SHARED_MATH_LLROUND_H
+
+#include "shared/libc_common.h"
+#include "src/__support/math/llround.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::llround;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SHARED_MATH_LLROUND_H
diff --git a/libc/shared/math/llroundbf16.h b/libc/shared/math/llroundbf16.h
new file mode 100644
index 0000000000000..2466845eb58b2
--- /dev/null
+++ b/libc/shared/math/llroundbf16.h
@@ -0,0 +1,23 @@
+//===-- Shared llroundbf16 function -----------------------------*- 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_SHARED_MATH_LLROUNDBF16_H
+#define LLVM_LIBC_SHARED_MATH_LLROUNDBF16_H
+
+#include "shared/libc_common.h"
+#include "src/__support/math/llroundbf16.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::llroundbf16;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SHARED_MATH_LLROUNDBF16_H
diff --git a/libc/shared/math/llroundf.h b/libc/shared/math/llroundf.h
new file mode 100644
index 0000000000000..c851b7817cca8
--- /dev/null
+++ b/libc/shared/math/llroundf.h
@@ -0,0 +1,23 @@
+//===-- Shared llroundf function --------------------------------*- 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_SHARED_MATH_LLROUNDF_H
+#define LLVM_LIBC_SHARED_MATH_LLROUNDF_H
+
+#include "shared/libc_common.h"
+#include "src/__support/math/llroundf.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::llroundf;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SHARED_MATH_LLROUNDF_H
diff --git a/libc/shared/math/llroundf128.h b/libc/shared/math/llroundf128.h
new file mode 100644
index 0000000000000..7e4654c4ff5c7
--- /dev/null
+++ b/libc/shared/math/llroundf128.h
@@ -0,0 +1,29 @@
+//===-- Shared llroundf128 function -----------------------------*- 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_SHARED_MATH_LLROUNDF128_H
+#define LLVM_LIBC_SHARED_MATH_LLROUNDF128_H
+
+#include "include/llvm-libc-types/float128.h"
+
+#ifdef LIBC_TYPES_HAS_FLOAT128
+
+#include "shared/libc_common.h"
+#include "src/__support/math/llroundf128.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::llroundf128;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LIBC_TYPES_HAS_FLOAT128
+
+#endif // LLVM_LIBC_SHARED_MATH_LLROUNDF128_H
diff --git a/libc/shared/math/llroundf16.h b/libc/shared/math/llroundf16.h
new file mode 100644
index 0000000000000..2f3c629c8d1c2
--- /dev/null
+++ b/libc/shared/math/llroundf16.h
@@ -0,0 +1,29 @@
+//===-- Shared llroundf16 function ------------------------------*- 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_SHARED_MATH_LLROUNDF16_H
+#define LLVM_LIBC_SHARED_MATH_LLROUNDF16_H
+
+#include "include/llvm-libc-macros/float16-macros.h"
+
+#ifdef LIBC_TYPES_HAS_FLOAT16
+
+#include "shared/libc_common.h"
+#include "src/__support/math/llroundf16.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::llroundf16;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LIBC_TYPES_HAS_FLOAT16
+
+#endif // LLVM_LIBC_SHARED_MATH_LLROUNDF16_H
diff --git a/libc/shared/math/llroundl.h b/libc/shared/math/llroundl.h
new file mode 100644
index 0000000000000..5c25b00959ba4
--- /dev/null
+++ b/libc/shared/math/llroundl.h
@@ -0,0 +1,23 @@
+//===-- Shared llroundl function --------------------------------*- 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_SHARED_MATH_LLROUNDL_H
+#define LLVM_LIBC_SHARED_MATH_LLROUNDL_H
+
+#include "shared/libc_common.h"
+#include "src/__support/math/llroundl.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::llroundl;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SHARED_MATH_LLROUNDL_H
diff --git a/libc/shared/math/lrint.h b/libc/shared/math/lrint.h
new file mode 100644
index 0000000000000..8623a2fd170f7
--- /dev/null
+++ b/libc/shared/math/lrint.h
@@ -0,0 +1,23 @@
+//===-- Shared lrint function -----------------------------------*- 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_SHARED_MATH_LRINT_H
+#define LLVM_LIBC_SHARED_MATH_LRINT_H
+
+#include "shared/libc_common.h"
+#include "src/__support/math/lrint.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::lrint;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SHARED_MATH_LRINT_H
diff --git a/libc/shared/math/lrintbf16.h b/libc/shared/math/lrintbf16.h
new file mode 100644
index 0000000000000..d4fd53bea872b
--- /dev/null
+++ b/libc/shared/math/lrintbf16.h
@@ -0,0 +1,23 @@
+//===-- Shared lrintbf16 function -------------------------------*- 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_SHARED_MATH_LRINTBF16_H
+#define LLVM_LIBC_SHARED_MATH_LRINTBF16_H
+
+#include "shared/libc_common.h"
+#include "src/__support/math/lrintbf16.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::lrintbf16;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SHARED_MATH_LRINTBF16_H
diff --git a/libc/shared/math/lrintf.h b/libc/shared/math/lrintf.h
new file mode 100644
index 0000000000000..e3066f3b098bb
--- /dev/null
+++ b/libc/shared/math/lrintf.h
@@ -0,0 +1,23 @@
+//===-- Shared lrintf function ----------------------------------*- 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_SHARED_MATH_LRINTF_H
+#define LLVM_LIBC_SHARED_MATH_LRINTF_H
+
+#include "shared/libc_common.h"
+#include "src/__support/math/lrintf.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::lrintf;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SHARED_MATH_LRINTF_H
diff --git a/libc/shared/math/lrintf128.h b/libc/shared/math/lrintf128.h
new file mode 100644
index 0000000000000..86fc0b3b081b9
--- /dev/null
+++ b/libc/shared/math/lrintf128.h
@@ -0,0 +1,29 @@
+//===-- Shared lrintf128 function -------------------------------*- 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_SHARED_MATH_LRINTF128_H
+#define LLVM_LIBC_SHARED_MATH_LRINTF128_H
+
+#include "include/llvm-libc-types/float128.h"
+
+#ifdef LIBC_TYPES_HAS_FLOAT128
+
+#include "shared/libc_common.h"
+#include "src/__support/math/lrintf128.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::lrintf128;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LIBC_TYPES_HAS_FLOAT128
+
+#endif // LLVM_LIBC_SHARED_MATH_LRINTF128_H
diff --git a/libc/shared/math/lrintf16.h b/libc/shared/math/lrintf16.h
new file mode 100644
index 0000000000000..494774a7e7f41
--- /dev/null
+++ b/libc/shared/math/lrintf16.h
@@ -0,0 +1,29 @@
+//===-- Shared lrintf16 function --------------------------------*- 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_SHARED_MATH_LRINTF16_H
+#define LLVM_LIBC_SHARED_MATH_LRINTF16_H
+
+#include "include/llvm-libc-macros/float16-macros.h"
+
+#ifdef LIBC_TYPES_HAS_FLOAT16
+
+#include "shared/libc_common.h"
+#include "src/__support/math/lrintf16.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::lrintf16;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LIBC_TYPES_HAS_FLOAT16
+
+#endif // LLVM_LIBC_SHARED_MATH_LRINTF16_H
diff --git a/libc/shared/math/lrintl.h b/libc/shared/math/lrintl.h
new file mode 100644
index 0000000000000..7fe880e16912b
--- /dev/null
+++ b/libc/shared/math/lrintl.h
@@ -0,0 +1,23 @@
+//===-- Shared lrintl function ----------------------------------*- 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_SHARED_MATH_LRINTL_H
+#define LLVM_LIBC_SHARED_MATH_LRINTL_H
+
+#include "shared/libc_common.h"
+#include "src/__support/math/lrintl.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::lrintl;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SHARED_MATH_LRINTL_H
diff --git a/libc/shared/math/lround.h b/libc/shared/math/lround.h
new file mode 100644
index 0000000000000..0e312840fe7d5
--- /dev/null
+++ b/libc/shared/math/lround.h
@@ -0,0 +1,23 @@
+//===-- Shared lround function ----------------------------------*- 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_SHARED_MATH_LROUND_H
+#define LLVM_LIBC_SHARED_MATH_LROUND_H
+
+#include "shared/libc_common.h"
+#include "src/__support/math/lround.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::lround;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SHARED_MATH_LROUND_H
diff --git a/libc/shared/math/lroundbf16.h b/libc/shared/math/lroundbf16.h
new file mode 100644
index 0000000000000..9635e9ab1383f
--- /dev/null
+++ b/libc/shared/math/lroundbf16.h
@@ -0,0 +1,23 @@
+//===-- Shared lroundbf16 function ------------------------------*- 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_SHARED_MATH_LROUNDBF16_H
+#define LLVM_LIBC_SHARED_MATH_LROUNDBF16_H
+
+#include "shared/libc_common.h"
+#include "src/__support/math/lroundbf16.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::lroundbf16;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SHARED_MATH_LROUNDBF16_H
diff --git a/libc/shared/math/lroundf.h b/libc/shared/math/lroundf.h
new file mode 100644
index 0000000000000..0ae27220f668e
--- /dev/null
+++ b/libc/shared/math/lroundf.h
@@ -0,0 +1,23 @@
...
[truncated]
``````````
</details>
https://github.com/llvm/llvm-project/pull/195441
More information about the libc-commits
mailing list