[libcxx-commits] [PATCH] D70631: Microsoft's floating-point to_chars powered by Ryu and Ryu Printf

Stephan T. Lavavej via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Sep 7 12:58:35 PDT 2021


STL_MSFT added inline comments.


================
Comment at: libcxx/include/__charconv/ryu.h:63
+
+// https://github.com/ulfjack/ryu/tree/59661c3/ryu
+
----------------
Mordante wrote:
> STL_MSFT wrote:
> > ldionne wrote:
> > > Mordante wrote:
> > > > ldionne wrote:
> > > > > If this code is taken from https://github.com/ulfjack/ryu/tree/59661c3/ryu, would it be possible/make sense to have a script that automatically re-derives it? I'm just asking because it would be awesome if we could slurp in any updates to that library automatically.
> > > > I would love to be able to automatically sync this code with upstream. I've no idea how much the uglification and libc++ specific attributes make this process feasible.
> > > Well, actually, if we embed this implementation in the dylib exclusively, these headers could all move to `src/` and we would not even need to uglify them.
> > Note that I extensively modified the upstream sources, not just for uglification and headerization but also to add bounds checking to every attempted buffer write. I kept a record of the changes I made (there's a git repo), but they aren't automatically applicable (rebasing to keep up with upstream commits was an entirely manual process, and I haven't performed such an update in a while; we've instead been modifying microsoft/STL directly). I was able to contribute much of my work upstream (in particular the performance tuning and some testing), but ran out of time for upstreaming the bounds checking in a form that would make sense in Ulf's C implementation.
> Good point about moving the implementation to `src/`, that's already on my todo list for this patch. I prefer to look at syncing with Ulf's and MSVC STL's upstream after this patch has landed. When most of the implementation details are in the dylib there will be less ABI concerns.
> 
> @STL_MSFT The git repo you mentioned is that the public MSVC STL repo at GitHub?
@Mordante 
> The git repo you mentioned is that the public MSVC STL repo at GitHub?

No - the microsoft/STL repo contains the final result of my transformations to Ulf's original code, but it doesn't record how I transformed it (which happened shortly before we went open-source). https://github.com/StephanTLavavej/ryu/commits/msvc-2019.04.29 is what I was referring to. This is not intended to be an alternative to ulfjack/ryu, nor can it be compiled as-is - it simply has a sequence of commits that transforms the code into the final result for charconv. This allowed me to digest changes from upstream by rebasing. (As the date indicates, I haven't touched this in over 2 years. Later changes to charconv haven't been applied back to this repo.)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70631/new/

https://reviews.llvm.org/D70631



More information about the libcxx-commits mailing list