Commit 0661a3de by Richard Stallman

(expand_twoval_binop): Use convert_modes.

(expand_complex_abs): Likewise.
(emit_cmp_insn): Likewise.
(expand_inline_function): Likewise.

(widen_operand): New arg OLDMODE.
(expand_binop, expand_unop): Fix calls to widen_operand.

From-SVN: r5296
parent 81722fa9
...@@ -281,9 +281,9 @@ add_equal_note (seq, target, code, op0, op1) ...@@ -281,9 +281,9 @@ add_equal_note (seq, target, code, op0, op1)
of logical operations, but not right shifts. */ of logical operations, but not right shifts. */
static rtx static rtx
widen_operand (op, mode, unsignedp, no_extend) widen_operand (op, mode, oldmode, unsignedp, no_extend)
rtx op; rtx op;
enum machine_mode mode; enum machine_mode mode, oldmode;
int unsignedp; int unsignedp;
int no_extend; int no_extend;
{ {
...@@ -295,7 +295,7 @@ widen_operand (op, mode, unsignedp, no_extend) ...@@ -295,7 +295,7 @@ widen_operand (op, mode, unsignedp, no_extend)
if (! no_extend if (! no_extend
|| GET_MODE (op) == VOIDmode || GET_MODE (op) == VOIDmode
|| (GET_CODE (op) == SUBREG && SUBREG_PROMOTED_VAR_P (op))) || (GET_CODE (op) == SUBREG && SUBREG_PROMOTED_VAR_P (op)))
return convert_to_mode (mode, op, unsignedp); return convert_modes (mode, oldmode, op, unsignedp);
/* If MODE is no wider than a single word, we return a paradoxical /* If MODE is no wider than a single word, we return a paradoxical
SUBREG. */ SUBREG. */
...@@ -525,10 +525,10 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods) ...@@ -525,10 +525,10 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods)
&& class == MODE_INT) && class == MODE_INT)
no_extend = 1; no_extend = 1;
xop0 = widen_operand (xop0, wider_mode, unsignedp, no_extend); xop0 = widen_operand (xop0, wider_mode, mode, unsignedp, no_extend);
/* The second operand of a shift must always be extended. */ /* The second operand of a shift must always be extended. */
xop1 = widen_operand (xop1, wider_mode, unsignedp, xop1 = widen_operand (xop1, wider_mode, mode, unsignedp,
no_extend && binoptab != ashl_optab no_extend && binoptab != ashl_optab
&& binoptab != lshl_optab); && binoptab != lshl_optab);
...@@ -1423,10 +1423,11 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods) ...@@ -1423,10 +1423,11 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods)
&& class == MODE_INT) && class == MODE_INT)
no_extend = 1; no_extend = 1;
xop0 = widen_operand (xop0, wider_mode, unsignedp, no_extend); xop0 = widen_operand (xop0, wider_mode, mode,
unsignedp, no_extend);
/* The second operand of a shift must always be extended. */ /* The second operand of a shift must always be extended. */
xop1 = widen_operand (xop1, wider_mode, unsignedp, xop1 = widen_operand (xop1, wider_mode, mode, unsignedp,
no_extend && binoptab != ashl_optab no_extend && binoptab != ashl_optab
&& binoptab != lshl_optab); && binoptab != lshl_optab);
...@@ -1622,10 +1623,10 @@ expand_twoval_binop (binoptab, op0, op1, targ0, targ1, unsignedp) ...@@ -1622,10 +1623,10 @@ expand_twoval_binop (binoptab, op0, op1, targ0, targ1, unsignedp)
register rtx t1 = gen_reg_rtx (wider_mode); register rtx t1 = gen_reg_rtx (wider_mode);
if (expand_twoval_binop (binoptab, if (expand_twoval_binop (binoptab,
convert_to_mode (wider_mode, op0, convert_modes (wider_mode, mode, op0,
unsignedp), unsignedp),
convert_to_mode (wider_mode, op1, convert_modes (wider_mode, mode, op1,
unsignedp), unsignedp),
t0, t1, unsignedp)) t0, t1, unsignedp))
{ {
convert_move (targ0, t0, unsignedp); convert_move (targ0, t0, unsignedp);
...@@ -1734,7 +1735,7 @@ expand_unop (mode, unoptab, op0, target, unsignedp) ...@@ -1734,7 +1735,7 @@ expand_unop (mode, unoptab, op0, target, unsignedp)
the narrow operand, as long as we will truncate the the narrow operand, as long as we will truncate the
results to the same narrowness. */ results to the same narrowness. */
xop0 = widen_operand (xop0, wider_mode, unsignedp, xop0 = widen_operand (xop0, wider_mode, mode, unsignedp,
(unoptab == neg_optab (unoptab == neg_optab
|| unoptab == one_cmpl_optab) || unoptab == one_cmpl_optab)
&& class == MODE_INT); && class == MODE_INT);
...@@ -1875,7 +1876,7 @@ expand_unop (mode, unoptab, op0, target, unsignedp) ...@@ -1875,7 +1876,7 @@ expand_unop (mode, unoptab, op0, target, unsignedp)
the narrow operand, as long as we will truncate the the narrow operand, as long as we will truncate the
results to the same narrowness. */ results to the same narrowness. */
xop0 = widen_operand (xop0, wider_mode, unsignedp, xop0 = widen_operand (xop0, wider_mode, mode, unsignedp,
(unoptab == neg_optab (unoptab == neg_optab
|| unoptab == one_cmpl_optab) || unoptab == one_cmpl_optab)
&& class == MODE_INT); && class == MODE_INT);
...@@ -1998,7 +1999,7 @@ expand_complex_abs (mode, op0, target, unsignedp) ...@@ -1998,7 +1999,7 @@ expand_complex_abs (mode, op0, target, unsignedp)
{ {
rtx xop0 = op0; rtx xop0 = op0;
xop0 = convert_to_mode (wider_mode, xop0, unsignedp); xop0 = convert_modes (wider_mode, mode, xop0, unsignedp);
temp = expand_complex_abs (wider_mode, xop0, NULL_RTX, unsignedp); temp = expand_complex_abs (wider_mode, xop0, NULL_RTX, unsignedp);
if (temp) if (temp)
...@@ -2073,7 +2074,7 @@ expand_complex_abs (mode, op0, target, unsignedp) ...@@ -2073,7 +2074,7 @@ expand_complex_abs (mode, op0, target, unsignedp)
{ {
rtx xop0 = op0; rtx xop0 = op0;
xop0 = convert_to_mode (wider_mode, xop0, unsignedp); xop0 = convert_modes (wider_mode, mode, xop0, unsignedp);
temp = expand_complex_abs (wider_mode, xop0, NULL_RTX, unsignedp); temp = expand_complex_abs (wider_mode, xop0, NULL_RTX, unsignedp);
...@@ -2558,8 +2559,8 @@ emit_cmp_insn (x, y, comparison, size, mode, unsignedp, align) ...@@ -2558,8 +2559,8 @@ emit_cmp_insn (x, y, comparison, size, mode, unsignedp, align)
{ {
x = protect_from_queue (x, 0); x = protect_from_queue (x, 0);
y = protect_from_queue (y, 0); y = protect_from_queue (y, 0);
x = convert_to_mode (wider_mode, x, unsignedp); x = convert_modes (wider_mode, mode, x, unsignedp);
y = convert_to_mode (wider_mode, y, unsignedp); y = convert_modes (wider_mode, mode, y, unsignedp);
emit_cmp_insn (x, y, comparison, NULL_RTX, emit_cmp_insn (x, y, comparison, NULL_RTX,
wider_mode, unsignedp, align); wider_mode, unsignedp, align);
return; return;
......
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