[libc-commits] [libc] [libc][GPU] Use generic implementation for remainder in GPU libc (PR #241657)
via libc-commits
libc-commits at lists.llvm.org
Wed Nov 11 20:21:35 PST 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-backend-nvptx
Author: jinge90
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/241657.diff
6 Files Affected:
- (modified) libc/src/math/amdgpu/CMakeLists.txt (-16)
- (removed) libc/src/math/amdgpu/remainder.cpp (-19)
- (removed) libc/src/math/amdgpu/remainderf.cpp (-19)
- (modified) libc/src/math/nvptx/CMakeLists.txt (-16)
- (removed) libc/src/math/nvptx/remainder.cpp (-19)
- (removed) libc/src/math/nvptx/remainderf.cpp (-19)
``````````diff
diff --git a/libc/src/math/amdgpu/CMakeLists.txt b/libc/src/math/amdgpu/CMakeLists.txt
index d05d519b74b4fe..f6edab862728cb 100644
--- a/libc/src/math/amdgpu/CMakeLists.txt
+++ b/libc/src/math/amdgpu/CMakeLists.txt
@@ -142,22 +142,6 @@ add_entrypoint_object(
../nearbyintf.h
)
-add_entrypoint_object(
- remainder
- SRCS
- remainder.cpp
- HDRS
- ../remainder.h
-)
-
-add_entrypoint_object(
- remainderf
- SRCS
- remainderf.cpp
- HDRS
- ../remainderf.h
-)
-
add_entrypoint_object(
rint
SRCS
diff --git a/libc/src/math/amdgpu/remainder.cpp b/libc/src/math/amdgpu/remainder.cpp
deleted file mode 100644
index 9027204312e009..00000000000000
--- a/libc/src/math/amdgpu/remainder.cpp
+++ /dev/null
@@ -1,19 +0,0 @@
-//===-- Implementation of the GPU remainder 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/remainder.h"
-#include "src/__support/common.h"
-#include "src/__support/macros/config.h"
-
-namespace LIBC_NAMESPACE_DECL {
-
-LLVM_LIBC_FUNCTION(double, remainder, (double x, double y)) {
- return __builtin_remainder(x, y);
-}
-
-} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/math/amdgpu/remainderf.cpp b/libc/src/math/amdgpu/remainderf.cpp
deleted file mode 100644
index 50df3b2ce25c19..00000000000000
--- a/libc/src/math/amdgpu/remainderf.cpp
+++ /dev/null
@@ -1,19 +0,0 @@
-//===-- Implementation of the GPU remainderf 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/remainderf.h"
-#include "src/__support/common.h"
-#include "src/__support/macros/config.h"
-
-namespace LIBC_NAMESPACE_DECL {
-
-LLVM_LIBC_FUNCTION(float, remainderf, (float x, float y)) {
- return __builtin_remainderf(x, y);
-}
-
-} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/math/nvptx/CMakeLists.txt b/libc/src/math/nvptx/CMakeLists.txt
index 78797092622a3d..42159cab348f1c 100644
--- a/libc/src/math/nvptx/CMakeLists.txt
+++ b/libc/src/math/nvptx/CMakeLists.txt
@@ -126,22 +126,6 @@ add_entrypoint_object(
../nearbyintf.h
)
-add_entrypoint_object(
- remainder
- SRCS
- remainder.cpp
- HDRS
- ../remainder.h
-)
-
-add_entrypoint_object(
- remainderf
- SRCS
- remainderf.cpp
- HDRS
- ../remainderf.h
-)
-
add_entrypoint_object(
rint
SRCS
diff --git a/libc/src/math/nvptx/remainder.cpp b/libc/src/math/nvptx/remainder.cpp
deleted file mode 100644
index 9027204312e009..00000000000000
--- a/libc/src/math/nvptx/remainder.cpp
+++ /dev/null
@@ -1,19 +0,0 @@
-//===-- Implementation of the GPU remainder 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/remainder.h"
-#include "src/__support/common.h"
-#include "src/__support/macros/config.h"
-
-namespace LIBC_NAMESPACE_DECL {
-
-LLVM_LIBC_FUNCTION(double, remainder, (double x, double y)) {
- return __builtin_remainder(x, y);
-}
-
-} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/math/nvptx/remainderf.cpp b/libc/src/math/nvptx/remainderf.cpp
deleted file mode 100644
index 50df3b2ce25c19..00000000000000
--- a/libc/src/math/nvptx/remainderf.cpp
+++ /dev/null
@@ -1,19 +0,0 @@
-//===-- Implementation of the GPU remainderf 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/remainderf.h"
-#include "src/__support/common.h"
-#include "src/__support/macros/config.h"
-
-namespace LIBC_NAMESPACE_DECL {
-
-LLVM_LIBC_FUNCTION(float, remainderf, (float x, float y)) {
- return __builtin_remainderf(x, y);
-}
-
-} // namespace LIBC_NAMESPACE_DECL
``````````
</details>
https://github.com/llvm/llvm-project/pull/241657
More information about the libc-commits
mailing list