PATCH: Add -mlong-double-128 and make it default for 64-bit Bionic
H.J. Lu
hjl.tools@gmail.com
Mon Feb 3 15:51:00 GMT 2014
On Fri, Jan 31, 2014 at 10:19:12AM -0800, H.J. Lu wrote:
> On Fri, Jan 31, 2014 at 10:12 AM, Joseph S. Myers
> <joseph@codesourcery.com> wrote:
> > On Fri, 31 Jan 2014, Andrew Pinski wrote:
> >
> >> On Fri, Jan 31, 2014 at 5:59 AM, H.J. Lu <hongjiu.lu@intel.com> wrote:
> >> > Hi,
> >> >
> >> > For 64-bit Android, long double is 128-bit IEEE-754 floating point type.
> >> > This patch adds -mlong-double-128 to i386 and makes it default for 64-bit
> >> > Bionic. I only added MASK_LONG_DOUBLE_128. I made -mlong-double-128,
> >> > -mlong-double-64 and -mlong-double-80 negate each other so that the
> >> > last one on command line wins. It os OK since we don't support
> >> > -mlong-double-xxx in target attribute. I added some testcases to verify
> >> > it works correctly. OK for trunk?
> >>
> >> I don't see any where in the documentation that explains the
> >> difference between -mlong-double-128 and -m128bit-long-double. Can
> >> you please add that -mlong-double-128 causes soft-floating point.
>
> I will update it together with -m128bit-long-double clarification.
>
> >> Also what about the interactions between these two options.
>
> They have nothing to do with each other. -m128bit-long-double
> controls the storage size of __float80 amd -mlong-double-XXX
> controls the size of long double, 64, 80 and 128 bits.
I checked in my patch. Here is a patch to update invoke.texi. OK
for trunk?
Thanks.
H.J.
---
2014-02-03 H.J. Lu <hongjiu.lu@intel.com>
* doc/invoke.texi: Document -m96bit-long-double/-m128bit-long-double
for the storage size of 80-bit long double. Mention software
floating-point for __float128.
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 89e80ac..e2193a9 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -15027,28 +15027,28 @@ without that switch.
@itemx -m128bit-long-double
@opindex m96bit-long-double
@opindex m128bit-long-double
-These switches control the size of @code{long double} type. The i386
-application binary interface specifies the size to be 96 bits,
+These switches control the storage size of 80-bit @code{long double} type.
+The i386 application binary interface specifies the size to be 96 bits,
so @option{-m96bit-long-double} is the default in 32-bit mode.
-Modern architectures (Pentium and newer) prefer @code{long double}
+Modern architectures (Pentium and newer) prefer 80-bit @code{long double}
to be aligned to an 8- or 16-byte boundary. In arrays or structures
conforming to the ABI, this is not possible. So specifying
-@option{-m128bit-long-double} aligns @code{long double}
-to a 16-byte boundary by padding the @code{long double} with an additional
-32-bit zero.
+@option{-m128bit-long-double} aligns 80-bit @code{long double}
+to a 16-byte boundary by padding the 80-bit @code{long double} with an
+additional 32-bit zero.
In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
-its ABI specifies that @code{long double} is aligned on 16-byte boundary.
+its ABI specifies that 80-bit @code{long double} is aligned on 16-byte boundary.
Notice that neither of these options enable any extra precision over the x87
-standard of 80 bits for a @code{long double}.
+standard of 80 bits for an 80-bit @code{long double}.
@strong{Warning:} if you override the default value for your target ABI, this
changes the size of
-structures and arrays containing @code{long double} variables,
+structures and arrays containing 80-bit @code{long double} variables,
as well as modifying the function calling convention for functions taking
-@code{long double}. Hence they are not binary-compatible
+80-bit @code{long double}. Hence they are not binary-compatible
with code compiled without that switch.
@item -mlong-double-64
@@ -15061,7 +15061,8 @@ These switches control the size of @code{long double} type. A size
of 64 bits makes the @code{long double} type equivalent to the @code{double}
type. This is the default for 32-bit Bionic C library. A size
of 128 bits makes the @code{long double} type equivalent to the
-@code{__float128} type. This is the default for 64-bit Bionic C library.
+@code{__float128} type, which is implemented with software floating-point
+support. This is the default for 64-bit Bionic C library.
@strong{Warning:} if you override the default value for your target ABI, this
changes the size of
More information about the Gcc-patches
mailing list