public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] libstdc++: Fix __floating_to_chars_precision for __float128
@ 2021-02-24 22:14 Patrick Palka
  2021-02-24 22:22 ` Jonathan Wakely
  0 siblings, 1 reply; 2+ messages in thread
From: Patrick Palka @ 2021-02-24 22:14 UTC (permalink / raw)
  To: gcc-patches; +Cc: libstdc++, Patrick Palka

The code path in __floating_to_chars_precision for handling long double
by going through printf now also handles __float128, so the condition
that guards this code path needs to be updated accordingly.

Tested on x86_64-pc-linux-gnu (i.e. it compiles :)), does this look OK
for trunk?

libstdc++-v3/ChangeLog:

	* src/c++17/floating_to_chars.cc (__floating_to_chars_precision):
	Relax the condition that guards the printf code path to accept
	F128_type as well.
---
 libstdc++-v3/src/c++17/floating_to_chars.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libstdc++-v3/src/c++17/floating_to_chars.cc b/libstdc++-v3/src/c++17/floating_to_chars.cc
index aea96e08df1..f1512017aa3 100644
--- a/libstdc++-v3/src/c++17/floating_to_chars.cc
+++ b/libstdc++-v3/src/c++17/floating_to_chars.cc
@@ -1151,7 +1151,7 @@ template<typename T>
 
     // Ryu doesn't support formatting floating-point types larger than double
     // with an explicit precision, so instead we just go through printf.
-    if constexpr (is_same_v<T, long double>)
+    if constexpr (is_same_v<T, long double> || is_same_v<T, F128_type>)
       {
 	int effective_precision;
 	const char* output_specifier;
-- 
2.30.1.602.g966e671106


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] libstdc++: Fix __floating_to_chars_precision for __float128
  2021-02-24 22:14 [PATCH] libstdc++: Fix __floating_to_chars_precision for __float128 Patrick Palka
@ 2021-02-24 22:22 ` Jonathan Wakely
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Wakely @ 2021-02-24 22:22 UTC (permalink / raw)
  To: Patrick Palka; +Cc: gcc-patches, libstdc++

On 24/02/21 17:14 -0500, Patrick Palka via Libstdc++ wrote:
>The code path in __floating_to_chars_precision for handling long double
>by going through printf now also handles __float128, so the condition
>that guards this code path needs to be updated accordingly.
>
>Tested on x86_64-pc-linux-gnu (i.e. it compiles :)), does this look OK
>for trunk?

Yes, Thanks.

>libstdc++-v3/ChangeLog:
>
>	* src/c++17/floating_to_chars.cc (__floating_to_chars_precision):
>	Relax the condition that guards the printf code path to accept
>	F128_type as well.
>---
> libstdc++-v3/src/c++17/floating_to_chars.cc | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/libstdc++-v3/src/c++17/floating_to_chars.cc b/libstdc++-v3/src/c++17/floating_to_chars.cc
>index aea96e08df1..f1512017aa3 100644
>--- a/libstdc++-v3/src/c++17/floating_to_chars.cc
>+++ b/libstdc++-v3/src/c++17/floating_to_chars.cc
>@@ -1151,7 +1151,7 @@ template<typename T>
>
>     // Ryu doesn't support formatting floating-point types larger than double
>     // with an explicit precision, so instead we just go through printf.
>-    if constexpr (is_same_v<T, long double>)
>+    if constexpr (is_same_v<T, long double> || is_same_v<T, F128_type>)
>       {
> 	int effective_precision;
> 	const char* output_specifier;
>-- 
>2.30.1.602.g966e671106
>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-02-24 22:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-24 22:14 [PATCH] libstdc++: Fix __floating_to_chars_precision for __float128 Patrick Palka
2021-02-24 22:22 ` Jonathan Wakely

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).