Skip to content

[libc][math][c23] Add linux/* entrypoints for nextup* and nextdown* #85803

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

overmighty
Copy link
Member

See #85484 (comment).

There already were entrypoints for linux/x86_64. I haven't tested on the other targets and will rely on the buildbots.

cc @lntue

@llvmbot llvmbot added the libc label Mar 19, 2024
@llvmbot
Copy link
Member

llvmbot commented Mar 19, 2024

@llvm/pr-subscribers-libc

Author: OverMighty (overmighty)

Changes

See #85484 (comment).

There already were entrypoints for linux/x86_64. I haven't tested on the other targets and will rely on the buildbots.

cc @lntue


Full diff: https://github.com/llvm/llvm-project/pull/85803.diff

5 Files Affected:

  • (modified) libc/config/linux/aarch64/entrypoints.txt (+8)
  • (modified) libc/config/linux/arm/entrypoints.txt (+6)
  • (modified) libc/config/linux/riscv/entrypoints.txt (+8)
  • (modified) libc/config/linux/x86_64/entrypoints.txt (+3-3)
  • (modified) libc/docs/math/index.rst (+8-8)
diff --git a/libc/config/linux/aarch64/entrypoints.txt b/libc/config/linux/aarch64/entrypoints.txt
index 58502e4ec1c660..dbf81c284e7845 100644
--- a/libc/config/linux/aarch64/entrypoints.txt
+++ b/libc/config/linux/aarch64/entrypoints.txt
@@ -417,9 +417,15 @@ set(TARGET_LIBM_ENTRYPOINTS
     libc.src.math.nextafter
     libc.src.math.nextafterf
     libc.src.math.nextafterl
+    libc.src.math.nextdown
+    libc.src.math.nextdownf
+    libc.src.math.nextdownl
     libc.src.math.nexttoward
     libc.src.math.nexttowardf
     libc.src.math.nexttowardl
+    libc.src.math.nextup
+    libc.src.math.nextupf
+    libc.src.math.nextupl
     libc.src.math.powf
     libc.src.math.remainderf
     libc.src.math.remainder
@@ -472,6 +478,8 @@ if(LIBC_TYPES_HAS_FLOAT128)
     libc.src.math.modff128
     libc.src.math.nanf128
     libc.src.math.nextafterf128
+    libc.src.math.nextdownf128
+    libc.src.math.nextupf128
     libc.src.math.rintf128
     libc.src.math.roundf128
     libc.src.math.sqrtf128
diff --git a/libc/config/linux/arm/entrypoints.txt b/libc/config/linux/arm/entrypoints.txt
index bf1559b2f02369..3bc5d8efc9d26b 100644
--- a/libc/config/linux/arm/entrypoints.txt
+++ b/libc/config/linux/arm/entrypoints.txt
@@ -285,9 +285,15 @@ set(TARGET_LIBM_ENTRYPOINTS
     libc.src.math.nextafter
     libc.src.math.nextafterf
     libc.src.math.nextafterl
+    libc.src.math.nextdown
+    libc.src.math.nextdownf
+    libc.src.math.nextdownl
     libc.src.math.nexttoward
     libc.src.math.nexttowardf
     libc.src.math.nexttowardl
+    libc.src.math.nextup
+    libc.src.math.nextupf
+    libc.src.math.nextupl
     libc.src.math.powf
     libc.src.math.remainder
     libc.src.math.remainderf
diff --git a/libc/config/linux/riscv/entrypoints.txt b/libc/config/linux/riscv/entrypoints.txt
index d789f03fedc419..b42a55a4d712e1 100644
--- a/libc/config/linux/riscv/entrypoints.txt
+++ b/libc/config/linux/riscv/entrypoints.txt
@@ -425,9 +425,15 @@ set(TARGET_LIBM_ENTRYPOINTS
     libc.src.math.nextafter
     libc.src.math.nextafterf
     libc.src.math.nextafterl
+    libc.src.math.nextdown
+    libc.src.math.nextdownf
+    libc.src.math.nextdownl
     libc.src.math.nexttoward
     libc.src.math.nexttowardf
     libc.src.math.nexttowardl
+    libc.src.math.nextup
+    libc.src.math.nextupf
+    libc.src.math.nextupl
     libc.src.math.powf
     libc.src.math.remainderf
     libc.src.math.remainder
@@ -480,6 +486,8 @@ if(LIBC_TYPES_HAS_FLOAT128)
     libc.src.math.modff128
     libc.src.math.nanf128
     libc.src.math.nextafterf128
+    libc.src.math.nextdownf128
+    libc.src.math.nextupf128
     libc.src.math.rintf128
     libc.src.math.roundf128
     libc.src.math.sqrtf128
diff --git a/libc/config/linux/x86_64/entrypoints.txt b/libc/config/linux/x86_64/entrypoints.txt
index f81d334e9e788d..e8cf11266624a7 100644
--- a/libc/config/linux/x86_64/entrypoints.txt
+++ b/libc/config/linux/x86_64/entrypoints.txt
@@ -429,12 +429,12 @@ set(TARGET_LIBM_ENTRYPOINTS
     libc.src.math.nextafter
     libc.src.math.nextafterf
     libc.src.math.nextafterl
-    libc.src.math.nexttoward
-    libc.src.math.nexttowardf
-    libc.src.math.nexttowardl
     libc.src.math.nextdown
     libc.src.math.nextdownf
     libc.src.math.nextdownl
+    libc.src.math.nexttoward
+    libc.src.math.nexttowardf
+    libc.src.math.nexttowardl
     libc.src.math.nextup
     libc.src.math.nextupf
     libc.src.math.nextupl
diff --git a/libc/docs/math/index.rst b/libc/docs/math/index.rst
index dbcffc1432e8b7..d337d060fb5dd9 100644
--- a/libc/docs/math/index.rst
+++ b/libc/docs/math/index.rst
@@ -275,13 +275,13 @@ Basic Operations
 +--------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
 | nextafterf128| |check| | |check| |         | |check| |         |         |         |         |         |         |         |         |
 +--------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| nextdown     | |check| |         |         |         |         |         |         |         |         |         |         |         |
+| nextdown     | |check| | |check| | |check| | |check| |         |         |         |         |         |         |         |         |
 +--------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| nextdownf    | |check| |         |         |         |         |         |         |         |         |         |         |         |
+| nextdownf    | |check| | |check| | |check| | |check| |         |         |         |         |         |         |         |         |
 +--------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| nextdownl    | |check| |         |         |         |         |         |         |         |         |         |         |         |
+| nextdownl    | |check| | |check| | |check| | |check| |         |         |         |         |         |         |         |         |
 +--------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| nextdownf128 | |check| |         |         |         |         |         |         |         |         |         |         |         |
+| nextdownf128 | |check| | |check| |         | |check| |         |         |         |         |         |         |         |         |
 +--------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
 | nexttoward   | |check| | |check| | |check| | |check| | |check| |         |         | |check| | |check| | |check| |         |         |
 +--------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
@@ -289,13 +289,13 @@ Basic Operations
 +--------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
 | nexttowardl  | |check| | |check| | |check| | |check| | |check| |         |         | |check| | |check| | |check| |         |         |
 +--------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| nextup       | |check| |         |         |         |         |         |         |         |         |         |         |         |
+| nextup       | |check| | |check| | |check| | |check| |         |         |         |         |         |         |         |         |
 +--------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| nextupf      | |check| |         |         |         |         |         |         |         |         |         |         |         |
+| nextupf      | |check| | |check| | |check| | |check| |         |         |         |         |         |         |         |         |
 +--------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| nextupl      | |check| |         |         |         |         |         |         |         |         |         |         |         |
+| nextupl      | |check| | |check| | |check| | |check| |         |         |         |         |         |         |         |         |
 +--------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| nextupf128   | |check| |         |         |         |         |         |         |         |         |         |         |         |
+| nextupf128   | |check| | |check| |         | |check| |         |         |         |         |         |         |         |         |
 +--------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
 | remainder    | |check| | |check| | |check| | |check| | |check| |         |         | |check| | |check| | |check| |         |         |
 +--------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+

Comment on lines -432 to +437
libc.src.math.nexttoward
libc.src.math.nexttowardf
libc.src.math.nexttowardl
libc.src.math.nextdown
libc.src.math.nextdownf
libc.src.math.nextdownl
libc.src.math.nexttoward
libc.src.math.nexttowardf
libc.src.math.nexttowardl
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just reordered the existing entrypoints for linux/x86_64 here to keep them sorted.

Copy link
Member

@nickdesaulniers nickdesaulniers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the patch!

@overmighty
Copy link
Member Author

There already were entrypoints for linux/x86_64.

Maybe this would have been worth to add in the commit message. I first thought of naming the commit [libc][math][c23] Add linux/{aarch64,arm,riscv} entrypoints for nextup* and nextdown* but it seemed a bit too long (85 chars).

@nickdesaulniers nickdesaulniers merged commit 85b6af1 into llvm:main Mar 19, 2024
chencha3 pushed a commit to chencha3/llvm-project that referenced this pull request Mar 23, 2024
…lvm#85803)

See
llvm#85484 (comment).

There already were entrypoints for linux/x86_64. I haven't tested on the other
targets and will rely on the buildbots.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants