@tindex PLUS_EXPR
@tindex MINUS_EXPR
@tindex MULT_EXPR
+@tindex WIDEN_MULT_EXPR
@tindex MULT_HIGHPART_EXPR
@tindex RDIV_EXPR
@tindex TRUNC_DIV_EXPR
The behavior of these operations on signed arithmetic overflow is
controlled by the @code{flag_wrapv} and @code{flag_trapv} variables.
+@item WIDEN_MULT_EXPR
+This node represents a widening multiplication. The operands have
+integral types with same @var{b} bits of precision, producing an
+integral type result with at least @math{2@var{b}} bits of precision.
+The behaviour is equivalent to extending both operands, possibly of
+different signedness, to the result type, then multiplying them.
+
@item MULT_HIGHPART_EXPR
This node represents the ``high-part'' of a widening multiplication.
For an integral type with @var{b} bits of precision, the result is
the most significant @var{b} bits of the full @math{2@var{b}} product.
+Both operands must have the same precision and same signedness.
@item RDIV_EXPR
This node represents a floating point division operation.
if (bits < prec || bits >= 2 * prec)
return false;
+ /* For the time being, require operands to have the same sign. */
+ if (unsignedp != TYPE_UNSIGNED (TREE_TYPE (mop2)))
+ return false;
+
machine_mode mode = TYPE_MODE (optype);
optab tab = unsignedp ? umul_highpart_optab : smul_highpart_optab;
if (optab_handler (tab, mode) == CODE_FOR_nothing)
DEFTREECODE (POINTER_DIFF_EXPR, "pointer_diff_expr", tcc_binary, 2)
/* Highpart multiplication. For an integral type with precision B,
- returns bits [2B-1, B] of the full 2*B product. */
+ returns bits [2B-1, B] of the full 2*B product. Both operands
+ and the result should have integer types of the same precision
+ and signedness. */
DEFTREECODE (MULT_HIGHPART_EXPR, "mult_highpart_expr", tcc_binary, 2)
/* Division for integer result that rounds the quotient toward zero. */
DEFTREECODE (SAD_EXPR, "sad_expr", tcc_expression, 3)
/* Widening multiplication.
- The two arguments are of type t1.
- The result is of type t2, such that t2 is at least twice
- the size of t1. WIDEN_MULT_EXPR is equivalent to first widening (promoting)
- the arguments from type t1 to type t2, and then multiplying them. */
+ The two arguments are of type t1 and t2, both integral types that
+ have the same precision, but possibly different signedness.
+ The result is of integral type t3, such that t3 is at least twice
+ the size of t1/t2. WIDEN_MULT_EXPR is equivalent to first widening
+ (promoting) the arguments from type t1 to type t3, and from t2 to
+ type t3 and then multiplying them. */
DEFTREECODE (WIDEN_MULT_EXPR, "widen_mult_expr", tcc_binary, 2)
/* Widening multiply-accumulate.