[all-commits] [llvm/llvm-project] 07c0a4: [libc] add printf decimal float conversion

michaelrj-google via All-commits all-commits at lists.llvm.org
Fri Oct 7 11:25:43 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 07c0a41b53f532902ed977589363d2ba51748e75
      https://github.com/llvm/llvm-project/commit/07c0a41b53f532902ed977589363d2ba51748e75
  Author: Michael Jones <michaelrj at google.com>
  Date:   2022-10-07 (Fri, 07 Oct 2022)

  Changed paths:
    M libc/src/__support/CMakeLists.txt
    A libc/src/__support/float_to_string.h
    A libc/src/__support/ryu_constants.h
    M libc/src/stdio/printf_core/CMakeLists.txt
    M libc/src/stdio/printf_core/converter.cpp
    M libc/src/stdio/printf_core/converter_atlas.h
    A libc/src/stdio/printf_core/float_dec_converter.h
    M libc/test/src/stdio/sprintf_test.cpp

  Log Message:
  -----------
  [libc] add printf decimal float conversion

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

Differential Revision: https://reviews.llvm.org/D131023




More information about the All-commits mailing list