From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1005) id AF6DA3858D28; Fri, 12 Aug 2022 20:56:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AF6DA3858D28 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Michael Meissner To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/meissner/heads/work097)] Revert patch. X-Act-Checkin: gcc X-Git-Author: Michael Meissner X-Git-Refname: refs/users/meissner/heads/work097 X-Git-Oldrev: 0a786fe926cc111677d2ea5d151fef695dc86cb6 X-Git-Newrev: 195a05f224137b836acd2ba33fdb11cd4b13bdde Message-Id: <20220812205615.AF6DA3858D28@sourceware.org> Date: Fri, 12 Aug 2022 20:56:15 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Aug 2022 20:56:15 -0000 https://gcc.gnu.org/g:195a05f224137b836acd2ba33fdb11cd4b13bdde commit 195a05f224137b836acd2ba33fdb11cd4b13bdde Author: Michael Meissner Date: Fri Aug 12 16:55:58 2022 -0400 Revert patch. Make __float128 use the _Float128 type. 2022-08-12 Michael Meissner 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, 13 insertions(+), 8 deletions(-) diff --git a/gcc/config/rs6000/rs6000-builtin.cc b/gcc/config/rs6000/rs6000-builtin.cc index 69a2aedc5f2..bfb14c4a870 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) { - /* 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; + if (TARGET_IEEEQUAD && TARGET_LONG_DOUBLE_128) + ieee128_float_type_node = long_double_type_node; + else + 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 88fc4f1fdc5..eddf8c8afe7 100644 --- a/gcc/config/rs6000/rs6000.cc +++ b/gcc/config/rs6000/rs6000.cc @@ -23724,8 +23724,13 @@ 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; + return TARGET_FLOAT128_TYPE && !TARGET_IEEEQUAD; default: return false; @@ -23759,7 +23764,7 @@ rs6000_floatn_mode (int n, bool extended) case 64: if (TARGET_FLOAT128_TYPE) - return KFmode; + return (FLOAT128_IEEE_P (TFmode)) ? TFmode : KFmode; else return opt_scalar_float_mode (); @@ -23783,7 +23788,7 @@ rs6000_floatn_mode (int n, bool extended) case 128: if (TARGET_FLOAT128_TYPE) - return KFmode; + return (FLOAT128_IEEE_P (TFmode)) ? TFmode : KFmode; else return opt_scalar_float_mode (); @@ -23801,7 +23806,7 @@ rs6000_c_mode_for_suffix (char suffix) if (TARGET_FLOAT128_TYPE) { if (suffix == 'q' || suffix == 'Q') - return KFmode; + return (FLOAT128_IEEE_P (TFmode)) ? TFmode : 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