aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/doc')
-rw-r--r--gcc/doc/extend.texi66
-rw-r--r--gcc/doc/tm.texi5
2 files changed, 69 insertions, 2 deletions
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 341d624..0d54654 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -1,5 +1,6 @@
-@c Copyright (C) 1988,1989,1992,1993,1994,1996,1998,1999,2000,2001,2002,2003,2004,2005
-@c Free Software Foundation, Inc.
+@c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1996, 1998, 1999, 2000,
+@c 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+
@c This is part of the GCC manual.
@c For copying conditions, see the file gcc.texi.
@@ -32,6 +33,7 @@ extensions, accepted by GCC in C89 mode and in C++.
* Conditionals:: Omitting the middle operand of a @samp{?:} expression.
* Long Long:: Double-word integers---@code{long long int}.
* Complex:: Data types for complex numbers.
+* Decimal Float:: Decimal Floating Point.
* Hex Floats:: Hexadecimal floating-point constants.
* Zero Length:: Zero-length arrays.
* Variable Length:: Arrays whose length is computed at run time.
@@ -813,6 +815,42 @@ If the variable's actual name is @code{foo}, the two fictitious
variables are named @code{foo$real} and @code{foo$imag}. You can
examine and set these two fictitious variables with your debugger.
+@node Decimal Float
+@section Decimal Floating Point
+@cindex decimal floating point
+@cindex @code{_Decimal32} data type
+@cindex @code{_Decimal64} data type
+@cindex @code{_Decimal128} data type
+@cindex @code{df} integer suffix
+@cindex @code{dd} integer suffix
+@cindex @code{dl} integer suffix
+@cindex @code{DF} integer suffix
+@cindex @code{DD} integer suffix
+@cindex @code{DL} integer suffix
+
+GNU C supports decimal floating point types in addition to the
+standard floating-point types. This extension supports decimal
+floating-point arithmetic as defined in IEEE-754R, the proposed
+revision of IEEE-754. The C language extension is defined in ISO/IEC
+DTR 24732, Draft 5. Support for this functionality will change when
+it is accepted into the C standard and might change for new drafts
+of the proposal. Calling conventions for any target might also change.
+Not all targets support decimal floating point.
+
+Support for decimal floating point includes the arithmetic operators
+add, subtract, multiply, divide; unary arithmetic operators;
+relational operators; equality operators; and conversions to and from
+integer and other floating-point types. Use a suffix @samp{df} or
+@samp{DF} in a literal constant of type @code{_Decimal32}, @samp{dd}
+or @samp{DD} for @code{_Decimal64}, and @samp{dl} or @samp{DL} for
+@code{_Decimal128}.
+
+Passing a decimal floating-point value as an argument to a function
+without a prototype is undefined.
+
+Types @code{_Decimal32}, @code{_Decimal64}, and @code{_Decimal128}
+are supported by the DWARF2 debug information format.
+
@node Hex Floats
@section Hex Floats
@cindex hex floats
@@ -5661,6 +5699,18 @@ Similar to @code{__builtin_huge_val}, except a warning is generated
if the target floating-point format does not support infinities.
@end deftypefn
+@deftypefn {Built-in Function} _Decimal32 __builtin_infd32 (void)
+Similar to @code{__builtin_inf}, except the return type is @code{_Decimal32}.
+@end deftypefn
+
+@deftypefn {Built-in Function} _Decimal64 __builtin_infd64 (void)
+Similar to @code{__builtin_inf}, except the return type is @code{_Decimal64}.
+@end deftypefn
+
+@deftypefn {Built-in Function} _Decimal128 __builtin_infd128 (void)
+Similar to @code{__builtin_inf}, except the return type is @code{_Decimal128}.
+@end deftypefn
+
@deftypefn {Built-in Function} float __builtin_inff (void)
Similar to @code{__builtin_inf}, except the return type is @code{float}.
This function is suitable for implementing the ISO C99 macro @code{INFINITY}.
@@ -5687,6 +5737,18 @@ This function, if given a string literal, is evaluated early enough
that it is considered a compile-time constant.
@end deftypefn
+@deftypefn {Built-in Function} _Decimal32 __builtin_nand32 (const char *str)
+Similar to @code{__builtin_nan}, except the return type is @code{_Decimal32}.
+@end deftypefn
+
+@deftypefn {Built-in Function} _Decimal64 __builtin_nand64 (const char *str)
+Similar to @code{__builtin_nan}, except the return type is @code{_Decimal64}.
+@end deftypefn
+
+@deftypefn {Built-in Function} _Decimal128 __builtin_nand128 (const char *str)
+Similar to @code{__builtin_nan}, except the return type is @code{_Decimal128}.
+@end deftypefn
+
@deftypefn {Built-in Function} float __builtin_nanf (const char *str)
Similar to @code{__builtin_nan}, except the return type is @code{float}.
@end deftypefn
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index ea57dbe..4960599 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -1421,6 +1421,11 @@ precedence for that field, but the alignment of the rest of the structure
may affect its placement.
@end deftypefn
+@deftypefn {Target Hook} {bool} TARGET_DECIMAL_FLOAT_SUPPORTED_P (void)
+Returns true if the target supports decimal floating point.
+The default version of this hook always returns false.
+@end deftypefn
+
@deftypefn {Target Hook} {const char *} TARGET_MANGLE_FUNDAMENTAL_TYPE (tree @var{type})
If your target defines any fundamental types, define this hook to
return the appropriate encoding for these types as part of a C++