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 11:35:52AM -0800, Richard Henderson wrote:
> On Fri, Feb 03, 2006 at 03:33:23PM -0400, Aldy Hernandez wrote:
> > 	* 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.
> 
> Ok.

Hi Richard.

I have changed the ALPHA_LINUX definition for 
TARGET_ALTERNATE_LONG_DOUBLE_MANGLING as I have done for sparc.  Is this
still ok?

	* config/alpha/linux.h (TARGET_ALTERNATE_LONG_DOUBLE_MANGLING):
	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 110556)
+++ config/alpha/linux.h	(working copy)
@@ -77,3 +77,6 @@ Boston, MA 02110-1301, USA.  */
 #endif
 
 #define MD_UNWIND_SUPPORT "config/alpha/linux-unwind.h"
+
+/* Define if long doubles should be mangled as 'g'.  */
+#define TARGET_ALTERNATE_LONG_DOUBLE_MANGLING
Index: config/alpha/alpha.c
===================================================================
--- config/alpha/alpha.c	(revision 110556)
+++ config/alpha/alpha.c	(working copy)
@@ -235,6 +235,21 @@ alpha_handle_option (size_t code, const 
   return true;
 }
 
+#ifdef TARGET_ALTERNATE_LONG_DOUBLE_MANGLING
+/* 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 TARGET_ALTERNATE_LONG_DOUBLE_MANGLING
+#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]