r185572 - Dont define __LONG_DOUBLE_128__ unless LongDoubleWidth is really 128bits width.

Eli Friedman eli.friedman at gmail.com
Wed Jul 3 13:26:50 PDT 2013


On Wed, Jul 3, 2013 at 1:04 PM, Bill Schmidt <wschmidt at linux.vnet.ibm.com>wrote:

> On Wed, 2013-07-03 at 19:45 +0000, Roman Divacky wrote:
> > Author: rdivacky
> > Date: Wed Jul  3 14:45:54 2013
> > New Revision: 185572
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=185572&view=rev
> > Log:
> > Dont define __LONG_DOUBLE_128__ unless LongDoubleWidth is really 128bits
> width.
> > It's not the case on ie. FreeBSD.
> >
> > Modified:
> >     cfe/trunk/lib/Basic/Targets.cpp
> >     cfe/trunk/test/Preprocessor/init.c
> >
> > Modified: cfe/trunk/lib/Basic/Targets.cpp
> > URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=185572&r1=185571&r2=185572&view=diff
> >
> ==============================================================================
> > --- cfe/trunk/lib/Basic/Targets.cpp (original)
> > +++ cfe/trunk/lib/Basic/Targets.cpp Wed Jul  3 14:45:54 2013
> > @@ -877,7 +877,8 @@ void PPCTargetInfo::getTargetDefines(con
> >    Builder.defineMacro("__REGISTER_PREFIX__", "");
> >
> >    // FIXME: Should be controlled by command line option.
> > -  Builder.defineMacro("__LONG_DOUBLE_128__");
> > +  if (LongDoubleWidth == 128)
> > +    Builder.defineMacro("__LONG_DOUBLE_128__");
>
> Since long double is 64 bits on FreeBSD, it seems somewhat odd that
> there is an f128:64:64 triple in its data layout string.  I assume that
> is harmless, but I don't know enough about the uses of the data layout
> strings to be sure...
>

It's harmless, but should be removed: if long double is 64 bits, clang will
never generate an f128.

-Eli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130703/11f0378d/attachment.html>


More information about the cfe-commits mailing list