[libc-commits] [PATCH] D131023: [libc] add printf decimal float conversion

Michael Jones via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue Aug 2 14:36:24 PDT 2022


michaelrj created this revision.
michaelrj added reviewers: sivachandra, lntue.
Herald added subscribers: libc-commits, ecnelises, tschuett, mgorny.
Herald added projects: libc-project, All.
michaelrj requested review of this revision.

This patch adds support for converting doubles to string in the %f/F
format specifier. It does not yet support long doubles outside of the
double range. This implementation is based on the work of Ulf Adams,
specifically the Ryu Printf algorithm.

See:
Ulf Adams. 2019. Ryƫ revisited: printf floating point conversion.
Proc. ACM Program. Lang. 3, OOPSLA, Article 169 (October 2019), 23 pages.
https://doi.org/10.1145/3360595


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D131023

Files:
  libc/src/stdio/printf_core/CMakeLists.txt
  libc/src/stdio/printf_core/converter.cpp
  libc/src/stdio/printf_core/converter_atlas.h
  libc/src/stdio/printf_core/float_dec_converter.h
  libc/src/stdio/printf_core/ryu_constants.h
  libc/test/src/stdio/sprintf_test.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131023.449445.patch
Type: text/x-patch
Size: 311483 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20220802/972ad74d/attachment-0001.bin>


More information about the libc-commits mailing list