Commit 29d64660 by Roger Sayle Committed by Roger Sayle

c-tree.texi (Expressions): Document FLOOR_DIV_EXPR...


	* doc/c-tree.texi (Expressions): Document FLOOR_DIV_EXPR,
	CEIL_DIV_EXPR, ROUND_DIV_EXPR, FLOOR_MOD_EXPR, CEIL_MOD_EXPR,
	ROUND_MOD_EXPR, EXACT_DIV_EXPR.  Improve documentation of
	TRUNC_DIV_EXPR, TRUNC_MOD_EXPR and comparison operations.
	Add missing (but documented) tree nodes to the index.

From-SVN: r82467
parent 96b8a615
2004-05-30 Roger Sayle <roger@eyesopen.com>
* doc/c-tree.texi (Expressions): Document FLOOR_DIV_EXPR,
CEIL_DIV_EXPR, ROUND_DIV_EXPR, FLOOR_MOD_EXPR, CEIL_MOD_EXPR,
ROUND_MOD_EXPR, EXACT_DIV_EXPR. Improve documentation of
TRUNC_DIV_EXPR, TRUNC_MOD_EXPR and comparison operations.
Add missing (but documented) tree nodes to the index.
2004-05-30 Steven Bosscher <stevenb@suse.de> 2004-05-30 Steven Bosscher <stevenb@suse.de>
PR tree-optimization/14819 PR tree-optimization/14819
......
...@@ -1692,6 +1692,7 @@ This macro returns the attributes on the type @var{type}. ...@@ -1692,6 +1692,7 @@ This macro returns the attributes on the type @var{type}.
@node Expression trees @node Expression trees
@section Expressions @section Expressions
@cindex expression @cindex expression
@findex TREE_TYPE
@findex TREE_OPERAND @findex TREE_OPERAND
@tindex INTEGER_CST @tindex INTEGER_CST
@findex TREE_INT_CST_HIGH @findex TREE_INT_CST_HIGH
...@@ -1712,6 +1713,10 @@ This macro returns the attributes on the type @var{type}. ...@@ -1712,6 +1713,10 @@ This macro returns the attributes on the type @var{type}.
@tindex ABS_EXPR @tindex ABS_EXPR
@tindex BIT_NOT_EXPR @tindex BIT_NOT_EXPR
@tindex TRUTH_NOT_EXPR @tindex TRUTH_NOT_EXPR
@tindex PREDECREMENT_EXPR
@tindex PREINCREMENT_EXPR
@tindex POSTDECREMENT_EXPR
@tindex POSTINCREMENT_EXPR
@tindex ADDR_EXPR @tindex ADDR_EXPR
@tindex INDIRECT_REF @tindex INDIRECT_REF
@tindex FIX_TRUNC_EXPR @tindex FIX_TRUNC_EXPR
...@@ -1720,6 +1725,7 @@ This macro returns the attributes on the type @var{type}. ...@@ -1720,6 +1725,7 @@ This macro returns the attributes on the type @var{type}.
@tindex CONJ_EXPR @tindex CONJ_EXPR
@tindex REALPART_EXPR @tindex REALPART_EXPR
@tindex IMAGPART_EXPR @tindex IMAGPART_EXPR
@tindex NON_LVALUE_EXPR
@tindex NOP_EXPR @tindex NOP_EXPR
@tindex CONVERT_EXPR @tindex CONVERT_EXPR
@tindex THROW_EXPR @tindex THROW_EXPR
...@@ -1736,35 +1742,48 @@ This macro returns the attributes on the type @var{type}. ...@@ -1736,35 +1742,48 @@ This macro returns the attributes on the type @var{type}.
@tindex PLUS_EXPR @tindex PLUS_EXPR
@tindex MINUS_EXPR @tindex MINUS_EXPR
@tindex MULT_EXPR @tindex MULT_EXPR
@tindex RDIV_EXPR
@tindex TRUNC_DIV_EXPR @tindex TRUNC_DIV_EXPR
@tindex FLOOR_DIV_EXPR
@tindex CEIL_DIV_EXPR
@tindex ROUND_DIV_EXPR
@tindex TRUNC_MOD_EXPR @tindex TRUNC_MOD_EXPR
@tindex RDIV_EXPR @tindex FLOOR_MOD_EXPR
@tindex CEIL_MOD_EXPR
@tindex ROUND_MOD_EXPR
@tindex EXACT_DIV_EXPR
@tindex ARRAY_REF
@tindex ARRAY_RANGE_REF
@tindex LT_EXPR @tindex LT_EXPR
@tindex LE_EXPR @tindex LE_EXPR
@tindex GT_EXPR @tindex GT_EXPR
@tindex GE_EXPR @tindex GE_EXPR
@tindex EQ_EXPR @tindex EQ_EXPR
@tindex NE_EXPR @tindex NE_EXPR
@tindex ORDERED_EXPR
@tindex UNORDERED_EXPR
@tindex UNLT_EXPR @tindex UNLT_EXPR
@tindex UNLE_EXPR @tindex UNLE_EXPR
@tindex UNGT_EXPR @tindex UNGT_EXPR
@tindex UNGE_EXPR @tindex UNGE_EXPR
@tindex UNEQ_EXPR @tindex UNEQ_EXPR
@tindex LTGT_EXPR @tindex LTGT_EXPR
@tindex INIT_EXPR
@tindex MODIFY_EXPR @tindex MODIFY_EXPR
@tindex INIT_EXPR
@tindex COMPONENT_REF @tindex COMPONENT_REF
@tindex COMPOUND_EXPR @tindex COMPOUND_EXPR
@tindex COND_EXPR @tindex COND_EXPR
@tindex CALL_EXPR @tindex CALL_EXPR
@tindex CONSTRUCTOR
@tindex COMPOUND_LITERAL_EXPR
@tindex STMT_EXPR @tindex STMT_EXPR
@tindex BIND_EXPR @tindex BIND_EXPR
@tindex LOOP_EXPR @tindex LOOP_EXPR
@tindex EXIT_EXPR @tindex EXIT_EXPR
@tindex CLEANUP_POINT_EXPR @tindex CLEANUP_POINT_EXPR
@tindex ARRAY_REF @tindex CONSTRUCTOR
@tindex COMPOUND_LITERAL_EXPR
@tindex SAVE_EXPR
@tindex TARGET_EXPR
@tindex AGGR_INIT_EXPR
@tindex VTABLE_REF @tindex VTABLE_REF
@tindex VA_ARG_EXPR @tindex VA_ARG_EXPR
...@@ -2063,25 +2082,50 @@ not matter. ...@@ -2063,25 +2082,50 @@ not matter.
@itemx PLUS_EXPR @itemx PLUS_EXPR
@itemx MINUS_EXPR @itemx MINUS_EXPR
@itemx MULT_EXPR @itemx MULT_EXPR
@itemx TRUNC_DIV_EXPR
@itemx TRUNC_MOD_EXPR
@itemx RDIV_EXPR
These nodes represent various binary arithmetic operations. These nodes represent various binary arithmetic operations.
Respectively, these operations are addition, subtraction (of the second Respectively, these operations are addition, subtraction (of the second
operand from the first), multiplication, integer division, integer operand from the first) and multiplication. Their operands may have
remainder, and floating-point division. The operands to the first three either integral or floating type, but there will never be case in which
of these may have either integral or floating type, but there will never one operand is of floating type and the other is of integral type.
be case in which one operand is of floating type and the other is of
integral type.
The result of a @code{TRUNC_DIV_EXPR} is always rounded towards zero.
The @code{TRUNC_MOD_EXPR} of two operands @code{a} and @code{b} is
always @code{a - (a/b)*b} where the division is as if computed by a
@code{TRUNC_DIV_EXPR}.
The behavior of these operations on signed arithmetic overflow is The behavior of these operations on signed arithmetic overflow is
controlled by the @code{flag_wrapv} and @code{flag_trapv} variables. controlled by the @code{flag_wrapv} and @code{flag_trapv} variables.
@item RDIV_EXPR
This node represents a floating point division operation.
@item TRUNC_DIV_EXPR
@itemx FLOOR_DIV_EXPR
@itemx CEIL_DIV_EXPR
@itemx ROUND_DIV_EXPR
These nodes represent integer division operations that return an integer
result. @code{TRUNC_DIV_EXPR} rounds towards zero, @code{FLOOR_DIV_EXPR}
rounds towards negative infinity, @code{CEIL_DIV_EXPR} rounds towards
positive infinity and @code{ROUND_DIV_EXPR} rounds to the closest integer.
Integer division in C and C++ is truncating, i.e@. @code{TRUNC_DIV_EXPR}.
The behavior of these operations on signed arithmetic overflow, when
dividing the minimum signed integer by minus one, is controlled by the
@code{flag_wrapv} and @code{flag_trapv} variables.
@item TRUNC_MOD_EXPR
@itemx FLOOR_MOD_EXPR
@itemx CEIL_MOD_EXPR
@itemx ROUND_MOD_EXPR
These nodes represent the integer remainder or modulus operation.
The integer modulus of two operands @code{a} and @code{b} is
defined as @code{a - (a/b)*b} where the division calculated using
the corresponding division operator. Hence for @code{TRUNC_MOD_EXPR}
this definition assumes division using truncation towards zero, i.e@.
@code{TRUNC_DIV_EXPR}. Integer remainder in C and C++ uses truncating
division, i.e@. @code{TRUNC_MOD_EXPR}.
@item EXACT_DIV_EXPR
The @code{EXACT_DIV_EXPR} code is used to represent integer divisions where
the numerator is known to be an exact multiple of the denominator. This
allows the backend to choose between the faster of @code{TRUNC_DIV_EXPR},
@code{CEIL_DIV_EXPR} and @code{FLOOR_DIV_EXPR} for the current target.
@item ARRAY_REF @item ARRAY_REF
These nodes represent array accesses. The first operand is the array; These nodes represent array accesses. The first operand is the array;
the second is the index. To calculate the address of the memory the second is the index. To calculate the address of the memory
...@@ -2096,54 +2140,53 @@ meanings. The type of these expressions must be an array whose component ...@@ -2096,54 +2140,53 @@ meanings. The type of these expressions must be an array whose component
type is the same as that of the first operand. The range of that array type is the same as that of the first operand. The range of that array
type determines the amount of data these expressions access. type determines the amount of data these expressions access.
@item EXACT_DIV_EXPR
Document.
@item LT_EXPR @item LT_EXPR
@itemx LE_EXPR @itemx LE_EXPR
@itemx GT_EXPR @itemx GT_EXPR
@itemx GE_EXPR @itemx GE_EXPR
@itemx EQ_EXPR @itemx EQ_EXPR
@itemx NE_EXPR @itemx NE_EXPR
These nodes represent the less than, less than or equal to, greater These nodes represent the less than, less than or equal to, greater
than, greater than or equal to, equal, and not equal comparison than, greater than or equal to, equal, and not equal comparison
operators. The first and second operand with either be both of integral operators. The first and second operand with either be both of integral
type or both of floating type. The result type of these expressions type or both of floating type. The result type of these expressions
will always be of integral or boolean type. will always be of integral or boolean type. These operations return
the result type's zero value for false, and the result type's one value
for true.
Floating-point comparison may have a fourth possible outcome for a For floating point comparisons, if we honor IEEE NaNs and either operand
comparison, other than less, greater or equal: this is @dfn{unordered}, is NaN, then @code{NE_EXPR} always returns true and the remaining operators
and two floating-point values are unordered if one of them is always return false. On some targets, comparisons against an IEEE NaN,
a @dfn{not-a-number} (@dfn{NaN}) value. In this case, all of these other than equality and inequality, may generate a floating point exception.
nodes will be false but @code{NE_EXPR}, and the first four of these
nodes will also raise an invalid operation trap.
@item ORDERED_EXPR @item ORDERED_EXPR
@itemx UNORDERED_EXPR @itemx UNORDERED_EXPR
These nodes represent non-trapping ordered and unordered comparison
operators. These operations take two floating point operands and
determine whether they are ordered or unordered relative to each other.
If either operand is an IEEE NaN, their comparison is defined to be
unordered, otherwise the comparison is defined to be ordered. The
result type of these expressions will always be of integral or boolean
type. These operations return the result type's zero value for false,
and the result type's one value for true.
@item UNLT_EXPR @item UNLT_EXPR
@itemx UNLE_EXPR @itemx UNLE_EXPR
@itemx UNGT_EXPR @itemx UNGT_EXPR
@itemx UNGE_EXPR @itemx UNGE_EXPR
@itemx UNEQ_EXPR @itemx UNEQ_EXPR
@itemx LTGT_EXPR @itemx LTGT_EXPR
These nodes represent the unordered comparison operators.
These nodes represent other relational operations that are only used These operations take two floating point operands and determine whether
with floating types. the operands are unordered or are less than, less than or equal to,
greater than, greater than or equal to, or equal respectively. For
If the outcome of the comparison is unordered, all of these special example, @code{UNLT_EXPR} returns true if either operand is an IEEE
comparisons will be true but @code{ORDERED_EXPR} and @code{LTGT_EXPR}. NaN or the first operand is less than the second. With the possible
Only @code{LTGT_EXPR} is expected to generate an invalid floating-point exception of @code{LTGT_EXPR}, all of these operations are guaranteed
operation trap when the outcome is unordered. not to generate a floating point exception. The result
type of these expressions will always be of integral or boolean type.
@code{ORDERED_EXPR} is true if neither of its operands is a NaN, These operations return the result type's zero value for false,
while its negation @code{UNORDERED_EXPR} is true if at least one of and the result type's one value for true.
its operands is a NaN.
For floating operations, inverting one of the standard comparison nodes
will result in one of these nodes, with its name prefixed by
@code{UN}---the only exception is @code{NE_EXPR}, whose negation is
@code{LTGT_EXPR}.
@item MODIFY_EXPR @item MODIFY_EXPR
These nodes represent assignment. The left-hand side is the first These nodes represent assignment. The left-hand side is the first
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment