diff options
author | Richard Guenther <rguenther@suse.de> | 2011-04-29 14:20:41 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2011-04-29 14:20:41 +0000 |
commit | eb6c3df1a0e34edc7a243c781a1b8842e3fc285c (patch) | |
tree | f442091bcb3d922e2508780f3c19d3d70034b779 /gcc/expr.c | |
parent | 9f616812d9cb9a651fb4636a3ec499c1b87995f3 (diff) | |
download | gcc-eb6c3df1a0e34edc7a243c781a1b8842e3fc285c.zip gcc-eb6c3df1a0e34edc7a243c781a1b8842e3fc285c.tar.gz gcc-eb6c3df1a0e34edc7a243c781a1b8842e3fc285c.tar.bz2 |
expr.h (expand_shift): Rename to ...
2011-04-29 Richard Guenther <rguenther@suse.de>
* expr.h (expand_shift): Rename to ...
(expand_variable_shift): ... this.
(expand_shift): Take a constant shift amount.
* expmed.c (expand_shift): Rename to ...
(expand_variable_shift): ... this.
(expand_shift): New wrapper around expand_variable_shift.
* expr.c (convert_move, emit_group_load_1, emit_group_store,
optimize_bitfield_assignment_op, store_field, expand_expr_real_2,
expand_expr_real_1, reduce_to_bit_field_precision): Adjust.
* expmed.c (store_fixed_bit_field, extract_bit_field_1,
extract_fixed_bit_field, extract_split_bit_field, expand_mult_const,
expand_mult, expand_widening_mult, expand_mult_highpart_adjust,
extract_high_half, expand_sdiv_pow2, expand_divmod, emit_cstore,
emit_store_flag_1, emit_store_flag): Likewise.
* builtins.c (expand_builtin_signbit): Likewise.
* calls.c (load_register_parameters): Likewise.
* function.c (assign_parm_setup_block): Likewise.
* lower-subreg.c (resolve_shift_zext): Likewise.
* optabs.c (widen_bswap, expand_abs_nojump,
expand_one_cmpl_abs_nojump, expand_float): Likewise.
* spu/spu.c (spu_expand_extv): Likewise.
* sparc/sparc.c (sparc32_initialize_trampoline): Likewise.
From-SVN: r173157
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 43 |
1 files changed, 18 insertions, 25 deletions
@@ -616,7 +616,7 @@ convert_move (rtx to, rtx from, int unsignedp) { enum machine_mode intermediate; rtx tmp; - tree shift_amount; + int shift_amount; /* Search for a mode to convert via. */ for (intermediate = from_mode; intermediate != VOIDmode; @@ -636,9 +636,8 @@ convert_move (rtx to, rtx from, int unsignedp) /* No suitable intermediate mode. Generate what we need with shifts. */ - shift_amount = build_int_cst (NULL_TREE, - GET_MODE_BITSIZE (to_mode) - - GET_MODE_BITSIZE (from_mode)); + shift_amount = (GET_MODE_BITSIZE (to_mode) + - GET_MODE_BITSIZE (from_mode)); from = gen_lowpart (to_mode, force_reg (from_mode, from)); tmp = expand_shift (LSHIFT_EXPR, to_mode, from, shift_amount, to, unsignedp); @@ -1753,7 +1752,7 @@ emit_group_load_1 (rtx *tmps, rtx dst, rtx orig_src, tree type, int ssize) if (shift) tmps[i] = expand_shift (LSHIFT_EXPR, mode, tmps[i], - build_int_cst (NULL_TREE, shift), tmps[i], 0); + shift, tmps[i], 0); } } @@ -2050,8 +2049,7 @@ emit_group_store (rtx orig_dst, rtx src, tree type ATTRIBUTE_UNUSED, int ssize) { int shift = (bytelen - (ssize - bytepos)) * BITS_PER_UNIT; tmps[i] = expand_shift (RSHIFT_EXPR, mode, tmps[i], - build_int_cst (NULL_TREE, shift), - tmps[i], 0); + shift, tmps[i], 0); } bytelen = adj_bytelen; } @@ -4052,8 +4050,7 @@ optimize_bitfield_assignment_op (unsigned HOST_WIDE_INT bitsize, binop = xor_optab; } value = expand_shift (LSHIFT_EXPR, str_mode, value, - build_int_cst (NULL_TREE, bitpos), - NULL_RTX, 1); + bitpos, NULL_RTX, 1); result = expand_binop (str_mode, binop, str_rtx, value, str_rtx, 1, OPTAB_WIDEN); if (result != str_rtx) @@ -4087,8 +4084,7 @@ optimize_bitfield_assignment_op (unsigned HOST_WIDE_INT bitsize, NULL_RTX); } value = expand_shift (LSHIFT_EXPR, GET_MODE (str_rtx), value, - build_int_cst (NULL_TREE, bitpos), - NULL_RTX, 1); + bitpos, NULL_RTX, 1); result = expand_binop (GET_MODE (str_rtx), binop, str_rtx, value, str_rtx, 1, OPTAB_WIDEN); if (result != str_rtx) @@ -5882,8 +5878,7 @@ store_field (rtx target, HOST_WIDE_INT bitsize, HOST_WIDE_INT bitpos, && bitsize < (HOST_WIDE_INT) GET_MODE_BITSIZE (GET_MODE (temp)) && TREE_CODE (TREE_TYPE (exp)) == RECORD_TYPE) temp = expand_shift (RSHIFT_EXPR, GET_MODE (temp), temp, - size_int (GET_MODE_BITSIZE (GET_MODE (temp)) - - bitsize), + GET_MODE_BITSIZE (GET_MODE (temp)) - bitsize, NULL_RTX, 1); /* Unless MODE is VOIDmode or BLKmode, convert TEMP to @@ -8064,8 +8059,8 @@ expand_expr_real_2 (sepops ops, rtx target, enum machine_mode tmode, target = 0; op0 = expand_expr (treeop0, subtarget, VOIDmode, EXPAND_NORMAL); - temp = expand_shift (code, mode, op0, treeop1, target, - unsignedp); + temp = expand_variable_shift (code, mode, op0, treeop1, target, + unsignedp); if (code == LSHIFT_EXPR) temp = REDUCE_BIT_FIELD (temp); return temp; @@ -8980,9 +8975,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, } else { - tree count - = build_int_cst (NULL_TREE, - GET_MODE_BITSIZE (imode) - bitsize); + int count = GET_MODE_BITSIZE (imode) - bitsize; op0 = expand_shift (LSHIFT_EXPR, imode, op0, count, target, 0); @@ -9251,9 +9244,8 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, && GET_MODE_CLASS (GET_MODE (op0)) == MODE_INT && bitsize < (HOST_WIDE_INT) GET_MODE_BITSIZE (GET_MODE (op0))) op0 = expand_shift (LSHIFT_EXPR, GET_MODE (op0), op0, - size_int (GET_MODE_BITSIZE (GET_MODE (op0)) - - bitsize), - op0, 1); + GET_MODE_BITSIZE (GET_MODE (op0)) + - bitsize, op0, 1); /* If the result type is BLKmode, store the data into a temporary of the appropriate type, but with the mode corresponding to the @@ -9750,10 +9742,11 @@ reduce_to_bit_field_precision (rtx exp, rtx target, tree type) } else { - tree count = build_int_cst (NULL_TREE, - GET_MODE_BITSIZE (GET_MODE (exp)) - prec); - exp = expand_shift (LSHIFT_EXPR, GET_MODE (exp), exp, count, target, 0); - return expand_shift (RSHIFT_EXPR, GET_MODE (exp), exp, count, target, 0); + int count = GET_MODE_BITSIZE (GET_MODE (exp)) - prec; + exp = expand_shift (LSHIFT_EXPR, GET_MODE (exp), + exp, count, target, 0); + return expand_shift (RSHIFT_EXPR, GET_MODE (exp), + exp, count, target, 0); } } |