Skip to content
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

Any plan for libc++ to support std::from_chars for floating points? #92711

Closed
Extra-Creativity opened this issue May 20, 2024 · 4 comments
Closed
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. question A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!

Comments

@Extra-Creativity
Copy link

It may be frustrating to know c++17 feature isn't supported in the latest libc++ yet.

GCC 12 has partially adopted https://github.com/fastfloat/fast_float as its library implementation, is it possibly proper to adopt it in libc++?

@github-actions github-actions bot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label May 20, 2024
@mordante mordante added the question A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead! label May 20, 2024
@mordante
Copy link
Member

I understand it's frustrating. However this feature is a lot of work even adapting an existing algorithm requires quite a bit of effort. Thusfar nobody has volunteered to do the work.

There is this WIP PR #91651 to use LLVM's libc implementation. I don't know which algorithm they use. IIRC it's one Lemire worked on so it might be fast float.

Since we don't use bugs to track missing parts of our implementation I'm closing the issue.

@Extra-Creativity
Copy link
Author

I really appreciate volunteers' efforts. The mentioned PR seems not complete yet (not having error handling), but I believe this will be solved in the near future. Great thanks to you all.

@mordante
Copy link
Member

I really appreciate volunteers' efforts.

Thanks!

The mentioned PR seems not complete yet (not having error handling), but I believe this will be solved in the near future. Great thanks to you all.

That PR indeed not complete and it may take some time. It is the first time libc++ and libc are sharing code. So we're also looking how to do that.

@michaelrj-google
Copy link
Contributor

Hi! I'm still working on the proof of concept PR (I want to make sure all the tests pass) but I am hopeful that it's going to lead to a finished implementation before the end of the year. As for the algorithm it uses, it is primarily the one that Lemire worked on, I gave a talk on exactly how it works at the 2022 dev conference: https://www.youtube.com/watch?v=s-UjbTV8p6g

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. question A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!
Projects
None yet
Development

No branches or pull requests

3 participants