public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Michael Meissner <meissner@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/meissner/heads/work044)] Revert patch. Date: Fri, 2 Apr 2021 04:49:20 +0000 (GMT) [thread overview] Message-ID: <20210402044920.36B7C3857003@sourceware.org> (raw) https://gcc.gnu.org/g:529450ac63cfdfdf038b8e2f16aadac76a0c0940 commit 529450ac63cfdfdf038b8e2f16aadac76a0c0940 Author: Michael Meissner <meissner@linux.ibm.com> Date: Fri Apr 2 00:48:45 2021 -0400 Revert patch. gcc/ 2021-04-01 Michael Meissner <meissner@linux.ibm.com> Revert patch PR fortran/96983 * config/rs6000/rs6000.c (rs6000_debug_reg_global): Add more debugging for __float128, __ibm128 support. (rs6000_option_override_internal): Do not enable __float128 and __ibm128 support for Fortran. On Fortran, make the default long double precision to be 128. Add error messages if the user tries to change the long double type between IBM/IEEE on Fortran. (rs6000_init_libfuncs): Do not enable __ibm128 support if it is disabled. * config/rs6000/rs6000.h (FLOAT128_IBM_P): Do not return true if __ibm128 was disabled for IFmode/ICmode. * config/rs6000/rs6000.md (FP iterator): Do not enable IF mode if __ibm128 is disabled. (FLOAT128 iterator): Likewise. * config/rs6000/rs6000.opt (x_TARGET_IBM128): New variables to record whether __ibm128 is supported or not. (TARGET_IBM128): Likewise. Diff: --- gcc/ChangeLog.meissner | 21 ---------- gcc/config/rs6000/rs6000.c | 92 +++++++++++--------------------------------- gcc/config/rs6000/rs6000.h | 3 +- gcc/config/rs6000/rs6000.md | 4 +- gcc/config/rs6000/rs6000.opt | 7 ---- 5 files changed, 25 insertions(+), 102 deletions(-) diff --git a/gcc/ChangeLog.meissner b/gcc/ChangeLog.meissner index e2c67d802e4..d88f96b67fe 100644 --- a/gcc/ChangeLog.meissner +++ b/gcc/ChangeLog.meissner @@ -6,27 +6,6 @@ work044.patch011: * config/rs6000/rs6000.c (rs6000_const_f32_to_i32): Change return type to long. -work044.patch010: -2021-04-01 Michael Meissner <meissner@linux.ibm.com> - - PR fortran/96983 - * config/rs6000/rs6000.c (rs6000_debug_reg_global): Add more - debugging for __float128, __ibm128 support. - (rs6000_option_override_internal): Do not enable __float128 and - __ibm128 support for Fortran. On Fortran, make the default long - double precision to be 128. Add error messages if the user tries - to change the long double type between IBM/IEEE on Fortran. - (rs6000_init_libfuncs): Do not enable __ibm128 support if it is - disabled. - * config/rs6000/rs6000.h (FLOAT128_IBM_P): Do not return true if - __ibm128 was disabled for IFmode/ICmode. - * config/rs6000/rs6000.md (FP iterator): Do not enable IF mode if - __ibm128 is disabled. - (FLOAT128 iterator): Likewise. - * config/rs6000/rs6000.opt (x_TARGET_IBM128): New variables to - record whether __ibm128 is supported or not. - (TARGET_IBM128): Likewise. - work044.patch009: 2021-04-01 Michael Meissner <meissner@linux.ibm.com> diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 1c7cf451419..5d8775a3510 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -2571,11 +2571,6 @@ rs6000_debug_reg_global (void) TARGET_IEEEQUAD ? "IEEE" : "IBM"); fprintf (stderr, DEBUG_FMT_S, "default long double type", TARGET_IEEEQUAD_DEFAULT ? "IEEE" : "IBM"); - if (TARGET_FLOAT128_TYPE) - fprintf (stderr, DEBUG_FMT_S, "IEEE 128-bit support", - TARGET_FLOAT128_KEYWORD ? "keyword" : "type"); - if (TARGET_IBM128) - fprintf (stderr, DEBUG_FMT_S, "__ibm128 keyword", "true"); } fprintf (stderr, DEBUG_FMT_D, "sched_restricted_insns_priority", (int)rs6000_sched_restricted_insns_priority); @@ -4161,20 +4156,12 @@ rs6000_option_override_internal (bool global_init_p) rs6000_isa_flags &= ~OPTION_MASK_BLOCK_OPS_VECTOR_PAIR; } - /* Use long double size to select the appropriate long double. - - On C/C++, We use TYPE_PRECISION to differentiate the 3 different long - double types. We map 128 into the precision used for TFmode. - - Fortran does not have support for the types __float128 and __ibm128, just - the default long double type. For Fortran, we use the precision 128 for - the long double type. */ - bool is_fortran = lang_GNU_Fortran (); + /* Use long double size to select the appropriate long double. We use + TYPE_PRECISION to differentiate the 3 different long double types. We map + 128 into the precision used for TFmode. */ int default_long_double_size = (RS6000_DEFAULT_LONG_DOUBLE_SIZE == 64 ? 64 - : (is_fortran - ? 128 - : FLOAT_PRECISION_TFmode)); + : FLOAT_PRECISION_TFmode); /* Set long double size before the IEEE 128-bit tests. */ if (!global_options_set.x_rs6000_long_double_type_size) @@ -4186,7 +4173,7 @@ rs6000_option_override_internal (bool global_init_p) else rs6000_long_double_type_size = default_long_double_size; } - else if (rs6000_long_double_type_size == 128 && !is_fortran) + else if (rs6000_long_double_type_size == 128) rs6000_long_double_type_size = FLOAT_PRECISION_TFmode; else if (global_options_set.x_rs6000_ieeequad) { @@ -4217,25 +4204,17 @@ rs6000_option_override_internal (bool global_init_p) 2.32 or newer. Only issue one warning. */ static bool warned_change_long_double; - if (!warned_change_long_double) + if (!warned_change_long_double + && (!glibc_supports_ieee_128bit () + || (!lang_GNU_C () && !lang_GNU_CXX ()))) { warned_change_long_double = true; - if (is_fortran) - error ("Fortran does not support %qs to change the default " - "long double type", - (TARGET_IEEEQUAD - ? "-mabi=ieeelongdouble" - : "-mabi=ibmlongdouble")); - - else if (!glibc_supports_ieee_128bit ()) - { - if (TARGET_IEEEQUAD) - warning (OPT_Wpsabi, "Using IEEE extended precision " - "%<long double%>"); - else - warning (OPT_Wpsabi, "Using IBM extended precision " - "%<long double%>"); - } + if (TARGET_IEEEQUAD) + warning (OPT_Wpsabi, "Using IEEE extended precision " + "%<long double%>"); + else + warning (OPT_Wpsabi, "Using IBM extended precision " + "%<long double%>"); } } } @@ -4244,13 +4223,8 @@ rs6000_option_override_internal (bool global_init_p) sytems. In GCC 7, we would enable the IEEE 128-bit floating point infrastructure (-mfloat128-type) but not enable the actual __float128 type unless the user used the explicit -mfloat128. In GCC 8, we enable both - the keyword as well as the type. - - Fortran does not support separate 128-bit floating point types other than - long double, we only enable TARGET_FLOAT128_TYPE if the default long double - for Fortran is IEEE-128 bit. */ - TARGET_FLOAT128_TYPE = (TARGET_FLOAT128_ENABLE_TYPE && TARGET_VSX - && (!is_fortran || TARGET_IEEEQUAD)); + the keyword as well as the type. */ + TARGET_FLOAT128_TYPE = TARGET_FLOAT128_ENABLE_TYPE && TARGET_VSX; /* IEEE 128-bit floating point requires VSX support. */ if (TARGET_FLOAT128_KEYWORD) @@ -4264,13 +4238,6 @@ rs6000_option_override_internal (bool global_init_p) rs6000_isa_flags &= ~(OPTION_MASK_FLOAT128_KEYWORD | OPTION_MASK_FLOAT128_HW); } - else if (is_fortran) - { - if ((rs6000_isa_flags_explicit & OPTION_MASK_FLOAT128_KEYWORD) != 0) - error ("Fortran does not support %qs", "-mfloat128"); - - rs6000_isa_flags &= ~OPTION_MASK_FLOAT128_KEYWORD; - } else if (!TARGET_FLOAT128_TYPE) { TARGET_FLOAT128_TYPE = 1; @@ -4278,22 +4245,8 @@ rs6000_option_override_internal (bool global_init_p) } } - /* Whether the '__ibm128' keywork is enabled. We enable __ibm128 either if the - IEEE 128-bit floating point support is enabled or if the long double support - uses the 128-bit IBM extended double format. - - However, we don't enable __ibm128 if the language is Fortran. Fortran - doesn't have the notion of separate types for __ibm128 and __float128, and it - wants the precision for the 16 byte floating point type to be 128. With the - 3 128-bit types enabled, we use the precision field to identify the separate - types. */ - TARGET_IBM128 = (!is_fortran - && (TARGET_FLOAT128_TYPE - || (!TARGET_IEEEQUAD && TARGET_LONG_DOUBLE_128))); - - - /* Enable the __float128 keyword under Linux by default for C/C++. */ - if (TARGET_FLOAT128_TYPE && !TARGET_FLOAT128_KEYWORD && !is_fortran + /* Enable the __float128 keyword under Linux by default. */ + if (TARGET_FLOAT128_TYPE && !TARGET_FLOAT128_KEYWORD && (rs6000_isa_flags_explicit & OPTION_MASK_FLOAT128_KEYWORD) == 0) rs6000_isa_flags |= OPTION_MASK_FLOAT128_KEYWORD; @@ -11105,11 +11058,10 @@ rs6000_init_libfuncs (void) { /* __float128 support. */ if (TARGET_FLOAT128_TYPE) - init_float128_ieee (KFmode); - - /* __ibm128 support. */ - if (TARGET_IBM128) - init_float128_ibm (IFmode); + { + init_float128_ibm (IFmode); + init_float128_ieee (KFmode); + } /* AIX/Darwin/64-bit Linux quad floating point routines. */ if (TARGET_LONG_DOUBLE_128) diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h index 42489e99ace..e3fb0798622 100644 --- a/gcc/config/rs6000/rs6000.h +++ b/gcc/config/rs6000/rs6000.h @@ -334,8 +334,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); #define FLOAT128_IBM_P(MODE) \ ((!TARGET_IEEEQUAD && TARGET_LONG_DOUBLE_128 \ && ((MODE) == TFmode || (MODE) == TCmode)) \ - || (TARGET_HARD_FLOAT && TARGET_IBM128 \ - && ((MODE) == IFmode || (MODE) == ICmode))) + || (TARGET_HARD_FLOAT && ((MODE) == IFmode || (MODE) == ICmode))) /* Helper macros to say whether a 128-bit floating point type can go in a single vector register, or whether it needs paired scalar values. */ diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 6291534a4da..ca4a4d01f05 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -481,7 +481,7 @@ (SF "TARGET_HARD_FLOAT") (DF "TARGET_HARD_FLOAT") (TF "TARGET_HARD_FLOAT && TARGET_LONG_DOUBLE_128") - (IF "TARGET_HARD_FLOAT && TARGET_IBM128") + (IF "TARGET_HARD_FLOAT && TARGET_LONG_DOUBLE_128") (KF "TARGET_FLOAT128_TYPE") (DD "TARGET_DFP") (TD "TARGET_DFP")]) @@ -605,7 +605,7 @@ ; Iterator for 128-bit floating point (define_mode_iterator FLOAT128 [(KF "TARGET_FLOAT128_TYPE") - (IF "TARGET_IBM128") + (IF "TARGET_FLOAT128_TYPE") (TF "TARGET_LONG_DOUBLE_128")]) ; Iterator for signbit on 64-bit machines with direct move diff --git a/gcc/config/rs6000/rs6000.opt b/gcc/config/rs6000/rs6000.opt index 1fb2c35c1b3..0dbdf753673 100644 --- a/gcc/config/rs6000/rs6000.opt +++ b/gcc/config/rs6000/rs6000.opt @@ -112,13 +112,6 @@ unsigned char x_TARGET_FLOAT128_TYPE Variable unsigned char TARGET_FLOAT128_TYPE -;; Whether to enable the __ibm128 support -TargetSave -unsigned char x_TARGET_IBM128 - -Variable -unsigned char TARGET_IBM128 - ;; This option existed in the past, but now is always on. mpowerpc Target RejectNegative Undocumented Ignore
next reply other threads:[~2021-04-02 4:49 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-04-02 4:49 Michael Meissner [this message] 2021-04-02 16:46 Michael Meissner 2021-04-02 19:51 Michael Meissner 2021-04-02 19:53 Michael Meissner 2021-04-03 2:09 Michael Meissner 2021-04-05 21:47 Michael Meissner
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20210402044920.36B7C3857003@sourceware.org \ --to=meissner@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).