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

[llvmlibc] Enable FP printf, using the new float320 code. #71

Merged
merged 1 commit into from
Feb 6, 2025

Conversation

statham-arm
Copy link
Contributor

The new option LIBC_CONF_PRINTF_FLOAT_TO_STR_USE_FLOAT320 enables a strategy for floating-point printf which is both smaller and faster than the existing USE_DYADIC_FLOAT, and much smaller than any version using a precomputed table of Ryū coefficients. I think it's reasonable to enable it in our llvm-libc builds.

Also updated the llvmlibc sample application, which was previously using a trick with lround to retrieve the first 6 digits of pi, precisely because FP printf wasn't available. Now that it is, it makes the sample program more comprehensible if we just use it!

The new option `LIBC_CONF_PRINTF_FLOAT_TO_STR_USE_FLOAT320` enables a
strategy for floating-point printf which is both smaller and faster
than the existing `USE_DYADIC_FLOAT`, and _much_ smaller than any
version using a precomputed table of Ryū coefficients. I think it's
reasonable to enable it in our llvm-libc builds.

Also updated the llvmlibc sample application, which was previously
using a trick with `lround` to retrieve the first 6 digits of pi,
precisely because FP printf wasn't available. Now that it is, it makes
the sample program more comprehensible if we just use it!
@statham-arm
Copy link
Contributor Author

This depends on llvm/llvm-project#125864 in order to build successfully, due to our -Werror settings. But they can be code-reviewed in parallel.

Copy link
Contributor

@smithp35 smithp35 left a comment

Choose a reason for hiding this comment

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

LGTM

@statham-arm statham-arm merged commit d0f16d2 into arm:arm-software Feb 6, 2025
@statham-arm statham-arm deleted the llvmlibc-fp-printf branch February 6, 2025 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants