diff options
author | Richard Sandiford <rsandifo@redhat.com> | 2002-03-07 11:37:16 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2002-03-07 11:37:16 +0000 |
commit | 71925bc04f24a40ab8ac587e08609cf91299e293 (patch) | |
tree | 74f74ccd7ea753279bc20a10577c6a90a6a4ba38 /gcc/doc | |
parent | 145d3bf292a6cfc66a6396285003765db9424a8f (diff) | |
download | gcc-71925bc04f24a40ab8ac587e08609cf91299e293.zip gcc-71925bc04f24a40ab8ac587e08609cf91299e293.tar.gz gcc-71925bc04f24a40ab8ac587e08609cf91299e293.tar.bz2 |
defaults.h (MODE_HAS_NANS, [...]): New.
* defaults.h (MODE_HAS_NANS, MODE_HAS_INFINITIES): New.
(MODE_HAS_SIGNED_ZEROS, MODE_HAS_SIGN_DEPENDENT_ROUNDING): New.
* flags.h (HONOR_NANS, HONOR_INFINITIES, HONOR_SIGNED_ZEROS): New.
(HONOR_SIGN_DEPENDENT_ROUNDING): New.
* builtins.c (expand_builtin_mathfn): Use HONOR_NANS.
* c-common.c (truthvalue_conversion): Reduce x - y != 0 to x != y
unless x and y could be infinite.
(expand_unordered_cmp): New, mostly split from expand_tree_builtin.
Check that the common type of both arguments is a real, even for
targets without unordered comparisons. Allow an integer argument
to be compared against a real.
(expand_tree_builtin): Use expand_unordered_cmp.
* combine.c (combine_simplify_rtx): Use the new HONOR_... macros.
* cse.c (fold_rtx): Likewise. Fix indentation.
* fold-const.c (fold_real_zero_addition_p): New.
(fold): Use it, and the new HONOR_... macros.
* ifcvt.c (noce_try_minmax): Use the new HONOR_... macros.
* jump.c (reversed_comparison_code_parts): After searching for
the true comparison mode, use HONOR_NANS to decide whether it
can be safely reversed.
(reverse_condition_maybe_unordered): Remove IEEE check.
* simplify-rtx.c (simplify_binary_operation): Use the new macros
to decide which simplifications are valid. Allow the following
simplifications for IEEE: (-a + b) to (b - a), (a + -b) to (a - b),
and (a - -b) to (a + b).
(simplify_relational_operation): Use HONOR_NANS.
* doc/tm.texi: Document the MODE_HAS_... macros.
From-SVN: r50401
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/tm.texi | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index 8d1a318..344c711 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -1336,6 +1336,55 @@ defined for them. The ordering of the component words of floating point values stored in memory is controlled by @code{FLOAT_WORDS_BIG_ENDIAN}. +@findex MODE_HAS_NANS +@item MODE_HAS_NANS (@var{mode}) +When defined, this macro should be true if @var{mode} has a NaN +representation. The compiler assumes that NaNs are not equal to +anything (including themselves) and that addition, subtraction, +multiplication and division all return NaNs when one operand is +NaN@. + +By default, this macro is true if @var{mode} is a floating-point +mode and the target floating-point format is IEEE@. + +@findex MODE_HAS_INFINITIES +@item MODE_HAS_INFINITIES (@var{mode}) +This macro should be true if @var{mode} can represent infinity. At +present, the compiler uses this macro to decide whether @samp{x - x} +is always defined. By default, the macro is true when @var{mode} +is a floating-point mode and the target format is IEEE@. + +@findex MODE_HAS_SIGNED_ZEROS +@item MODE_HAS_SIGNED_ZEROS (@var{mode}) +True if @var{mode} distinguishes between positive and negative zero. +The rules are expected to follow the IEEE standard: + +@itemize @bullet +@item +@samp{x + x} has the same sign as @samp{x}. + +@item +If the sum of two values with opposite sign is zero, the result is +positive for all rounding modes expect towards @minus{}infinity, for +which it is negative. + +@item +The sign of a product or quotient is negative when exactly one +of the operands is negative. +@end itemize + +The default definition is true if @var{mode} is a floating-point +mode and the target format is IEEE@. + +@findex MODE_HAS_SIGN_DEPENDENT_ROUNDING +@item MODE_HAS_SIGN_DEPENDENT_ROUNDING (@var{mode}) +If defined, this macro should be true for @var{mode} if it has at +least one rounding mode in which @samp{x} and @samp{-x} can be +rounded to numbers of different magnitude. Two such modes are +towards @minus{}infinity and towards +infinity. + +The default definition of this macro is true if @var{mode} is +a floating-point mode and the target format is IEEE@. @end table @deftypefn {Target Hook} bool TARGET_MS_BITFIELD_LAYOUT_P (tree @var{record_type}) |