calls.c (load_register_parameters): Call expand_shift instead of expand_binop with...
authorRoger Sayle <roger@eyesopen.com>
Mon, 5 Jul 2004 21:57:44 +0000 (21:57 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Mon, 5 Jul 2004 21:57:44 +0000 (21:57 +0000)
* 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

gcc/ChangeLog
gcc/calls.c
gcc/expr.c
gcc/function.c
gcc/stmt.c

index 7e4ae9b2e2dd6b8fe2052dfc45877d6cf6350a9f..758807b353b2cdbcc7b2b1e1c1e181f9dabec66e 100644 (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.
index 328488e4ed3a3d34b08603906a8149650424ff34..9f84199990e9956d8181f3c25ae5386f7ab9cd17 100644 (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);
                }
index b5feed7a19f120c4326cd06155de94fec59377d4..e0404449e12e9f80b43cb707c2d0f201e6079c91 100644 (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;
        }
index efeb9f6b24ae4cce905b0ad7d9003b82fc2c2f04..0e736159bceca9394234b0bb3cded161298bf2ac 100644 (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);
            }
index 77bc32ae734e1539d1dac07c8ba46b51471b8d23..1a99e2318904b85adabdff1b1843fa5b13b5c26d 100644 (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;
 }