This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
patch: Optionally use -mlong-double-128 by default on s390
- From: Aldy Hernandez <aldyh at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org, jakub at redhat dot com
- Date: Fri, 3 Feb 2006 16:15:01 -0400
- Subject: patch: Optionally use -mlong-double-128 by default on s390
Same herb, different name.
Herein lie the s390 bits.
OK?
* config/s390/s390.c (override_options): Handle
TARGET_DEFAULT_LONG_DOUBLE_128.
(TARGET_MANGLE_FUNDAMENTAL_TYPE): Define.
(s390_mangle_fundamental_type): New.
* config/s390/linux.h (S390_LINUX): Define.
Index: config/s390/s390.c
===================================================================
--- config/s390/s390.c (revision 110556)
+++ config/s390/s390.c (working copy)
@@ -1415,6 +1415,11 @@ override_options (void)
}
else if (s390_stack_guard)
error ("-mstack-guard implies use of -mstack-size");
+
+#ifdef TARGET_DEFAULT_LONG_DOUBLE_128
+ if (!(target_flags_explicit & MASK_LONG_DOUBLE_128))
+ target_flags |= MASK_LONG_DOUBLE_128;
+#endif
}
/* Map for smallest class containing reg regno. */
@@ -4293,6 +4298,21 @@ s390_output_dwarf_dtprel (FILE *file, in
fputs ("@DTPOFF", file);
}
+#ifdef S390_LINUX
+/* Implement TARGET_MANGLE_FUNDAMENTAL_TYPE. */
+
+static const char *
+s390_mangle_fundamental_type (tree type)
+{
+ if (TYPE_MAIN_VARIANT (type) == long_double_type_node
+ && TARGET_LONG_DOUBLE_128)
+ return "g";
+
+ /* For all other types, use normal C++ mangling. */
+ return NULL;
+}
+#endif
+
/* In the name of slightly smaller debug output, and to cater to
general assembler lossage, recognize various UNSPEC sequences
and turn them back into a direct symbol reference. */
@@ -9185,6 +9205,11 @@ s390_reorg (void)
#define TARGET_ASM_OUTPUT_DWARF_DTPREL s390_output_dwarf_dtprel
#endif
+#ifdef S390_LINUX
+#undef TARGET_MANGLE_FUNDAMENTAL_TYPE
+#define TARGET_MANGLE_FUNDAMENTAL_TYPE s390_mangle_fundamental_type
+#endif
+
struct gcc_target targetm = TARGET_INITIALIZER;
#include "gt-s390.h"
Index: config/s390/linux.h
===================================================================
--- config/s390/linux.h (revision 110556)
+++ config/s390/linux.h (working copy)
@@ -95,4 +95,6 @@ Software Foundation, 51 Franklin Street,
#define TARGET_THREAD_SSP_OFFSET (TARGET_64BIT ? 0x28 : 0x14)
#endif
+#define S390_LINUX
+
#endif