public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/meissner/heads/work032)] PowerPC: Set long double size for IBM/IEEE.
@ 2021-01-14 3:27 Michael Meissner
0 siblings, 0 replies; only message in thread
From: Michael Meissner @ 2021-01-14 3:27 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:f31378d48609c5253ecdc801a3da9ce8c573ac16
commit f31378d48609c5253ecdc801a3da9ce8c573ac16
Author: Michael Meissner <meissner@linux.ibm.com>
Date: Wed Jan 13 22:26:50 2021 -0500
PowerPC: Set long double size for IBM/IEEE.
As I was working with compilers where the long double default was 64-bit, it
became annoying to have to use two options to switch to one of the 128-bit long
double types (i.e. you need both -mlong-double-128 and the
-mabi={ieee,ibm}longdouble to switch the long double type).
I did this patch so that if you explicitly set the long double ABI via the
-mabi= option, it would automatically set the long double size if that was not
set explicitly.
gcc/
2021-01-13 Michael Meissner <meissner@linux.ibm.com>
* config/rs6000/rs6000.c (rs6000_option_override_internal): If the
user explicitly used -mabi=ieeelongdouble or -mabi=ibmlongdouble,
set the long double size to 128.
* doc/invoke.texi (PowerPC options): Document that an explicit
-mabi=ieeelongdouble or -mabi=ibmlongdouble implicitly sets
-mlong-double-128.
Diff:
---
gcc/config/rs6000/rs6000.c | 9 +++++++--
gcc/doc/invoke.texi | 7 ++++---
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index d1a817973ba..d41e31ed911 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -4135,8 +4135,13 @@ rs6000_option_override_internal (bool global_init_p)
/* 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
+ 128 into the precision used for TFmode.
+
+ If the user explicitly used -mabi=ieeelongdouble or -mabi=ibmlongdouble,
+ but the compiler was configured for default 64-bit long doubles, set the
+ long double to be 128. */
+ int default_long_double_size = ((RS6000_DEFAULT_LONG_DOUBLE_SIZE == 64
+ && !global_options_set.x_rs6000_ieeequad)
? 64
: FLOAT_PRECISION_TFmode);
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 298f1f873e3..af4b23f9a7b 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -27470,7 +27470,8 @@ Change the current ABI to use IBM extended-precision long double.
This is not likely to work if your system defaults to using IEEE
extended-precision long double. If you change the long double type
from IEEE extended-precision, the compiler will issue a warning unless
-you use the @option{-Wno-psabi} option. Requires @option{-mlong-double-128}
+you use the @option{-Wno-psabi} option. If this option is used, it
+will implicitly enable @option{-mlong-double-128}.
to be enabled.
@item -mabi=ieeelongdouble
@@ -27479,8 +27480,8 @@ Change the current ABI to use IEEE extended-precision long double.
This is not likely to work if your system defaults to using IBM
extended-precision long double. If you change the long double type
from IBM extended-precision, the compiler will issue a warning unless
-you use the @option{-Wno-psabi} option. Requires @option{-mlong-double-128}
-to be enabled.
+you use the @option{-Wno-psabi} option. If this option is used, it
+will implicitly enable @option{-mlong-double-128}.
@item -mabi=elfv1
@opindex mabi=elfv1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-01-14 3:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-14 3:27 [gcc(refs/users/meissner/heads/work032)] PowerPC: Set long double size for IBM/IEEE 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).