diff mbox

[doc] Revise GCC manual section 6.11, Additional Floating Types

Message ID 133e26a4-859f-7c54-61b0-bf3a1b484140@linux.vnet.ibm.com
State New
Headers show

Commit Message

Bill Schmidt March 9, 2017, 10:52 p.m. UTC
Hi,

Section 6.11 of the GCC manual (Additional Floating Types) has been
updated numerous times for this release and has become a little
disorderly.  This patch attempts to reorganize the material in this
section to flow more naturally, remove caveats that are no longer
true, and generally avoid confusion.  I hope that I haven't introduced
any errors with the change in language, but please keep me honest.
I'm happy for any additional wordsmithing advice.

The one statement I've made that I'm not quite confident is that
__float128 is an alias for _Float64x on hppa HP-UX.  This was not
clear in the original text, so I'd appreciate confirmation or
correction on this point.

The PDF seems to build properly and I don't see any visible errors.
Is this ok for trunk?

Thanks,
Bill


2017-03-09  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* doc/extend.texi (6.11 Additional Floating Types): Revise.

Comments

Joseph Myers March 11, 2017, 12:52 a.m. UTC | #1
On Thu, 9 Mar 2017, Bill Schmidt wrote:

> The one statement I've made that I'm not quite confident is that
> __float128 is an alias for _Float64x on hppa HP-UX.  This was not
> clear in the original text, so I'd appreciate confirmation or
> correction on this point.

It can't simultaneously be an alias for _Float128 and _Float64x (those are 
always distinct types, which may or may not be ABI-equivalent).

Actually, in pa/pa.c, __float128 is defined as an alias for long double 
(not _Float128 or _Float64x).  On x86/x86_64, and powerpc (when 
supported), and non-HP-UX ia64, it's an alias for _Float128; on ia64-hpux 
it's an alias for long double.

> +@itemize @bullet
> +@item @code{__float128} is available on i386, x86_64, IA-64, and
> +hppa HP-UX, as well as on PowerPC 64-bit Linux targets that enable

"GNU/Linux".

> +@code{_Float64} and @code{Float32x} types are supported on all systems

@code{_Float32x} (pre-existing issue).

> +@code{TFmode} maps to a 128-bit floating-point type, which is usually
> +@code{__float128}.  On PowerPC, where a transition is underway for
> +@code{long double} from the @code{__ibm128} type to @code{__float128}
> +in future releases, @code{TFmode} refers to the type that represents
> +@code{long double} during compilation.  @code{KFmode} is always
> +@code{__float128}, @code{IFmode} is always @code{__ibm128}, and @code{TFmode}
> +will always be one or the other.

Machine modes are largely an implementation detail (only user-visible 
using the mode attribute); I'm not convinced this documentation belongs 
here at all (although a limited amount of documentation of declaring with 
mode attributes is needed to describe how to declare the complex ibm128 
type).
diff mbox

Patch

Index: gcc/doc/extend.texi
===================================================================
--- gcc/doc/extend.texi	(revision 246014)
+++ gcc/doc/extend.texi	(working copy)
@@ -948,10 +948,27 @@  names can be used together with @code{_Complex} to
 types.
 
 As an extension, GNU C and GNU C++ support additional floating
-types, @code{__float80} and @code{__float128} to support 80-bit
-(@code{XFmode}) and 128-bit (@code{TFmode}) floating types; these are
-aliases for the type names @code{_Float64x} and @code{_Float128}.
-Support for additional types includes the arithmetic operators:
+types, which are not supported by all targets.
+@itemize @bullet
+@item @code{__float128} is available on i386, x86_64, IA-64, and
+hppa HP-UX, as well as on PowerPC 64-bit Linux targets that enable
+the vector scalar (VSX) instruction set.  @code{__float128} supports
+the 128-bit floating type, and is an alias for the type name
+@code{_Float128}.  On PowerPC and hppa HP-UX, it is also an alias for
+the type name @code{_Float64x}.
+
+@item @code{__float80} is available on the i386, x86_64, and IA-64
+targets, and supports the 80-bit (@code{XFmode}) floating type.  It is
+an alias for the type name @code{_Float64x} on these targets.
+
+@item @code{__ibm128} is available on PowerPC targets, and provides
+access to the IBM extended double format which is the current format
+used for @code{long double}.  When @code{long double} transitions to
+@code{__float128} on PowerPC in the future, @code{__ibm128} will remain
+for use in conversions between the two types.
+@end itemize
+
+Support for these additional types includes the arithmetic operators:
 add, subtract, multiply, divide; unary arithmetic operators;
 relational operators; equality operators; and conversions to and from
 integer and other floating types.  Use a suffix @samp{w} or @samp{W}
@@ -958,6 +975,30 @@  integer and other floating types.  Use a suffix @s
 in a literal constant of type @code{__float80} or type
 @code{__ibm128}.  Use a suffix @samp{q} or @samp{Q} for @code{_float128}.
 
+In order to use @code{_Float128}, @code{__float128}, and @code{__ibm128}
+on PowerPC Linux systems, you must use the @option{-mfloat128} option. It is
+expected in future versions of GCC that @code{_Float128} and @code{__float128}
+will be enabled automatically.
+
+The @code{_Float128} type is supported on all systems where
+@code{__float128} is supported or where @code{long double} has the
+IEEE binary128 format.  The @code{_Float64x} type is supported on all
+systems where @code{__float128} is supported.  The @code{_Float32}
+type is supported on all systems supporting IEEE binary32; the
+@code{_Float64} and @code{Float32x} types are supported on all systems
+supporting IEEE binary64.  The @code{_Float16} type is supported on AArch64
+systems by default, and on ARM systems when the IEEE format for 16-bit
+floating-point types is selected with @option{-mfp16-format=ieee}.
+GCC does not currently support @code{_Float128x} on any systems.
+
+@code{TFmode} maps to a 128-bit floating-point type, which is usually
+@code{__float128}.  On PowerPC, where a transition is underway for
+@code{long double} from the @code{__ibm128} type to @code{__float128}
+in future releases, @code{TFmode} refers to the type that represents
+@code{long double} during compilation.  @code{KFmode} is always
+@code{__float128}, @code{IFmode} is always @code{__ibm128}, and @code{TFmode}
+will always be one or the other.
+
 On the i386, x86_64, IA-64, and HP-UX targets, you can declare complex
 types using the corresponding internal complex type, @code{XCmode} for
 @code{__float80} type and @code{TCmode} for @code{__float128} type:
@@ -967,16 +1008,6 @@  typedef _Complex float __attribute__((mode(TC))) _
 typedef _Complex float __attribute__((mode(XC))) _Complex80;
 @end smallexample
 
-In order to use @code{_Float128}, @code{__float128} and
-@code{__ibm128} on PowerPC Linux
-systems, you must use the @option{-mfloat128}. It is expected in
-future versions of GCC that @code{_Float128} and @code{__float128}
-will be enabled
-automatically.  In addition, there are currently problems in using the
-complex @code{__float128} type.  When these problems are fixed, you
-would use the following syntax to declare @code{_Complex128} to be a
-complex @code{__float128} type:
-
 On the PowerPC Linux VSX targets, you can declare complex types using
 the corresponding internal complex type, @code{KCmode} for
 @code{__float128} type and @code{ICmode} for @code{__ibm128} type:
@@ -986,27 +1017,6 @@  typedef _Complex float __attribute__((mode(KC))) _
 typedef _Complex float __attribute__((mode(IC))) _Complex_ibm128;
 @end smallexample
 
-Not all targets support additional floating-point types.
-@code{__float80} and @code{__float128} types are supported on x86 and
-IA-64 targets.  The @code{__float128} type is supported on hppa HP-UX.
-The @code{__float128} type is supported on PowerPC 64-bit Linux
-systems by default if the vector scalar instruction set (VSX) is
-enabled.  The @code{_Float128} type is supported on all systems where
-@code{__float128} is supported or where @code{long double} has the
-IEEE binary128 format.  The @code{_Float64x} type is supported on all
-systems where @code{__float128} is supported.  The @code{_Float32}
-type is supported on all systems supporting IEEE binary32; the
-@code{_Float64} and @code{Float32x} types are supported on all systems
-supporting IEEE binary64.  The @code{_Float16} type is supported on AArch64
-systems by default, and on ARM systems when the IEEE format for 16-bit
-floating-point types is selected with @option{-mfp16-format=ieee}.
-GCC does not currently support @code{_Float128x} on any systems.
-
-On the PowerPC, @code{__ibm128} provides access to the IBM extended
-double format, and it is intended to be used by the library functions
-that handle conversions if/when long double is changed to be IEEE
-128-bit floating point.
-
 @node Half-Precision
 @section Half-Precision Floating Point
 @cindex half-precision floating point