calls.c (load_register_parameters): Call expand_shift instead of expand_binop with ashl_optab (or other shift...

* calls.c (load_register_parameters): Call expand_shift instead
	of expand_binop with ashl_optab (or other shift optab) directly.
	* expr.c (emit_group_load, emit_group_store): Likewise.
	* function.c (assign_parm_setup_block): Likewise.
	* stmt.c (shift_return_value): Likewise.

From-SVN: r84134
This commit is contained in:
Roger Sayle 2004-07-05 21:57:44 +00:00 committed by Roger Sayle
parent 7682ef833a
commit 09b5267035
5 changed files with 22 additions and 13 deletions

View File

@ -1,3 +1,11 @@
2004-07-05 Roger Sayle <roger@eyesopen.com>
* calls.c (load_register_parameters): Call expand_shift instead
of expand_binop with ashl_optab (or other shift optab) directly.
* expr.c (emit_group_load, emit_group_store): Likewise.
* function.c (assign_parm_setup_block): Likewise.
* stmt.c (shift_return_value): Likewise.
2004-07-05 Jakub Jelinek <jakub@redhat.com>
* expr.c (expand_assignment): Disable the bitfield += optimizations.

View File

@ -1527,8 +1527,8 @@ load_register_parameters (struct arg_data *args, int num_actuals,
call only uses SIZE bytes at the msb end, but it doesn't
seem worth generating rtl to say that. */
reg = gen_rtx_REG (word_mode, REGNO (reg));
x = expand_binop (word_mode, ashl_optab, reg,
GEN_INT (shift), reg, 1, OPTAB_WIDEN);
x = expand_shift (LSHIFT_EXPR, word_mode, reg,
build_int_2 (shift, 0), reg, 1);
if (x != reg)
emit_move_insn (reg, x);
}
@ -1560,11 +1560,12 @@ load_register_parameters (struct arg_data *args, int num_actuals,
rtx ri = gen_rtx_REG (word_mode, REGNO (reg));
rtx x = gen_reg_rtx (word_mode);
int shift = (UNITS_PER_WORD - size) * BITS_PER_UNIT;
optab dir = BYTES_BIG_ENDIAN ? lshr_optab : ashl_optab;
enum tree_code dir = BYTES_BIG_ENDIAN ? RSHIFT_EXPR
: LSHIFT_EXPR;
emit_move_insn (x, tem);
x = expand_binop (word_mode, dir, x, GEN_INT (shift),
ri, 1, OPTAB_WIDEN);
x = expand_shift (dir, word_mode, x,
build_int_2 (shift, 0), ri, 1);
if (x != ri)
emit_move_insn (ri, x);
}

View File

@ -1923,8 +1923,8 @@ emit_group_load (rtx dst, rtx orig_src, tree type ATTRIBUTE_UNUSED, int ssize)
mode, mode, ssize);
if (shift)
expand_binop (mode, ashl_optab, tmps[i], GEN_INT (shift),
tmps[i], 0, OPTAB_WIDEN);
tmps[i] = expand_shift (LSHIFT_EXPR, mode, tmps[i],
build_int_2 (shift, 0), tmps[i], 0);
}
emit_queue ();
@ -2037,8 +2037,8 @@ emit_group_store (rtx orig_dst, rtx src, tree type ATTRIBUTE_UNUSED, int ssize)
)
{
int shift = (bytelen - (ssize - bytepos)) * BITS_PER_UNIT;
expand_binop (mode, ashr_optab, tmps[i], GEN_INT (shift),
tmps[i], 0, OPTAB_WIDEN);
tmps[i] = expand_shift (RSHIFT_EXPR, mode, tmps[i],
build_int_2 (shift, 0), tmps[i], 0);
}
bytelen = ssize - bytepos;
}

View File

@ -2702,8 +2702,8 @@ assign_parm_setup_block (tree parm, struct assign_parm_data_one *data)
int by = (UNITS_PER_WORD - size) * BITS_PER_UNIT;
rtx reg = gen_rtx_REG (word_mode, REGNO (data->entry_parm));
x = expand_binop (word_mode, ashl_optab, reg,
GEN_INT (by), 0, 1, OPTAB_WIDEN);
x = expand_shift (LSHIFT_EXPR, word_mode, reg,
build_int_2 (by, 0), NULL_RTX, 1);
tem = change_address (mem, word_mode, 0);
emit_move_insn (tem, x);
}

View File

@ -2376,9 +2376,9 @@ shift_return_value (rtx val)
shift = (GET_MODE_BITSIZE (GET_MODE (target))
- BITS_PER_UNIT * int_size_in_bytes (type));
if (shift > 0)
val = expand_binop (GET_MODE (target), ashl_optab,
val = expand_shift (LSHIFT_EXPR, GET_MODE (target),
gen_lowpart (GET_MODE (target), val),
GEN_INT (shift), target, 1, OPTAB_WIDEN);
build_int_2 (shift, 0), target, 1);
}
return val;
}