public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libquadmath/113260] New: missing from_chars/to_chars for __float128
@ 2024-01-08 2:17 g.peterhoff@t-online.de
2024-01-08 2:18 ` [Bug libquadmath/113260] " pinskia at gcc dot gnu.org
` (9 more replies)
0 siblings, 10 replies; 11+ messages in thread
From: g.peterhoff@t-online.de @ 2024-01-08 2:17 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113260
Bug ID: 113260
Summary: missing from_chars/to_chars for __float128
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libquadmath
Assignee: unassigned at gcc dot gnu.org
Reporter: g.peterhoff@t-online.de
Target Milestone: ---
Hello,
can you add this?
thx
Gero
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libquadmath/113260] missing from_chars/to_chars for __float128
2024-01-08 2:17 [Bug libquadmath/113260] New: missing from_chars/to_chars for __float128 g.peterhoff@t-online.de
@ 2024-01-08 2:18 ` pinskia at gcc dot gnu.org
2024-01-08 2:22 ` [Bug libstdc++/113260] " pinskia at gcc dot gnu.org
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-01-08 2:18 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113260
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |enhancement
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libstdc++/113260] missing from_chars/to_chars for __float128
2024-01-08 2:17 [Bug libquadmath/113260] New: missing from_chars/to_chars for __float128 g.peterhoff@t-online.de
2024-01-08 2:18 ` [Bug libquadmath/113260] " pinskia at gcc dot gnu.org
@ 2024-01-08 2:22 ` pinskia at gcc dot gnu.org
2024-01-08 2:26 ` pinskia at gcc dot gnu.org
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-01-08 2:22 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113260
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
There is support for _Float128 for from_chars/to_chars in GCC 14 already ..
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libstdc++/113260] missing from_chars/to_chars for __float128
2024-01-08 2:17 [Bug libquadmath/113260] New: missing from_chars/to_chars for __float128 g.peterhoff@t-online.de
2024-01-08 2:18 ` [Bug libquadmath/113260] " pinskia at gcc dot gnu.org
2024-01-08 2:22 ` [Bug libstdc++/113260] " pinskia at gcc dot gnu.org
@ 2024-01-08 2:26 ` pinskia at gcc dot gnu.org
2024-01-08 2:53 ` g.peterhoff@t-online.de
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-01-08 2:26 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113260
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Last reconfirmed| |2024-01-08
Status|UNCONFIRMED |WAITING
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Actually it was added in GCC 13 by r13-3754-ge5bcbcd04cfcb2 .
Can you provide more information here what you need?
Using _Float128 is better than using __float128 since _Float128 is the C/C++
standard style of extended floating point types.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libstdc++/113260] missing from_chars/to_chars for __float128
2024-01-08 2:17 [Bug libquadmath/113260] New: missing from_chars/to_chars for __float128 g.peterhoff@t-online.de
` (2 preceding siblings ...)
2024-01-08 2:26 ` pinskia at gcc dot gnu.org
@ 2024-01-08 2:53 ` g.peterhoff@t-online.de
2024-01-08 2:56 ` pinskia at gcc dot gnu.org
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: g.peterhoff@t-online.de @ 2024-01-08 2:53 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113260
--- Comment #3 from g.peterhoff@t-online.de ---
My problem is that I need from_chars/to_chars for __float128 also for older C++
standards that do not yet support _Float128/std::float128_t.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libstdc++/113260] missing from_chars/to_chars for __float128
2024-01-08 2:17 [Bug libquadmath/113260] New: missing from_chars/to_chars for __float128 g.peterhoff@t-online.de
` (3 preceding siblings ...)
2024-01-08 2:53 ` g.peterhoff@t-online.de
@ 2024-01-08 2:56 ` pinskia at gcc dot gnu.org
2024-01-08 4:22 ` g.peterhoff@t-online.de
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-01-08 2:56 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113260
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
_Float128 is supported in older c++ standards for gcc. That is it does not
error out for -std=gnu++11 even.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libstdc++/113260] missing from_chars/to_chars for __float128
2024-01-08 2:17 [Bug libquadmath/113260] New: missing from_chars/to_chars for __float128 g.peterhoff@t-online.de
` (4 preceding siblings ...)
2024-01-08 2:56 ` pinskia at gcc dot gnu.org
@ 2024-01-08 4:22 ` g.peterhoff@t-online.de
2024-01-08 4:32 ` pinskia at gcc dot gnu.org
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: g.peterhoff@t-online.de @ 2024-01-08 4:22 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113260
--- Comment #5 from g.peterhoff@t-online.de ---
??? I asked for std::from_chars/std::to_chars - which of course doesn't work:
https://godbolt.org/z/n34dTajoc
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libstdc++/113260] missing from_chars/to_chars for __float128
2024-01-08 2:17 [Bug libquadmath/113260] New: missing from_chars/to_chars for __float128 g.peterhoff@t-online.de
` (5 preceding siblings ...)
2024-01-08 4:22 ` g.peterhoff@t-online.de
@ 2024-01-08 4:32 ` pinskia at gcc dot gnu.org
2024-01-08 4:49 ` g.peterhoff@t-online.de
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-01-08 4:32 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113260
--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to g.peterhoff from comment #5)
> ??? I asked for std::from_chars/std::to_chars - which of course doesn't work:
> https://godbolt.org/z/n34dTajoc
std::from_chars/std::to_chars for extended floating point types is only
available with C++23 though. I really doubt they will be added for __float128 .
Maybe they could be enabled for pre-C++23 for the extended FP types too .. But
a libstdc++ maintainer should answer that question since that would be an
extension. Even having them for __float128 will be an extension too.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libstdc++/113260] missing from_chars/to_chars for __float128
2024-01-08 2:17 [Bug libquadmath/113260] New: missing from_chars/to_chars for __float128 g.peterhoff@t-online.de
` (6 preceding siblings ...)
2024-01-08 4:32 ` pinskia at gcc dot gnu.org
@ 2024-01-08 4:49 ` g.peterhoff@t-online.de
2024-01-08 11:02 ` redi at gcc dot gnu.org
2024-01-08 11:03 ` [Bug libstdc++/113260] Add overloads of " redi at gcc dot gnu.org
9 siblings, 0 replies; 11+ messages in thread
From: g.peterhoff@t-online.de @ 2024-01-08 4:49 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113260
--- Comment #7 from g.peterhoff@t-online.de ---
Thank you. That was my question whether these two functions could be added.
At the moment I'm using boost.charconv https://github.com/cppalliance/charconv
https://develop.charconv.cpp.al (not official yet) - but it's still completely
buggy.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libstdc++/113260] missing from_chars/to_chars for __float128
2024-01-08 2:17 [Bug libquadmath/113260] New: missing from_chars/to_chars for __float128 g.peterhoff@t-online.de
` (7 preceding siblings ...)
2024-01-08 4:49 ` g.peterhoff@t-online.de
@ 2024-01-08 11:02 ` redi at gcc dot gnu.org
2024-01-08 11:03 ` [Bug libstdc++/113260] Add overloads of " redi at gcc dot gnu.org
9 siblings, 0 replies; 11+ messages in thread
From: redi at gcc dot gnu.org @ 2024-01-08 11:02 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113260
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |NEW
--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Since GCC 13 you can use _Float128 in older -std modes, and prior to GCC 13
there's no chance we're going to add this anyway.
The only thing missing here is that the _Float128 overloads are not declared
before C++23. They do exist in the library though, so if we declared them they
would be usable:
#include <charconv>
#if __cplusplus <= 202002L
namespace std
{
from_chars_result
from_chars(const char* __first, const char* __last, _Float128& __value,
chars_format __fmt = chars_format::general) noexcept;
to_chars_result
to_chars(char* __first, char* __last, _Float128 __value) noexcept;
}
#endif
int main()
{
char str[] = "0.5";
_Float128 d = 2.0;
std::to_chars(str, str+3, d);
std::from_chars(str, str+3, d);
}
We could also add inline overloads for __float128 that forward to the _Float128
functions. The difficulty would be detecting when that's safe to do. We only
define the _Float128 overloads when that type is supported, and every time we
touch the macros around this something breaks.
Confirming as an enhancement, but I don't intent to work on this myself.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libstdc++/113260] Add overloads of from_chars/to_chars for __float128
2024-01-08 2:17 [Bug libquadmath/113260] New: missing from_chars/to_chars for __float128 g.peterhoff@t-online.de
` (8 preceding siblings ...)
2024-01-08 11:02 ` redi at gcc dot gnu.org
@ 2024-01-08 11:03 ` redi at gcc dot gnu.org
9 siblings, 0 replies; 11+ messages in thread
From: redi at gcc dot gnu.org @ 2024-01-08 11:03 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113260
--- Comment #9 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I've changed the summary, because they're not "missing", since they're not
required/supposed to exist anyway.
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2024-01-08 11:03 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-08 2:17 [Bug libquadmath/113260] New: missing from_chars/to_chars for __float128 g.peterhoff@t-online.de
2024-01-08 2:18 ` [Bug libquadmath/113260] " pinskia at gcc dot gnu.org
2024-01-08 2:22 ` [Bug libstdc++/113260] " pinskia at gcc dot gnu.org
2024-01-08 2:26 ` pinskia at gcc dot gnu.org
2024-01-08 2:53 ` g.peterhoff@t-online.de
2024-01-08 2:56 ` pinskia at gcc dot gnu.org
2024-01-08 4:22 ` g.peterhoff@t-online.de
2024-01-08 4:32 ` pinskia at gcc dot gnu.org
2024-01-08 4:49 ` g.peterhoff@t-online.de
2024-01-08 11:02 ` redi at gcc dot gnu.org
2024-01-08 11:03 ` [Bug libstdc++/113260] Add overloads of " redi at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).