[all-commits] [llvm/llvm-project] 62c187: [libc] add fast path to string to float conversion

michaelrj-google via All-commits all-commits at lists.llvm.org
Fri Oct 29 10:50:16 PDT 2021


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

  Changed paths:
    M libc/src/__support/str_to_float.h
    M libc/test/src/__support/str_to_float_test.cpp

  Log Message:
  -----------
  [libc] add fast path to string to float conversion

Add the fast path first described by Clinger [1] with additions by Gay [2].
This speeds up conversion by about 10% by handling numbers with fewer digits
more efficiently.

[1] Clinger WD. How to Read Floating Point Numbers Accurately.
SIGPLAN Not 1990 Jun;25(6):92–101. https://doi.org/10.1145/93548.93557.
[2] Gay DM, Correctly rounded binary-decimal and decimal-binary conversions;
1990. AT&T Bell Laboratories Numerical Analysis Manuscript 90-10.

Reviewed By: sivachandra

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




More information about the All-commits mailing list