diff options
author | Uros Bizjak <ubizjak@gmail.com> | 2007-07-03 07:53:58 +0200 |
---|---|---|
committer | Uros Bizjak <uros@gcc.gnu.org> | 2007-07-03 07:53:58 +0200 |
commit | c77cd3d140cbf8fa02a5383c3d1f6afabe7a33c3 (patch) | |
tree | e606116f129427fd27bb72ba8a7b9932d86c2880 /gcc/doc | |
parent | 1ed50f7194d46aa97af8072b0da2bcd68f906488 (diff) | |
download | gcc-c77cd3d140cbf8fa02a5383c3d1f6afabe7a33c3.zip gcc-c77cd3d140cbf8fa02a5383c3d1f6afabe7a33c3.tar.gz gcc-c77cd3d140cbf8fa02a5383c3d1f6afabe7a33c3.tar.bz2 |
cpplib.h (CPP_N_WIDTH_MD, [...]): Add new constants.
libcpp/ChangeLog:
* include/cpplib.h (CPP_N_WIDTH_MD, CPP_N_MD_W, CPP_N_MD_Q):
Add new constants.
* expr.c (interpret_float_suffix): Process 'w', 'W', 'q' and 'Q'
suffixes. Return CPP_N_MD_W for 'w' or 'W' suffixes and CPP_N_MD_Q
for 'q' or 'Q' suffixes.
gcc/ChangeLog:
* targhooks.h (default_mode_for_suffix): New function declaration.
* targhooks.c (default_mode_for_suffix): New default target hook.
* target.h (struct c): New structure in the targetm struct.
(mode_for_suffix): New target hook as part of struct c.
target-def.h (TARGET_C_MODE_FOR_SUFFIX): Define as
default_mode_for_suffix.
(TARGET_C): New define.
* c-lex.c: Include "target.h".
(interpret_float): Use targetm.c.mode_for_suffix to determine
the mode for a given non-standard suffix.
Makefile.in (c-lex.o): Depend on $(TARGET_H).
* config/i386/i386.c (ix86_c_mode_for_suffix): New static function.
(TARGET_C_MODE_FOR_SUFFIX): Define to ix86_c_mode_for_suffix.
* doc/extend.texi (Floating Types): New node. Document __float80 and
__float128 types. Document 'w', 'W', 'q' and 'Q' suffixes.
testsuite/ChangeLog:
* gcc.dg/const-float80.c : New test.
* gcc.dg/const-float128.c : New test.
* gcc.dg/const-float80-ped.c : New test.
* gcc.dg/const-float128-ped.c : New test.
From-SVN: r126244
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/extend.texi | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 76cc546f..0a1cdeb 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -33,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. +* Floating Types:: Additional Floating Types. * Decimal Float:: Decimal Floating Types. * Hex Floats:: Hexadecimal floating-point constants. * Zero Length:: Zero-length arrays. @@ -816,6 +817,37 @@ 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 Floating Types +@section Additional Floating Types +@cindex additional floating types +@cindex @code{__float80} data type +@cindex @code{__float128} data type +@cindex @code{w} floating point suffix +@cindex @code{q} floating point suffix +@cindex @code{W} floating point suffix +@cindex @code{Q} floating point suffix + +As an extension, the GNU C compiler supports additional floating +types, @code{__float80} and @code{__float128} to support 80bit +(@code{XFmode}) and 128 bit (@code{TFmode}) floating types. +Support for 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} +in a literal constant of type @code{__float80} and @samp{q} or @samp{Q} +for @code{_float128}. You can declare complex types using the +corresponding internal complex type, @code{XCmode} for @code{__float80} +type and @code{TCmode} for @code{__float128} type: + +@smallexample +typedef _Complex float __attribute__((mode(TC))) _Complex128; +typedef _Complex float __attribute__((mode(XC))) _Complex80; +@end smallexample + +Not all targets support additional floating point types. @code{__float80} +is supported on i386, x86_64 and ia64 targets and target @code{__float128} +is supported on x86_64 and ia64 targets. + @node Decimal Float @section Decimal Floating Types @cindex decimal floating types |