From: Roger Sayle Date: Mon, 5 Jul 2004 21:57:44 +0000 (+0000) Subject: calls.c (load_register_parameters): Call expand_shift instead of expand_binop with... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=09b526703562a475d28e7a490e56dddb1edbe961;p=gcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7e4ae9b2e2d..758807b353b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2004-07-05 Roger Sayle + + * 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 * expr.c (expand_assignment): Disable the bitfield += optimizations. diff --git a/gcc/calls.c b/gcc/calls.c index 328488e4ed3..9f84199990e 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -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); } diff --git a/gcc/expr.c b/gcc/expr.c index b5feed7a19f..e0404449e12 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -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; } diff --git a/gcc/function.c b/gcc/function.c index efeb9f6b24a..0e736159bce 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -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); } diff --git a/gcc/stmt.c b/gcc/stmt.c index 77bc32ae734..1a99e231890 100644 --- a/gcc/stmt.c +++ b/gcc/stmt.c @@ -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; }