Message ID | 20201120000011.GA700@ibm-toto.the-meissners.org |
---|---|
State | New |
Headers | show |
Series | PowerPC: Set long double size for IBM/IEEE. | expand |
I haven't received a replay for this patch: | Date: Thu, 19 Nov 2020 19:00:11 -0500 | Subject: [PATCH] PowerPC: Set long double size for IBM/IEEE. | Message-ID: <20201120000011.GA700@ibm-toto.the-meissners.org> | https://gcc.gnu.org/pipermail/gcc-patches/2020-November/559660.html
This patch isn't critical for IEEE 128-bit long double, but it is a feature Jonathan Wakely asked for, to have a single switch to enable IEEE/IBM 128-bit long double, without having to set the long double size. I haven't received a replay for this patch: | Date: Thu, 19 Nov 2020 19:00:11 -0500 | Subject: [PATCH] PowerPC: Set long double size for IBM/IEEE. | Message-ID: <20201120000011.GA700@ibm-toto.the-meissners.org> | https://gcc.gnu.org/pipermail/gcc-patches/2020-November/559660.html
Hi! On Thu, Nov 19, 2020 at 07:00:11PM -0500, Michael Meissner wrote: > --- a/gcc/config/rs6000/rs6000.c > +++ b/gcc/config/rs6000/rs6000.c > @@ -4131,8 +4131,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); If you do a change like this, you need to change the name of the variable. As-is, is already is not very exact, but after this change it is plain wrong. "Default size is something else than the default size if certain flags are set". Segher
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 35e9c844e17..6edd17a0b69 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -4131,8 +4131,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 3510a54c6c4..89d530f1d1e 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -27113,7 +27113,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 @@ -27122,8 +27123,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