This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: patch: Optionally use -mlong-double-128 by default on alpha-linux


On Fri, Feb 03, 2006 at 08:10:02AM -0700, Roger Sayle wrote:
> 
> On Fri, 3 Feb 2006, Aldy Hernandez wrote:
> > 	* config/alpha/alpha.h (ALPHA_LINUX): Define.
> 
> If you moved this declaration to config/alpha/linux.h, it wouldn't need
> to be #undef'd in vms.h, osf.h, netbsd.h, openbsd.h, gnu.h, unicosmk.h :-)

Doh.  Fixed.  I also conditionalized the existence of the mangling function
on ALPHA_LINUX.

How does this look Richard?

	* config/alpha/linux.h (ALPHA_LINUX): Define.

	* config/alpha/alpha.c (override_options): Handle
	TARGET_DEFAULT_LONG_DOUBLE_128.
	(TARGET_MANGLE_FUNDAMENTAL_TYPE): Define.
	(alpha_mangle_fundamental_type): New.

Index: config/alpha/linux.h
===================================================================
--- config/alpha/linux.h	(revision 110515)
+++ config/alpha/linux.h	(working copy)
@@ -77,3 +77,5 @@ Boston, MA 02110-1301, USA.  */
 #endif
 
 #define MD_UNWIND_SUPPORT "config/alpha/linux-unwind.h"
+
+#define ALPHA_LINUX
Index: config/alpha/alpha.c
===================================================================
--- config/alpha/alpha.c	(revision 110515)
+++ config/alpha/alpha.c	(working copy)
@@ -235,6 +235,21 @@ alpha_handle_option (size_t code, const 
   return true;
 }
 
+#ifdef ALPHA_LINUX
+/* Implement TARGET_MANGLE_FUNDAMENTAL_TYPE.  */
+
+static const char *
+alpha_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
+
 /* Parse target option strings.  */
 
 void
@@ -501,6 +516,11 @@ override_options (void)
       REAL_MODE_FORMAT (DFmode) = &vax_g_format;
       REAL_MODE_FORMAT (TFmode) = NULL;
     }
+
+#ifdef TARGET_DEFAULT_LONG_DOUBLE_128
+  if (!(target_flags_explicit & MASK_LONG_DOUBLE_128))
+    target_flags |= MASK_LONG_DOUBLE_128;
+#endif
 }
 
 /* Returns 1 if VALUE is a mask that contains full bytes of zero or ones.  */
@@ -10722,6 +10742,11 @@ alpha_init_libfuncs (void)
 #undef TARGET_HANDLE_OPTION
 #define TARGET_HANDLE_OPTION alpha_handle_option
 
+#ifdef ALPHA_LINUX
+#undef TARGET_MANGLE_FUNDAMENTAL_TYPE
+#define TARGET_MANGLE_FUNDAMENTAL_TYPE alpha_mangle_fundamental_type
+#endif
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]