[RFC PATCH] Optionally use -mlong-double-128 by default on {powerpc{,64},s390{,x},sparc,alpha}-linux

Mark Mitchell mark@codesourcery.com
Wed Feb 1 08:34:00 GMT 2006


Jakub Jelinek wrote:

> If we could use "g" for TFmode long double on the architectures in question
> (powerpc*-*-linux*, sparc{,v7,v8,v9}-*-linux*, s390*-*-linux* and
> alpha*-*-linux*), I'm all for that. 

I think it's a reasonable thing to do.  (Of course, if you do this, you
also have to change the demangler.)

You could implement it with the mangle_fundamental_type target hook.

However, if this is going to be common practice on lots of platforms, it
might make sense to modify write_builtin_type to do something like:

   if (type == long_double_type_node)
    write_char (targetm.mangle_fundamental_type (type));

Then, make a default version of that hook that mangles to 'e', and, for
your targets, mangle to 'g'.  Make all current versions of the hook
tail-call the default hook for cases they do not handle.  Remove the
conditional in write_builtin_type checking to see if the hook is
non-NULL, since now it will always be non-NULL.

I'm not sure which is better; what do you think?

> It would certainly help a lot for
> coexistence of C++ code with different long doubles in one app

Right.

> And it would certainly simplify the libstdc++ patch a lot as well
> and make it easier to prove that it works correctly with both "e"
> and "g" long double.

Yes.

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713



More information about the Libstdc++ mailing list