aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSegher Boessenkool <segher@kernel.crashing.org>2018-06-01 20:46:23 +0200
committerSegher Boessenkool <segher@gcc.gnu.org>2018-06-01 20:46:23 +0200
commit560a1dc6ed5df6430e315f539716ab93419e8db9 (patch)
treef94be7a17d25622029b98f16240db8b8ec8002d2
parentddd3e26e42b8d55989f9964c6ec6ee50b30b1802 (diff)
downloadgcc-560a1dc6ed5df6430e315f539716ab93419e8db9.zip
gcc-560a1dc6ed5df6430e315f539716ab93419e8db9.tar.gz
gcc-560a1dc6ed5df6430e315f539716ab93419e8db9.tar.bz2
rs6000: Fix mangling for 128-bit float
This patch changes the (C++) mangling of the 128-bit float types. IBM long double ("double-double") is mangled as "g", as before, and IEEE 128-bit long double is mangled as "u9__ieee128". * config/rs6000/rs6000.c (rs6000_mangle_type): Change the mangling of the 128-bit floating point types. Fix function comment. From-SVN: r261078
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/rs6000/rs6000.c31
2 files changed, 12 insertions, 24 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 24cf22e..e064d58 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2018-06-01 Segher Boessenkool <segher@kernel.crashing.org>
+
+ * config/rs6000/rs6000.c (rs6000_mangle_type): Change the mangling of
+ the 128-bit floating point types. Fix function comment.
+
2018-06-01 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* config/aarch64/aarch64-simd.md
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 26d58fc..c5c9821 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -32095,8 +32095,9 @@ rs6000_handle_altivec_attribute (tree *node,
return NULL_TREE;
}
-/* AltiVec defines four built-in scalar types that serve as vector
- elements; we must teach the compiler how to mangle them. */
+/* AltiVec defines five built-in scalar types that serve as vector
+ elements; we must teach the compiler how to mangle them. The 128-bit
+ floating point mangling is target-specific as well. */
static const char *
rs6000_mangle_type (const_tree type)
@@ -32113,30 +32114,12 @@ rs6000_mangle_type (const_tree type)
if (type == bool_int_type_node) return "U6__booli";
if (type == bool_long_long_type_node) return "U6__boolx";
- /* Use a unique name for __float128 rather than trying to use "e" or "g". Use
- "g" for IBM extended double, no matter whether it is long double (using
- -mabi=ibmlongdouble) or the distinct __ibm128 type. */
- if (TARGET_FLOAT128_TYPE)
- {
- if (type == ieee128_float_type_node)
- return "U10__float128";
-
- if (type == ibm128_float_type_node)
- return "u8__ibm128";
-
- if (TARGET_LONG_DOUBLE_128 && type == long_double_type_node)
- return (TARGET_IEEEQUAD) ? "U10__float128" : "g";
- }
-
- /* Mangle IBM extended float long double as `g' (__float128) on
- powerpc*-linux where long-double-64 previously was the default. */
- if (TYPE_MAIN_VARIANT (type) == long_double_type_node
- && TARGET_ELF
- && TARGET_LONG_DOUBLE_128
- && !TARGET_IEEEQUAD)
+ if (SCALAR_FLOAT_TYPE_P (type) && FLOAT128_IBM_P (TYPE_MODE (type)))
return "g";
+ if (SCALAR_FLOAT_TYPE_P (type) && FLOAT128_IEEE_P (TYPE_MODE (type)))
+ return "u9__ieee128";
- /* For all other types, use normal C++ mangling. */
+ /* For all other types, use the default mangling. */
return NULL;
}