diff options
author | Mark de Wever <koraq@xs4all.nl> | 2021-02-09 17:52:41 +0100 |
---|---|---|
committer | Mark de Wever <koraq@xs4all.nl> | 2021-12-12 16:34:50 +0100 |
commit | abb5dd6e99df623effc935b84e86f2e886580ad7 (patch) | |
tree | ea9cfab852d182b0368fe2f05059f7e8a9a3f771 /libcxx/CREDITS.TXT | |
parent | fc02ceb12aedeb43a993eac8226700810638e455 (diff) | |
download | llvm-abb5dd6e99df623effc935b84e86f2e886580ad7.tar.gz |
Microsoft's floating-point to_chars powered by Ryu and Ryu Printf
Microsoft would like to contribute its implementation of floating-point to_chars to libc++. This uses the impossibly fast Ryu and Ryu Printf algorithms invented by Ulf Adams at Google. Upstream repos: https://github.com/microsoft/STL and https://github.com/ulfjack/ryu .
Licensing notes: MSVC's STL is available under the Apache License v2.0 with LLVM Exception, intentionally chosen to match libc++. We've used Ryu under the Boost Software License.
This patch contains minor changes from Jorg Brown at Google, to adapt the code to libc++. He verified that it works in Google's Linux-based environment, but then I applied more changes on top of his, so any compiler errors are my fault. (I haven't tried to build and test libc++ yet.) Please tell me if we need to do anything else in order to follow https://llvm.org/docs/DeveloperPolicy.html#attribution-of-changes .
Notes:
* libc++'s integer charconv is unchanged (except for a small refactoring). MSVC's integer charconv hasn't been tuned for performance yet, so you're not missing anything.
* Floating-point from_chars isn't part of this patch because Jorg found that MSVC's implementation (derived from our CRT's strtod) was slower than Abseil's. If you're unable to use Abseil or another implementation due to licensing or technical considerations, Microsoft would be delighted if you used MSVC's from_chars (and you can just take it, or ask us to provide a patch like this). Ulf is also working on a novel algorithm for from_chars.
* This assumes that float is IEEE 32-bit, double is IEEE 64-bit, and long double is also IEEE 64-bit.
* I have added MSVC's charconv tests (the whole thing: integer/floating from_chars/to_chars), but haven't adapted them to libcxx's harness at all. (These tests will be available in the microsoft/STL repo soon.)
* Jorg added int128 codepaths. These were originally present in upstream Ryu, and I removed them from microsoft/STL purely for performance reasons (MSVC doesn't support int128; Clang on Windows does, but I found that x64 intrinsics were slightly faster).
* The implementation is split into 3 headers. In MSVC's STL, charconv contains only Microsoft-written code. xcharconv_ryu.h contains code derived from Ryu (with significant modifications and additions). xcharconv_ryu_tables.h contains Ryu's large lookup tables (they were sufficiently large to make editing inconvenient, hence the separate file). The xmeow.h convention is MSVC's for internal headers; you may wish to rename them.
* You should consider separately compiling the lookup tables (see https://github.com/microsoft/STL/issues/172 ) for compiler throughput and reduced object file size.
* See https://github.com/StephanTLavavej/llvm-project/commits/charconv for fine-grained history. (If necessary, I can perform some rebase surgery to show you what Jorg changed relative to the microsoft/STL repo; currently that's all fused into the first commit.)
Differential Revision: https://reviews.llvm.org/D70631
Diffstat (limited to 'libcxx/CREDITS.TXT')
-rw-r--r-- | libcxx/CREDITS.TXT | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libcxx/CREDITS.TXT b/libcxx/CREDITS.TXT index fc442f4db1a1..cd5bc08a60fc 100644 --- a/libcxx/CREDITS.TXT +++ b/libcxx/CREDITS.TXT @@ -12,6 +12,9 @@ N: Saleem Abdulrasool E: compnerd@compnerd.org D: Minor patches and Linux fixes. +N: Ulf Adams +D: Invented the Ryu and Ryu Printf algorithms used in floating-point to_chars, and wrote the initial code. + N: Muiez Ahmed E: muiez@ibm.com D: z/OS port. @@ -28,6 +31,9 @@ N: Holger Arnold E: holgerar@gmail.com D: Minor fix. +N: Jorg Brown +D: Ported floating-point to_chars from MSVC to libc++. + N: David Chisnall E: theraven at theravensnest dot org D: FreeBSD and Solaris ports, libcxxrt support, some atomics work. @@ -81,6 +87,14 @@ N: Argyrios Kyrtzidis E: kyrtzidis@apple.com D: Bug fixes. +N: Stephan T. Lavavej +E: stl@microsoft.com +E: stl@nuwen.net +D: Implemented floating-point to_chars. + +N: Microsoft Corporation +D: Contributed floating-point to_chars. + N: Bruce Mitchener, Jr. E: bruce.mitchener@gmail.com D: Emscripten-related changes. @@ -152,6 +166,7 @@ D: Minor bug fix. N: Mark de Wever E: koraq at xs4all dot nl D: Format library support. +D: Finalized the porting of MSVC's to_chars to libc++. N: Zhang Xiongpang E: zhangxiongpang@gmail.com |