public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/meissner/heads/work096)] Make __ibm128 have a distinct type and always use IFmode.
@ 2022-08-03 15:13 Michael Meissner
0 siblings, 0 replies; only message in thread
From: Michael Meissner @ 2022-08-03 15:13 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:950f236ef807c8b55933827a46ad98e0925dfb02
commit 950f236ef807c8b55933827a46ad98e0925dfb02
Author: Michael Meissner <meissner@linux.ibm.com>
Date: Wed Aug 3 11:11:47 2022 -0400
Make __ibm128 have a distinct type and always use IFmode.
This patch makes the __ibm128 use a distinct type which always uses the IFmode
instead of __ibm128 using the long double type when long double uses the IBM
128-bit encoding.
2022-08-03 Michael Meissner <meissner@linux.ibm.com>
gcc/
* config/rs6000/rs6000-builtin.cc (rs6000_init_builtins): Always create
a unique type for __ibm128 instead of using the long double type. Make
sure ibm128_float_type_node is initialized.
* config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): Do not define
__KF__ and __KC__ mode when long double uses the IEEE 128-bit encoding.
* config/rs6000/rs6000.cc (TARGET_TRANSLATE_MODE_ATTRIBUTE): Delete.
(rs6000_translate_mode_attribute): Likewise.
Diff:
---
gcc/config/rs6000/rs6000-builtin.cc | 33 +++++++++++++++------------------
gcc/config/rs6000/rs6000-c.cc | 14 +++++---------
gcc/config/rs6000/rs6000.cc | 17 -----------------
3 files changed, 20 insertions(+), 44 deletions(-)
diff --git a/gcc/config/rs6000/rs6000-builtin.cc b/gcc/config/rs6000/rs6000-builtin.cc
index f796110c14d..d3de5827156 100644
--- a/gcc/config/rs6000/rs6000-builtin.cc
+++ b/gcc/config/rs6000/rs6000-builtin.cc
@@ -709,31 +709,28 @@ rs6000_init_builtins (void)
format that uses a pair of doubles, depending on the switches and
defaults.
- If we don't support for either 128-bit IBM double double or IEEE 128-bit
- floating point, we need make sure the type is non-zero or else self-test
- fails during bootstrap.
-
- For IEEE 128-bit floating point, always create the type __ieee128. If the
- user used -mfloat128, rs6000-c.cc will create a define from __float128 to
- __ieee128. Use the standard _Float128 type even if long double uses IEEE
- 128-bit. */
+ In the past, we used to map _Float128 and __float128/__ieee128 modes into
+ TFmode if long double used the IEEE 128-bit encoding. Similarly, we used
+ to map __ibm128 into TFmode if long double used the IBM 128-bit encoding.
+
+ Now __ieee128/__float128 always uses the type for _Float128 and KFmode.
+ And __ibm128 always uses a distinct type and IFmode.
+
+ If we don't have support for either 128-bit IBM double double or IEEE
+ 128-bit floating point, we need make sure the type is non-zero or else
+ self-test fails during bootstrap. */
if (TARGET_IBM128)
{
- if (!TARGET_IEEEQUAD)
- ibm128_float_type_node = long_double_type_node;
- else
- {
- ibm128_float_type_node = make_node (REAL_TYPE);
- TYPE_PRECISION (ibm128_float_type_node) = 128;
- SET_TYPE_MODE (ibm128_float_type_node, IFmode);
- layout_type (ibm128_float_type_node);
- }
+ ibm128_float_type_node = make_node (REAL_TYPE);
+ TYPE_PRECISION (ibm128_float_type_node) = 128;
+ SET_TYPE_MODE (ibm128_float_type_node, IFmode);
+ layout_type (ibm128_float_type_node);
t = build_qualified_type (ibm128_float_type_node, TYPE_QUAL_CONST);
lang_hooks.types.register_builtin_type (ibm128_float_type_node,
"__ibm128");
}
else
- ibm128_float_type_node = NULL_TREE;
+ ibm128_float_type_node = long_double_type_node;
if (TARGET_FLOAT128_TYPE)
{
diff --git a/gcc/config/rs6000/rs6000-c.cc b/gcc/config/rs6000/rs6000-c.cc
index 437b39f23af..82379744109 100644
--- a/gcc/config/rs6000/rs6000-c.cc
+++ b/gcc/config/rs6000/rs6000-c.cc
@@ -716,16 +716,12 @@ rs6000_cpu_cpp_builtins (cpp_reader *pfile)
if (TARGET_IEEEQUAD)
{
- /* Older versions of GLIBC used __attribute__((__KC__)) to create the
- IEEE 128-bit floating point complex type for C++ (which does not
- support _Float128 _Complex). If the default for long double is
- IEEE 128-bit mode, the library would need to use
- __attribute__((__TC__)) instead. Defining __KF__ and __KC__
- is a stop-gap to build with the older libraries, until we
- get an updated library. */
+ /* In the past, we used to map __KF__ to __TF__ and __KC__ to __TC__
+ to allow older glibc code to work on systems where the long double
+ type uses the IEEE 128-bit encoding. Now that we always use
+ KFmode and KCmode for the _Float128 and __float128 types, we don't
+ need to use these defines any more. */
builtin_define ("__LONG_DOUBLE_IEEE128__");
- builtin_define ("__KF__=__TF__");
- builtin_define ("__KC__=__TC__");
}
else
builtin_define ("__LONG_DOUBLE_IBM128__");
diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
index 6dfdfebd7a6..9066bbe8850 100644
--- a/gcc/config/rs6000/rs6000.cc
+++ b/gcc/config/rs6000/rs6000.cc
@@ -1543,9 +1543,6 @@ static const struct attribute_spec rs6000_attribute_table[] =
#undef TARGET_EH_RETURN_FILTER_MODE
#define TARGET_EH_RETURN_FILTER_MODE rs6000_eh_return_filter_mode
-#undef TARGET_TRANSLATE_MODE_ATTRIBUTE
-#define TARGET_TRANSLATE_MODE_ATTRIBUTE rs6000_translate_mode_attribute
-
#undef TARGET_SCALAR_MODE_SUPPORTED_P
#define TARGET_SCALAR_MODE_SUPPORTED_P rs6000_scalar_mode_supported_p
@@ -23678,20 +23675,6 @@ rs6000_eh_return_filter_mode (void)
return TARGET_32BIT ? SImode : word_mode;
}
-/* Target hook for translate_mode_attribute. The __float128 and _Float128
- types always have a separate type and mode from the long double types.
-
- Currently __ibm128 shares the type and mode with long double if long double
- uses the IBM 128-bit encoding. */
-static machine_mode
-rs6000_translate_mode_attribute (machine_mode mode)
-{
- if (FLOAT128_IEEE_P (mode))
- return COMPLEX_MODE_P (mode) ? E_KCmode : E_KFmode;
-
- return mode;
-}
-
/* Target hook for scalar_mode_supported_p. */
static bool
rs6000_scalar_mode_supported_p (scalar_mode mode)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-08-03 15:13 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-03 15:13 [gcc(refs/users/meissner/heads/work096)] Make __ibm128 have a distinct type and always use IFmode 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).