Commit 874f6a6d by Eric Botcazou Committed by Richard Henderson

optabs.c (expand_binop): Minor cleanup.

        * optabs.c (expand_binop): Minor cleanup.
        (expand_twoval_binop): Convert CONST_INTs like in expand_binop.

From-SVN: r57046
parent d1df930b
2002-09-09 Eric Botcazou ebotcazou@libertysurf.fr
* optabs.c (expand_binop): Minor cleanup.
(expand_twoval_binop): Convert CONST_INTs like in expand_binop.
2002-09-11 Dan Nicolaescu <dann@ics.uci.edu> 2002-09-11 Dan Nicolaescu <dann@ics.uci.edu>
* print-tree.c (print_node): Print the restrict qualifier. * print-tree.c (print_node): Print the restrict qualifier.
......
...@@ -783,24 +783,20 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods) ...@@ -783,24 +783,20 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods)
seem that we don't need to convert CONST_INTs, but we do, so seem that we don't need to convert CONST_INTs, but we do, so
that they're properly zero-extended or sign-extended for their that they're properly zero-extended or sign-extended for their
modes; shift operations are an exception, because the second modes; shift operations are an exception, because the second
operand needs not be extended to the mode of the result. */ operand need not be extended to the mode of the result. */
if (GET_MODE (op0) != mode0 if (GET_MODE (op0) != mode0 && mode0 != VOIDmode)
&& mode0 != VOIDmode)
xop0 = convert_modes (mode0, xop0 = convert_modes (mode0,
GET_MODE (op0) != VOIDmode GET_MODE (op0) != VOIDmode
? GET_MODE (op0) ? GET_MODE (op0)
: mode, : mode,
xop0, unsignedp); xop0, unsignedp);
if (GET_MODE (xop1) != mode1 if (GET_MODE (op1) != mode1 && mode1 != VOIDmode)
&& mode1 != VOIDmode)
xop1 = convert_modes (mode1, xop1 = convert_modes (mode1,
GET_MODE (op1) != VOIDmode GET_MODE (op1) != VOIDmode
? GET_MODE (op1) ? GET_MODE (op1)
: ! shift_op : (shift_op ? mode1 : mode),
? mode
: mode1,
xop1, unsignedp); xop1, unsignedp);
/* Now, if insn's predicates don't allow our operands, put them into /* Now, if insn's predicates don't allow our operands, put them into
...@@ -2235,13 +2231,25 @@ expand_twoval_binop (binoptab, op0, op1, targ0, targ1, unsignedp) ...@@ -2235,13 +2231,25 @@ expand_twoval_binop (binoptab, op0, op1, targ0, targ1, unsignedp)
rtx pat; rtx pat;
rtx xop0 = op0, xop1 = op1; rtx xop0 = op0, xop1 = op1;
/* In case this insn wants input operands in modes different from the /* In case the insn wants input operands in modes different from
result, convert the operands. */ those of the actual operands, convert the operands. It would
if (GET_MODE (op0) != VOIDmode && GET_MODE (op0) != mode0) seem that we don't need to convert CONST_INTs, but we do, so
xop0 = convert_to_mode (mode0, xop0, unsignedp); that they're properly zero-extended or sign-extended for their
modes. */
if (GET_MODE (op0) != mode0 && mode0 != VOIDmode)
xop0 = convert_modes (mode0,
GET_MODE (op0) != VOIDmode
? GET_MODE (op0)
: mode,
xop0, unsignedp);
if (GET_MODE (op1) != VOIDmode && GET_MODE (op1) != mode1) if (GET_MODE (op1) != mode1 && mode1 != VOIDmode)
xop1 = convert_to_mode (mode1, xop1, unsignedp); xop1 = convert_modes (mode1,
GET_MODE (op1) != VOIDmode
? GET_MODE (op1)
: mode,
xop1, unsignedp);
/* Now, if insn doesn't accept these operands, put them into pseudos. */ /* Now, if insn doesn't accept these operands, put them into pseudos. */
if (! (*insn_data[icode].operand[1].predicate) (xop0, mode0)) if (! (*insn_data[icode].operand[1].predicate) (xop0, mode0))
......
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