public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/meissner/heads/work097)] Make __float128 use the _Float128 type.
@ 2022-08-12  4:17 Michael Meissner
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Meissner @ 2022-08-12  4:17 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:210a3feacc64cb76a23f879dfadb29495c65aa30

commit 210a3feacc64cb76a23f879dfadb29495c65aa30
Author: Michael Meissner <meissner@linux.ibm.com>
Date:   Fri Aug 12 00:17:34 2022 -0400

    Make __float128 use the _Float128 type.
    
    2022-08-12   Michael Meissner  <meissner@linux.ibm.com>
    
    gcc/
    
            * config/rs6000/rs6000-builtin.cc (rs6000_init_builtins): Always use the
            _Float128 type for __float128.  Don't use the long double type.
            * config/rs6000/rs6000.cc (rs6000_libgcc_floating_mode_supported_p):
            Use KFmode for Float128 mode.
            (rs6000_floatn_mode): Likewise.
            (rs6000_c_mode_for_suffix): Likewise.

Diff:
---
 gcc/config/rs6000/rs6000-builtin.cc |  8 ++++----
 gcc/config/rs6000/rs6000.cc         | 13 ++++---------
 2 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/gcc/config/rs6000/rs6000-builtin.cc b/gcc/config/rs6000/rs6000-builtin.cc
index e34a8f0cebf..1cc97fa49b3 100644
--- a/gcc/config/rs6000/rs6000-builtin.cc
+++ b/gcc/config/rs6000/rs6000-builtin.cc
@@ -733,10 +733,10 @@ rs6000_init_builtins (void)
 
   if (TARGET_FLOAT128_TYPE)
     {
-      if (TARGET_IEEEQUAD && TARGET_LONG_DOUBLE_128)
-	ieee128_float_type_node = long_double_type_node;
-      else
-	ieee128_float_type_node = float128_type_node;
+      /* Always make the type used by __float128 to be the same as the
+	 _Float128 type.  The C23 standard will want long double to be a
+	 different type than _Float128, so don't use the long double type.  */
+      ieee128_float_type_node = float128_type_node;
       t = build_qualified_type (ieee128_float_type_node, TYPE_QUAL_CONST);
       lang_hooks.types.register_builtin_type (ieee128_float_type_node,
 					      "__ieee128");
diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
index eddf8c8afe7..88fc4f1fdc5 100644
--- a/gcc/config/rs6000/rs6000.cc
+++ b/gcc/config/rs6000/rs6000.cc
@@ -23724,13 +23724,8 @@ rs6000_libgcc_floating_mode_supported_p (scalar_float_mode mode)
     case E_TFmode:
       return true;
 
-      /* We only return true for KFmode if IEEE 128-bit types are supported, and
-	 if long double does not use the IEEE 128-bit format.  If long double
-	 uses the IEEE 128-bit format, it will use TFmode and not KFmode.
-	 Because the code will not use KFmode in that case, there will be aborts
-	 because it can't find KFmode in the Floatn types.  */
     case E_KFmode:
-      return TARGET_FLOAT128_TYPE && !TARGET_IEEEQUAD;
+      return TARGET_FLOAT128_TYPE;
 
     default:
       return false;
@@ -23764,7 +23759,7 @@ rs6000_floatn_mode (int n, bool extended)
 
 	case 64:
 	  if (TARGET_FLOAT128_TYPE)
-	    return (FLOAT128_IEEE_P (TFmode)) ? TFmode : KFmode;
+	    return KFmode;
 	  else
 	    return opt_scalar_float_mode ();
 
@@ -23788,7 +23783,7 @@ rs6000_floatn_mode (int n, bool extended)
 
 	case 128:
 	  if (TARGET_FLOAT128_TYPE)
-	    return (FLOAT128_IEEE_P (TFmode)) ? TFmode : KFmode;
+	    return KFmode;
 	  else
 	    return opt_scalar_float_mode ();
 
@@ -23806,7 +23801,7 @@ rs6000_c_mode_for_suffix (char suffix)
   if (TARGET_FLOAT128_TYPE)
     {
       if (suffix == 'q' || suffix == 'Q')
-	return (FLOAT128_IEEE_P (TFmode)) ? TFmode : KFmode;
+	return KFmode;
 
       /* At the moment, we are not defining a suffix for IBM extended double.
 	 If/when the default for -mabi=ieeelongdouble is changed, and we want


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

* [gcc(refs/users/meissner/heads/work097)] Make __float128 use the _Float128 type.
@ 2022-08-12 21:01 Michael Meissner
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Meissner @ 2022-08-12 21:01 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:b417cfa7a0453b60e7188c74f8b22441db0d470e

commit b417cfa7a0453b60e7188c74f8b22441db0d470e
Author: Michael Meissner <meissner@linux.ibm.com>
Date:   Fri Aug 12 17:01:02 2022 -0400

    Make __float128 use the _Float128 type.
    
    2022-08-12   Michael Meissner  <meissner@linux.ibm.com>
    
    gcc/
    
            * config/rs6000/rs6000-builtin.cc (rs6000_init_builtins): Always use the
            _Float128 type for __float128.  Don't use the long double type.
            * config/rs6000/rs6000.cc (rs6000_libgcc_floating_mode_supported_p):
            Always use KFmode for Float128 mode.
            (rs6000_floatn_mode): Likewise.
            (rs6000_c_mode_for_suffix): Likewise.

Diff:
---
 gcc/config/rs6000/rs6000-builtin.cc |  8 ++++----
 gcc/config/rs6000/rs6000.cc         | 30 +++++++++++-------------------
 2 files changed, 15 insertions(+), 23 deletions(-)

diff --git a/gcc/config/rs6000/rs6000-builtin.cc b/gcc/config/rs6000/rs6000-builtin.cc
index bfb14c4a870..69a2aedc5f2 100644
--- a/gcc/config/rs6000/rs6000-builtin.cc
+++ b/gcc/config/rs6000/rs6000-builtin.cc
@@ -733,10 +733,10 @@ rs6000_init_builtins (void)
 
   if (TARGET_FLOAT128_TYPE)
     {
-      if (TARGET_IEEEQUAD && TARGET_LONG_DOUBLE_128)
-	ieee128_float_type_node = long_double_type_node;
-      else
-	ieee128_float_type_node = float128_type_node;
+      /* Always make the type used by __float128 to be the same as the
+	 _Float128 type.  The C23 standard will want long double to be a
+	 different type than _Float128, so don't use the long double type.  */
+      ieee128_float_type_node = float128_type_node;
       t = build_qualified_type (ieee128_float_type_node, TYPE_QUAL_CONST);
       lang_hooks.types.register_builtin_type (ieee128_float_type_node,
 					      "__ieee128");
diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
index eddf8c8afe7..30dafbce83f 100644
--- a/gcc/config/rs6000/rs6000.cc
+++ b/gcc/config/rs6000/rs6000.cc
@@ -23724,13 +23724,8 @@ rs6000_libgcc_floating_mode_supported_p (scalar_float_mode mode)
     case E_TFmode:
       return true;
 
-      /* We only return true for KFmode if IEEE 128-bit types are supported, and
-	 if long double does not use the IEEE 128-bit format.  If long double
-	 uses the IEEE 128-bit format, it will use TFmode and not KFmode.
-	 Because the code will not use KFmode in that case, there will be aborts
-	 because it can't find KFmode in the Floatn types.  */
     case E_KFmode:
-      return TARGET_FLOAT128_TYPE && !TARGET_IEEEQUAD;
+      return TARGET_FLOAT128_TYPE;
 
     default:
       return false;
@@ -23764,7 +23759,7 @@ rs6000_floatn_mode (int n, bool extended)
 
 	case 64:
 	  if (TARGET_FLOAT128_TYPE)
-	    return (FLOAT128_IEEE_P (TFmode)) ? TFmode : KFmode;
+	    return KFmode;
 	  else
 	    return opt_scalar_float_mode ();
 
@@ -23788,7 +23783,7 @@ rs6000_floatn_mode (int n, bool extended)
 
 	case 128:
 	  if (TARGET_FLOAT128_TYPE)
-	    return (FLOAT128_IEEE_P (TFmode)) ? TFmode : KFmode;
+	    return KFmode;
 	  else
 	    return opt_scalar_float_mode ();
 
@@ -23803,18 +23798,15 @@ rs6000_floatn_mode (int n, bool extended)
 static machine_mode
 rs6000_c_mode_for_suffix (char suffix)
 {
-  if (TARGET_FLOAT128_TYPE)
-    {
-      if (suffix == 'q' || suffix == 'Q')
-	return (FLOAT128_IEEE_P (TFmode)) ? TFmode : KFmode;
+  if (TARGET_FLOAT128_TYPE && (suffix == 'q' || suffix == 'Q'))
+    return KFmode;
 
-      /* At the moment, we are not defining a suffix for IBM extended double.
-	 If/when the default for -mabi=ieeelongdouble is changed, and we want
-	 to support __ibm128 constants in legacy library code, we may need to
-	 re-evalaute this decision.  Currently, c-lex.cc only supports 'w' and
-	 'q' as machine dependent suffixes.  The x86_64 port uses 'w' for
-	 __float80 constants.  */
-    }
+  /* At the moment, we are not defining a suffix for IBM extended double.
+     If/when the default for -mabi=ieeelongdouble is changed, and we want to
+     support __ibm128 constants in legacy library code, we may need to
+     re-evalaute this decision.  Currently, c-lex.cc only supports 'w' and 'q'
+     as machine dependent suffixes.  The x86_64 port uses 'w' for __float80
+     constants.  */
 
   return VOIDmode;
 }


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

* [gcc(refs/users/meissner/heads/work097)] Make __float128 use the _Float128 type.
@ 2022-08-12 20:54 Michael Meissner
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Meissner @ 2022-08-12 20:54 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:0a786fe926cc111677d2ea5d151fef695dc86cb6

commit 0a786fe926cc111677d2ea5d151fef695dc86cb6
Author: Michael Meissner <meissner@linux.ibm.com>
Date:   Fri Aug 12 16:54:19 2022 -0400

    Make __float128 use the _Float128 type.
    
    2022-08-12   Michael Meissner  <meissner@linux.ibm.com>
    
    gcc/
    
            * config/rs6000/rs6000-builtin.cc (rs6000_init_builtins): Always use the
            _Float128 type for __float128.  Don't use the long double type.
            * config/rs6000/rs6000.cc (rs6000_libgcc_floating_mode_supported_p):
            Always use KFmode for Float128 mode.
            (rs6000_floatn_mode): Likewise.
            (rs6000_c_mode_for_suffix): Likewise.

Diff:
---
 gcc/config/rs6000/rs6000-builtin.cc |  8 ++++----
 gcc/config/rs6000/rs6000.cc         | 13 ++++---------
 2 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/gcc/config/rs6000/rs6000-builtin.cc b/gcc/config/rs6000/rs6000-builtin.cc
index bfb14c4a870..69a2aedc5f2 100644
--- a/gcc/config/rs6000/rs6000-builtin.cc
+++ b/gcc/config/rs6000/rs6000-builtin.cc
@@ -733,10 +733,10 @@ rs6000_init_builtins (void)
 
   if (TARGET_FLOAT128_TYPE)
     {
-      if (TARGET_IEEEQUAD && TARGET_LONG_DOUBLE_128)
-	ieee128_float_type_node = long_double_type_node;
-      else
-	ieee128_float_type_node = float128_type_node;
+      /* Always make the type used by __float128 to be the same as the
+	 _Float128 type.  The C23 standard will want long double to be a
+	 different type than _Float128, so don't use the long double type.  */
+      ieee128_float_type_node = float128_type_node;
       t = build_qualified_type (ieee128_float_type_node, TYPE_QUAL_CONST);
       lang_hooks.types.register_builtin_type (ieee128_float_type_node,
 					      "__ieee128");
diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
index eddf8c8afe7..88fc4f1fdc5 100644
--- a/gcc/config/rs6000/rs6000.cc
+++ b/gcc/config/rs6000/rs6000.cc
@@ -23724,13 +23724,8 @@ rs6000_libgcc_floating_mode_supported_p (scalar_float_mode mode)
     case E_TFmode:
       return true;
 
-      /* We only return true for KFmode if IEEE 128-bit types are supported, and
-	 if long double does not use the IEEE 128-bit format.  If long double
-	 uses the IEEE 128-bit format, it will use TFmode and not KFmode.
-	 Because the code will not use KFmode in that case, there will be aborts
-	 because it can't find KFmode in the Floatn types.  */
     case E_KFmode:
-      return TARGET_FLOAT128_TYPE && !TARGET_IEEEQUAD;
+      return TARGET_FLOAT128_TYPE;
 
     default:
       return false;
@@ -23764,7 +23759,7 @@ rs6000_floatn_mode (int n, bool extended)
 
 	case 64:
 	  if (TARGET_FLOAT128_TYPE)
-	    return (FLOAT128_IEEE_P (TFmode)) ? TFmode : KFmode;
+	    return KFmode;
 	  else
 	    return opt_scalar_float_mode ();
 
@@ -23788,7 +23783,7 @@ rs6000_floatn_mode (int n, bool extended)
 
 	case 128:
 	  if (TARGET_FLOAT128_TYPE)
-	    return (FLOAT128_IEEE_P (TFmode)) ? TFmode : KFmode;
+	    return KFmode;
 	  else
 	    return opt_scalar_float_mode ();
 
@@ -23806,7 +23801,7 @@ rs6000_c_mode_for_suffix (char suffix)
   if (TARGET_FLOAT128_TYPE)
     {
       if (suffix == 'q' || suffix == 'Q')
-	return (FLOAT128_IEEE_P (TFmode)) ? TFmode : KFmode;
+	return KFmode;
 
       /* At the moment, we are not defining a suffix for IBM extended double.
 	 If/when the default for -mabi=ieeelongdouble is changed, and we want


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

* [gcc(refs/users/meissner/heads/work097)] Make __float128 use the _Float128 type.
@ 2022-08-12  1:11 Michael Meissner
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Meissner @ 2022-08-12  1:11 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:5781bb7754809e81cbb661c891b28c6d2a1f1432

commit 5781bb7754809e81cbb661c891b28c6d2a1f1432
Author: Michael Meissner <meissner@linux.ibm.com>
Date:   Thu Aug 11 21:11:26 2022 -0400

    Make __float128 use the _Float128 type.
    
    2022-08-11   Michael Meissner  <meissner@linux.ibm.com>
    
    gcc/
    
            * config/rs6000/rs6000-builtin.cc (rs6000_init_builtins): Always use the
            _Float128 type for __float128.  Don't use the long double type.

Diff:
---
 gcc/config/rs6000/rs6000-builtin.cc | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gcc/config/rs6000/rs6000-builtin.cc b/gcc/config/rs6000/rs6000-builtin.cc
index e34a8f0cebf..1cc97fa49b3 100644
--- a/gcc/config/rs6000/rs6000-builtin.cc
+++ b/gcc/config/rs6000/rs6000-builtin.cc
@@ -733,10 +733,10 @@ rs6000_init_builtins (void)
 
   if (TARGET_FLOAT128_TYPE)
     {
-      if (TARGET_IEEEQUAD && TARGET_LONG_DOUBLE_128)
-	ieee128_float_type_node = long_double_type_node;
-      else
-	ieee128_float_type_node = float128_type_node;
+      /* Always make the type used by __float128 to be the same as the
+	 _Float128 type.  The C23 standard will want long double to be a
+	 different type than _Float128, so don't use the long double type.  */
+      ieee128_float_type_node = float128_type_node;
       t = build_qualified_type (ieee128_float_type_node, TYPE_QUAL_CONST);
       lang_hooks.types.register_builtin_type (ieee128_float_type_node,
 					      "__ieee128");


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

end of thread, other threads:[~2022-08-12 21:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-12  4:17 [gcc(refs/users/meissner/heads/work097)] Make __float128 use the _Float128 type Michael Meissner
  -- strict thread matches above, loose matches on Subject: below --
2022-08-12 21:01 Michael Meissner
2022-08-12 20:54 Michael Meissner
2022-08-12  1:11 Michael Meissner

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