diff mbox series

[3/3] tree: Remove KFmode workaround [PR112993]

Message ID abd46034-618f-dbf5-f8a4-cb5e1cc8032d@linux.ibm.com
State New
Headers show
Series [1/3] expr: Allow same precision modes conversion between {ibm_extended, ieee_quad}_format [PR112993] | expand

Commit Message

Kewen.Lin July 4, 2024, 8:26 a.m. UTC
Hi,

The fix for PR112993 will make KFmode have 128 bit mode precision,
we don't need this workaround to fix up the type precision any
more, and just go with the mode precision.  So this patch is to
remove KFmode workaround.

Bootstrapped and regtested on x86_64-redhat-linux,
powerpc64{,le}-linux-gnu (ibm128 long double default)
and powerpc64le-linux-gnu (ieee128 long double default).

Is it OK for trunk if {1,2}/3 in this series get landed?

BR,
Kewen
-----

	PR target/112993

gcc/ChangeLog:

	* tree.cc (build_common_tree_nodes): Drop the workaround for rs6000
	KFmode precision adjustment.
---
 gcc/tree.cc | 9 ---------
 1 file changed, 9 deletions(-)

--
2.39.1

Comments

Richard Sandiford July 4, 2024, 3:59 p.m. UTC | #1
"Kewen.Lin" <linkw@linux.ibm.com> writes:
> Hi,
>
> The fix for PR112993 will make KFmode have 128 bit mode precision,
> we don't need this workaround to fix up the type precision any
> more, and just go with the mode precision.  So this patch is to
> remove KFmode workaround.
>
> Bootstrapped and regtested on x86_64-redhat-linux,
> powerpc64{,le}-linux-gnu (ibm128 long double default)
> and powerpc64le-linux-gnu (ieee128 long double default).
>
> Is it OK for trunk if {1,2}/3 in this series get landed?

Yes.  Thanks for doing this!

Richard

> BR,
> Kewen
> -----
>
> 	PR target/112993
>
> gcc/ChangeLog:
>
> 	* tree.cc (build_common_tree_nodes): Drop the workaround for rs6000
> 	KFmode precision adjustment.
> ---
>  gcc/tree.cc | 9 ---------
>  1 file changed, 9 deletions(-)
>
> diff --git a/gcc/tree.cc b/gcc/tree.cc
> index f801712c9dd..f730981ec8b 100644
> --- a/gcc/tree.cc
> +++ b/gcc/tree.cc
> @@ -9575,15 +9575,6 @@ build_common_tree_nodes (bool signed_char)
>        if (!targetm.floatn_mode (n, extended).exists (&mode))
>  	continue;
>        int precision = GET_MODE_PRECISION (mode);
> -      /* Work around the rs6000 KFmode having precision 113 not
> -	 128.  */
> -      const struct real_format *fmt = REAL_MODE_FORMAT (mode);
> -      gcc_assert (fmt->b == 2 && fmt->emin + fmt->emax == 3);
> -      int min_precision = fmt->p + ceil_log2 (fmt->emax - fmt->emin);
> -      if (!extended)
> -	gcc_assert (min_precision == n);
> -      if (precision < min_precision)
> -	precision = min_precision;
>        FLOATN_NX_TYPE_NODE (i) = make_node (REAL_TYPE);
>        TYPE_PRECISION (FLOATN_NX_TYPE_NODE (i)) = precision;
>        layout_type (FLOATN_NX_TYPE_NODE (i));
> --
> 2.39.1
diff mbox series

Patch

diff --git a/gcc/tree.cc b/gcc/tree.cc
index f801712c9dd..f730981ec8b 100644
--- a/gcc/tree.cc
+++ b/gcc/tree.cc
@@ -9575,15 +9575,6 @@  build_common_tree_nodes (bool signed_char)
       if (!targetm.floatn_mode (n, extended).exists (&mode))
 	continue;
       int precision = GET_MODE_PRECISION (mode);
-      /* Work around the rs6000 KFmode having precision 113 not
-	 128.  */
-      const struct real_format *fmt = REAL_MODE_FORMAT (mode);
-      gcc_assert (fmt->b == 2 && fmt->emin + fmt->emax == 3);
-      int min_precision = fmt->p + ceil_log2 (fmt->emax - fmt->emin);
-      if (!extended)
-	gcc_assert (min_precision == n);
-      if (precision < min_precision)
-	precision = min_precision;
       FLOATN_NX_TYPE_NODE (i) = make_node (REAL_TYPE);
       TYPE_PRECISION (FLOATN_NX_TYPE_NODE (i)) = precision;
       layout_type (FLOATN_NX_TYPE_NODE (i));