-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[libc][math][c23] Add remaining linux/* entrypoints for {,u}fromfp{,x}* #86692
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
[libc][math][c23] Add remaining linux/* entrypoints for {,u}fromfp{,x}* #86692
Conversation
@llvm/pr-subscribers-libc Author: OverMighty (overmighty) ChangesI haven't tested on these targets and will rely on the buildbots. cc @lntue Full diff: https://github.com/llvm/llvm-project/pull/86692.diff 4 Files Affected:
diff --git a/libc/config/linux/aarch64/entrypoints.txt b/libc/config/linux/aarch64/entrypoints.txt
index 78da7f0b334b1f..ab0be7e35dced2 100644
--- a/libc/config/linux/aarch64/entrypoints.txt
+++ b/libc/config/linux/aarch64/entrypoints.txt
@@ -396,6 +396,12 @@ set(TARGET_LIBM_ENTRYPOINTS
libc.src.math.frexp
libc.src.math.frexpf
libc.src.math.frexpl
+ libc.src.math.fromfp
+ libc.src.math.fromfpf
+ libc.src.math.fromfpl
+ libc.src.math.fromfpx
+ libc.src.math.fromfpxf
+ libc.src.math.fromfpxl
libc.src.math.hypot
libc.src.math.hypotf
libc.src.math.ilogb
@@ -478,6 +484,12 @@ set(TARGET_LIBM_ENTRYPOINTS
libc.src.math.trunc
libc.src.math.truncf
libc.src.math.truncl
+ libc.src.math.ufromfp
+ libc.src.math.ufromfpf
+ libc.src.math.ufromfpl
+ libc.src.math.ufromfpx
+ libc.src.math.ufromfpxf
+ libc.src.math.ufromfpxl
)
if(LIBC_TYPES_HAS_FLOAT128)
@@ -500,6 +512,8 @@ if(LIBC_TYPES_HAS_FLOAT128)
libc.src.math.fminimum_mag_numf128
libc.src.math.fmodf128
libc.src.math.frexpf128
+ libc.src.math.fromfpf128
+ libc.src.math.fromfpxf128
libc.src.math.ilogbf128
libc.src.math.ldexpf128
libc.src.math.llogbf128
@@ -517,6 +531,8 @@ if(LIBC_TYPES_HAS_FLOAT128)
libc.src.math.roundf128
libc.src.math.sqrtf128
libc.src.math.truncf128
+ libc.src.math.ufromfpf128
+ libc.src.math.ufromfpxf128
)
endif()
diff --git a/libc/config/linux/arm/entrypoints.txt b/libc/config/linux/arm/entrypoints.txt
index 6e63e270280e7a..1d9d5ed67200c1 100644
--- a/libc/config/linux/arm/entrypoints.txt
+++ b/libc/config/linux/arm/entrypoints.txt
@@ -263,6 +263,12 @@ set(TARGET_LIBM_ENTRYPOINTS
libc.src.math.frexp
libc.src.math.frexpf
libc.src.math.frexpl
+ libc.src.math.fromfp
+ libc.src.math.fromfpf
+ libc.src.math.fromfpl
+ libc.src.math.fromfpx
+ libc.src.math.fromfpxf
+ libc.src.math.fromfpxl
libc.src.math.hypot
libc.src.math.hypotf
libc.src.math.ilogb
@@ -345,6 +351,12 @@ set(TARGET_LIBM_ENTRYPOINTS
libc.src.math.trunc
libc.src.math.truncf
libc.src.math.truncl
+ libc.src.math.ufromfp
+ libc.src.math.ufromfpf
+ libc.src.math.ufromfpl
+ libc.src.math.ufromfpx
+ libc.src.math.ufromfpxf
+ libc.src.math.ufromfpxl
)
set(TARGET_LLVMLIBC_ENTRYPOINTS
diff --git a/libc/config/linux/riscv/entrypoints.txt b/libc/config/linux/riscv/entrypoints.txt
index 5aae4e246cfb3c..96acd999efda4d 100644
--- a/libc/config/linux/riscv/entrypoints.txt
+++ b/libc/config/linux/riscv/entrypoints.txt
@@ -404,6 +404,12 @@ set(TARGET_LIBM_ENTRYPOINTS
libc.src.math.frexp
libc.src.math.frexpf
libc.src.math.frexpl
+ libc.src.math.fromfp
+ libc.src.math.fromfpf
+ libc.src.math.fromfpl
+ libc.src.math.fromfpx
+ libc.src.math.fromfpxf
+ libc.src.math.fromfpxl
libc.src.math.hypot
libc.src.math.hypotf
libc.src.math.ilogb
@@ -486,6 +492,12 @@ set(TARGET_LIBM_ENTRYPOINTS
libc.src.math.trunc
libc.src.math.truncf
libc.src.math.truncl
+ libc.src.math.ufromfp
+ libc.src.math.ufromfpf
+ libc.src.math.ufromfpl
+ libc.src.math.ufromfpx
+ libc.src.math.ufromfpxf
+ libc.src.math.ufromfpxl
)
if(LIBC_TYPES_HAS_FLOAT128)
@@ -508,6 +520,8 @@ if(LIBC_TYPES_HAS_FLOAT128)
libc.src.math.fminimum_mag_numf128
libc.src.math.fmodf128
libc.src.math.frexpf128
+ libc.src.math.fromfpf128
+ libc.src.math.fromfpxf128
libc.src.math.ilogbf128
libc.src.math.ldexpf128
libc.src.math.llogbf128
@@ -525,6 +539,8 @@ if(LIBC_TYPES_HAS_FLOAT128)
libc.src.math.roundf128
libc.src.math.sqrtf128
libc.src.math.truncf128
+ libc.src.math.ufromfpf128
+ libc.src.math.ufromfpxf128
)
endif()
diff --git a/libc/docs/math/index.rst b/libc/docs/math/index.rst
index 080b6a4427f511..d8dee3c9061908 100644
--- a/libc/docs/math/index.rst
+++ b/libc/docs/math/index.rst
@@ -190,21 +190,21 @@ Basic Operations
+------------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
| frexpf128 | |check| | |check| | | |check| | | | | | | | | |
+------------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| fromfp | |check| | | | | | | | | | | | |
+| fromfp | |check| | |check| | |check| | |check| | | | | | | | | |
+------------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| fromfpf | |check| | | | | | | | | | | | |
+| fromfpf | |check| | |check| | |check| | |check| | | | | | | | | |
+------------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| fromfpl | |check| | | | | | | | | | | | |
+| fromfpl | |check| | |check| | |check| | |check| | | | | | | | | |
+------------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| fromfpf128 | |check| | | | | | | | | | | | |
+| fromfpf128 | |check| | |check| | | |check| | | | | | | | | |
+------------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| fromfpx | |check| | | | | | | | | | | | |
+| fromfpx | |check| | |check| | |check| | |check| | | | | | | | | |
+------------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| fromfpxf | |check| | | | | | | | | | | | |
+| fromfpxf | |check| | |check| | |check| | |check| | | | | | | | | |
+------------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| fromfpxl | |check| | | | | | | | | | | | |
+| fromfpxl | |check| | |check| | |check| | |check| | | | | | | | | |
+------------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| fromfpxf128 | |check| | | | | | | | | | | | |
+| fromfpxf128 | |check| | |check| | | |check| | | | | | | | | |
+------------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
| ilogb | |check| | |check| | |check| | |check| | |check| | | | |check| | |check| | |check| | | |
+------------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
@@ -364,21 +364,21 @@ Basic Operations
+------------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
| truncf128 | |check| | |check| | | |check| | | | | | | | | |
+------------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| ufromfp | |check| | | | | | | | | | | | |
+| ufromfp | |check| | |check| | |check| | |check| | | | | | | | | |
+------------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| ufromfpf | |check| | | | | | | | | | | | |
+| ufromfpf | |check| | |check| | |check| | |check| | | | | | | | | |
+------------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| ufromfpl | |check| | | | | | | | | | | | |
+| ufromfpl | |check| | |check| | |check| | |check| | | | | | | | | |
+------------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| ufromfpf128 | |check| | | | | | | | | | | | |
+| ufromfpf128 | |check| | |check| | | |check| | | | | | | | | |
+------------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| ufromfpx | |check| | | | | | | | | | | | |
+| ufromfpx | |check| | |check| | |check| | |check| | | | | | | | | |
+------------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| ufromfpxf | |check| | | | | | | | | | | | |
+| ufromfpxf | |check| | |check| | |check| | |check| | | | | | | | | |
+------------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| ufromfpxl | |check| | | | | | | | | | | | |
+| ufromfpxl | |check| | |check| | |check| | |check| | | | | | | | | |
+------------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| ufromfpxf128 | |check| | | | | | | | | | | | |
+| ufromfpxf128 | |check| | |check| | | |check| | | | | | | | | |
+------------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, you'll just want to keep an eye on the buildbots after this lands.
https://lab.llvm.org/buildbot/#/builders?tags=libc
In particular, the 32b arm build bot can take a couple hours to produce relevant test results. Let me know some idea of when you'd like us to merge this.
Tomorrow early in the morning in your timezone would work. |
Fail on 32-bit Arm: https://lab.llvm.org/buildbot/#/builders/229/builds/24458. |
I'm going to revert for now. |
…romfp{,x}* (#86692)" This reverts commit cd17082 because the newly added tests fail on 32b ARM. Link: #86692 Link: https://lab.llvm.org/buildbot/#/builders/229/builds/24458
I think the test failure on 32-bit Arm is caused by this line:
All 3 shifts in that function are wrong no matter the target arch, really. The test just unluckily doesn't catch this mistake on x86-64, AArch64 and RV64, because they all only use the lower 5 bits of the shift amount operand when shifting a 32-bit int, so they shift by 0 instead of 32, so the result is still 1 and not 0. ARMv7's "LSL (register)" instruction uses the lower 8 bits of the shift amount operand, so it gets caught there. I guess I should change the code to use Maybe I should also make use of the |
…,u}fromfp{,x}* (#86892) See #86692 (comment) and #86892 (comment). cc @lntue @nickdesaulniers
…fromfp{,x}* (llvm#86692)" This reverts commit 8a07167. The test failure on 32-bit Arm should have been fixed by llvm#86892.
…fromfp{,x}* (llvm#86692)" (llvm#88567) This reverts commit 8a07167. The test failure on 32-bit Arm should have been fixed by llvm#86892. cc @nickdesaulniers @lntue
I haven't tested on these targets and will rely on the buildbots.
cc @lntue