Re: [PATCH 3/4] libstdc++: Add floating-point std::to_chars implementation

2020-12-21 Thread Maciej W. Rozycki
On Mon, 21 Dec 2020, Patrick Palka wrote: > > This breaks with the `vax-netbsdelf' target in GCC compilation: > > > > .../libstdc++-v3/src/c++17/floating_to_chars.cc:126:38: error: static > > assertion failed > > 126 | static_assert(__DBL_MANT_DIG__ == 53); > > |

Re: [PATCH 3/4] libstdc++: Add floating-point std::to_chars implementation

2020-12-21 Thread Patrick Palka via Gcc-patches
On Sun, 20 Dec 2020, Maciej W. Rozycki wrote: > On Thu, 17 Dec 2020, Patrick Palka via Gcc-patches wrote: > > > > >libstdc++-v3/ChangeLog: > > > > > > > > * config/abi/pre/gnu.ver: Add new exports. > > > > * include/std/charconv (to_chars): Declare the floating-point > > > > ove

Re: [PATCH 3/4] libstdc++: Add floating-point std::to_chars implementation

2020-12-20 Thread Maciej W. Rozycki
On Thu, 17 Dec 2020, Patrick Palka via Gcc-patches wrote: > > >libstdc++-v3/ChangeLog: > > > > > > * config/abi/pre/gnu.ver: Add new exports. > > > * include/std/charconv (to_chars): Declare the floating-point > > > overloads for float, double and long double. > > > * src/c

Re: [PATCH 3/4] libstdc++: Add floating-point std::to_chars implementation

2020-12-18 Thread Christophe Lyon via Gcc-patches
gt;> > > > > > > > > > time when the general formatting mode > resolves to fixed. > > > > > > >> > > > > > > > > > > > > > > > >> > > > > > > > > > Tested on x86_64-pc-linux-gnu, > aar

Re: [PATCH 3/4] libstdc++: Add floating-point std::to_chars implementation

2020-12-18 Thread Patrick Palka via Gcc-patches
ing mode resolves > > > > > >> > > > > > > > > > to fixed. > > > > > >> > > > > > > > > > > > > > > >> > > > > > > > > > Tested on x86_64-pc-linux-gnu, > > > > &g

Re: [PATCH 3/4] libstdc++: Add floating-point std::to_chars implementation

2020-12-18 Thread Christophe Lyon via Gcc-patches
> > > > > > > Tested on x86_64-pc-linux-gnu, > > > > >> > > > > > > > > > aarch64-unknown-linux-gnu, > > > > >> > > > > > > > > > s390x-ibm-linux-gnu, and > > > > >> >

Re: [PATCH 3/4] libstdc++: Add floating-point std::to_chars implementation

2020-12-18 Thread Patrick Palka via Gcc-patches
t; > > > > > > > > > Tested on x86_64-pc-linux-gnu, > > > >> > > > > > > > > > aarch64-unknown-linux-gnu, > > > >> > > > > > > > > > s390x-ibm-linux-g

Re: [PATCH 3/4] libstdc++: Add floating-point std::to_chars implementation

2020-12-18 Thread Jonathan Wakely via Gcc-patches
I think we can test for it with #ifdef and just provide an incorrectly rounded result for newlib.

Re: [PATCH 3/4] libstdc++: Add floating-point std::to_chars implementation

2020-12-18 Thread Christophe Lyon via Gcc-patches
t; > > > s390x-ibm-linux-gnu, and powerpc64-unknown-linux-gnu. > > >> > > > > > > > > > > > >> > > > > > > > > > libstdc++-v3/ChangeLog: > > >> > > > > > > > > > > > >> > > >

Re: [PATCH 3/4] libstdc++: Add floating-point std::to_chars implementation

2020-12-17 Thread Patrick Palka via Gcc-patches
90x-ibm-linux-gnu, and powerpc64-unknown-linux-gnu. > >> > > > > > > > > > > >> > > > > > > > > > libstdc++-v3/ChangeLog: > >> > > > > > > > > > > >> > > > > > > > > >* acin

Re: [PATCH 3/4] libstdc++: Add floating-point std::to_chars implementation

2020-12-17 Thread Jonathan Wakely via Gcc-patches
erloads for float, double and long double. > > > > > > > > >* src/c++17/Makefile.am (sources): Add floating_to_chars.cc. > > > > > > > > >* src/c++17/Makefile.in: Regenerate. > > > > > > > > >

Re: [PATCH 3/4] libstdc++: Add floating-point std::to_chars implementation

2020-08-19 Thread Patrick Palka via Gcc-patches
gt; * config/abi/pre/gnu.ver: Add new exports. > > > > > > > > > > * configure: Regenerate. > > > > > > > > > > * include/std/charconv (to_chars): Declare the > > > > > > > > > > floatin

Re: [PATCH 3/4] libstdc++: Add floating-point std::to_chars implementation

2020-07-22 Thread Patrick Palka via Gcc-patches
.am (sources): Add > > > > > > > > > floating_to_chars.cc. > > > > > > > > > * src/c++17/Makefile.in: Regenerate. > > > > > > > > > * src/c++17/floating_to_chars.cc: New file. > > > > > > > >

Re: [PATCH 3/4] libstdc++: Add floating-point std::to_chars implementation

2020-07-20 Thread Patrick Palka via Gcc-patches
chars_format __fmt) noexcept; > > > > > + to_chars_result to_chars(char* __first, char* __last, float > > > __value, > > > > > +chars_format __fmt, int __precision) > > > noexcept; > > > > > + > > &

Re: [PATCH 3/4] libstdc++: Add floating-point std::to_chars implementation

2020-07-20 Thread Jonathan Wakely via Gcc-patches
failure on i386 due to > > > > __int128 being unavailable, by refactoring the long double binary > > format > > > > selection to avoid referring to __int128 when it doesn't exist. The > > > > patch also makes the hex formatting for 80-bit long double

Re: [PATCH 3/4] libstdc++: Add floating-point std::to_chars implementation

2020-07-20 Thread Patrick Palka via Gcc-patches
ng_double.cc: New test. > > > > > > * testsuite/util/testsuite_abi.cc: Add new symbol version. > > > > > > > > > > Here is v2 of this patch, which fixes a build failure on i386 due to > > > > > __int128 being unavailable, by refactor

Re: [PATCH 3/4] libstdc++: Add floating-point std::to_chars implementation

2020-07-20 Thread Jonathan Wakely via Gcc-patches
notably replaces the use of _GLIBCXX_DEBUG with _GLIBCXX_ASSERTIONS > since we just want to enable __glibcxx_assert and not all of debug mode. Here's v4, which should now correctly support using with -mlong-double-64 on targets with a large default long double type. This is done by defining th

Re: [PATCH 3/4] libstdc++: Add floating-point std::to_chars implementation

2020-07-19 Thread Patrick Palka via Gcc-patches
't exist. The > > > patch also makes the hex formatting for 80-bit long double use uint64_t > > > instead of __int128 since the mantissa has exactly 64 bits in this case. > > > > Here's v3 which just makes some minor stylistic adjustments, and most > >

Re: [PATCH 3/4] libstdc++: Add floating-point std::to_chars implementation

2020-07-17 Thread Patrick Palka via Gcc-patches
0-bit long double use uint64_t > > instead of __int128 since the mantissa has exactly 64 bits in this case. > > Here's v3 which just makes some minor stylistic adjustments, and most > notably replaces the use of _GLIBCXX_DEBUG with _GLIBCXX_ASSERTIONS > since we just want t

Re: [PATCH 3/4] libstdc++: Add floating-point std::to_chars implementation

2020-07-16 Thread Patrick Palka via Gcc-patches
> patch also makes the hex formatting for 80-bit long double use uint64_t > instead of __int128 since the mantissa has exactly 64 bits in this case. Here's v3 which just makes some minor stylistic adjustments, and most notably replaces the use of _GLIBCXX_DEBUG with _GLIBCXX_ASSERTIONS since we

Re: [PATCH 3/4] libstdc++: Add floating-point std::to_chars implementation

2020-07-15 Thread Patrick Palka via Gcc-patches
ring to __int128 when it doesn't exist. The patch also makes the hex formatting for 80-bit long double use uint64_t instead of __int128 since the mantissa has exactly 64 bits in this case. -- >8 -- Subject: [PATCH 3/4] libstdc++: Add floating-point std::to_chars implementation This impleme

[PATCH 3/4] libstdc++: Add floating-point std::to_chars implementation

2020-07-14 Thread Patrick Palka via Gcc-patches
This implements the floating-point std::to_chars overloads for float, double and long double. We use the Ryu library to compute the shortest round-trippable fixed and scientific forms of a number for float, double and long double. We also use Ryu for performing fixed and scientific formatting of