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);
> > |
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
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
gt;> > > > > > > > > > time when the general formatting mode
> resolves to fixed.
> > > > > > >> > > > > > > > > >
> > > > > > >> > > > > > > > > > Tested on x86_64-pc-linux-gnu,
> aar
ing mode resolves
> > > > > >> > > > > > > > > > to fixed.
> > > > > >> > > > > > > > > >
> > > > > >> > > > > > > > > > Tested on x86_64-pc-linux-gnu,
> > > > &g
> > > > > > > Tested on x86_64-pc-linux-gnu,
> > > > >> > > > > > > > > > aarch64-unknown-linux-gnu,
> > > > >> > > > > > > > > > s390x-ibm-linux-gnu, and
> > > > >> >
t; > > > > > > > > > Tested on x86_64-pc-linux-gnu,
> > > >> > > > > > > > > > aarch64-unknown-linux-gnu,
> > > >> > > > > > > > > > s390x-ibm-linux-g
I think we can test for it with #ifdef and just provide an incorrectly
rounded result for newlib.
t; > > > s390x-ibm-linux-gnu, and powerpc64-unknown-linux-gnu.
> > >> > > > > > > > > >
> > >> > > > > > > > > > libstdc++-v3/ChangeLog:
> > >> > > > > > > > > >
> > >> > > >
90x-ibm-linux-gnu, and powerpc64-unknown-linux-gnu.
> >> > > > > > > > > >
> >> > > > > > > > > > libstdc++-v3/ChangeLog:
> >> > > > > > > > > >
> >> > > > > > > > > >* acin
erloads for float, double and long double.
> > > > > > > > >* src/c++17/Makefile.am (sources): Add
floating_to_chars.cc.
> > > > > > > > >* src/c++17/Makefile.in: Regenerate.
> > > > > > > > >
gt; * config/abi/pre/gnu.ver: Add new exports.
> > > > > > > > > > * configure: Regenerate.
> > > > > > > > > > * include/std/charconv (to_chars): Declare the
> > > > > > > > > > floatin
.am (sources): Add
> > > > > > > > > floating_to_chars.cc.
> > > > > > > > > * src/c++17/Makefile.in: Regenerate.
> > > > > > > > > * src/c++17/floating_to_chars.cc: New file.
> > > > > > > >
chars_format __fmt) noexcept;
> > > > > + to_chars_result to_chars(char* __first, char* __last, float
> > > __value,
> > > > > +chars_format __fmt, int __precision)
> > > noexcept;
> > > > > +
> > &
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
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
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
'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
> >
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
> 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
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
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
22 matches
Mail list logo