diff options
Diffstat (limited to 'gcc/expmed.c')
-rw-r--r-- | gcc/expmed.c | 104 |
1 files changed, 47 insertions, 57 deletions
diff --git a/gcc/expmed.c b/gcc/expmed.c index dd79390..034e49a 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -899,8 +899,7 @@ store_fixed_bit_field (rtx op0, unsigned HOST_WIDE_INT offset, NULL_RTX, 1, OPTAB_LIB_WIDEN); if (bitpos > 0) value = expand_shift (LSHIFT_EXPR, mode, value, - build_int_cst (NULL_TREE, - bitpos, 0), NULL_RTX, 1); + build_int_cst (NULL_TREE, bitpos), NULL_RTX, 1); } /* Now clear the chosen bits in OP0, @@ -1329,13 +1328,11 @@ extract_bit_field (rtx str_rtx, unsigned HOST_WIDE_INT bitsize, /* Signed bit field: sign-extend with two arithmetic shifts. */ target = expand_shift (LSHIFT_EXPR, mode, target, build_int_cst (NULL_TREE, - GET_MODE_BITSIZE (mode) - bitsize, - 0), + GET_MODE_BITSIZE (mode) - bitsize), NULL_RTX, 0); return expand_shift (RSHIFT_EXPR, mode, target, build_int_cst (NULL_TREE, - GET_MODE_BITSIZE (mode) - bitsize, - 0), + GET_MODE_BITSIZE (mode) - bitsize), NULL_RTX, 0); } @@ -1740,7 +1737,7 @@ extract_fixed_bit_field (enum machine_mode tmode, rtx op0, { /* If the field does not already start at the lsb, shift it so it does. */ - tree amount = build_int_cst (NULL_TREE, bitpos, 0); + tree amount = build_int_cst (NULL_TREE, bitpos); /* Maybe propagate the target for the shift. */ /* But not if we will return it--could confuse integrate.c. */ rtx subtarget = (target != 0 && REG_P (target) ? target : 0); @@ -1781,7 +1778,7 @@ extract_fixed_bit_field (enum machine_mode tmode, rtx op0, { tree amount = build_int_cst (NULL_TREE, - GET_MODE_BITSIZE (mode) - (bitsize + bitpos), 0); + GET_MODE_BITSIZE (mode) - (bitsize + bitpos)); /* Maybe propagate the target for the shift. */ rtx subtarget = (target != 0 && REG_P (target) ? target : 0); op0 = expand_shift (LSHIFT_EXPR, mode, op0, amount, subtarget, 1); @@ -1789,7 +1786,7 @@ extract_fixed_bit_field (enum machine_mode tmode, rtx op0, return expand_shift (RSHIFT_EXPR, mode, op0, build_int_cst (NULL_TREE, - GET_MODE_BITSIZE (mode) - bitsize, 0), + GET_MODE_BITSIZE (mode) - bitsize), target, 0); } @@ -1937,15 +1934,15 @@ extract_split_bit_field (rtx op0, unsigned HOST_WIDE_INT bitsize, { if (bitsize != bitsdone) part = expand_shift (LSHIFT_EXPR, word_mode, part, - build_int_cst (NULL_TREE, - bitsize - bitsdone, 0), 0, 1); + build_int_cst (NULL_TREE, bitsize - bitsdone), + 0, 1); } else { if (bitsdone != thissize) part = expand_shift (LSHIFT_EXPR, word_mode, part, build_int_cst (NULL_TREE, - bitsdone - thissize, 0), 0, 1); + bitsdone - thissize), 0, 1); } if (first) @@ -1964,12 +1961,11 @@ extract_split_bit_field (rtx op0, unsigned HOST_WIDE_INT bitsize, return result; /* Signed bit field: sign-extend with two arithmetic shifts. */ result = expand_shift (LSHIFT_EXPR, word_mode, result, - build_int_cst (NULL_TREE, - BITS_PER_WORD - bitsize, 0), + build_int_cst (NULL_TREE, BITS_PER_WORD - bitsize), NULL_RTX, 0); return expand_shift (RSHIFT_EXPR, word_mode, result, - build_int_cst (NULL_TREE, - BITS_PER_WORD - bitsize, 0), NULL_RTX, 0); + build_int_cst (NULL_TREE, BITS_PER_WORD - bitsize), + NULL_RTX, 0); } /* Add INC into TARGET. */ @@ -2088,7 +2084,7 @@ expand_shift (enum tree_code code, enum machine_mode mode, rtx shifted, tree other_amount = fold (build2 (MINUS_EXPR, type, convert (type, build_int_cst - (NULL_TREE, GET_MODE_BITSIZE (mode), 0)), + (NULL_TREE, GET_MODE_BITSIZE (mode))), amount)); shifted = force_reg (mode, shifted); @@ -2558,14 +2554,14 @@ expand_mult_const (enum machine_mode mode, rtx op0, HOST_WIDE_INT val, { case alg_shift: accum = expand_shift (LSHIFT_EXPR, mode, accum, - build_int_cst (NULL_TREE, log, 0), + build_int_cst (NULL_TREE, log), NULL_RTX, 0); val_so_far <<= log; break; case alg_add_t_m2: tem = expand_shift (LSHIFT_EXPR, mode, op0, - build_int_cst (NULL_TREE, log, 0), + build_int_cst (NULL_TREE, log), NULL_RTX, 0); accum = force_operand (gen_rtx_PLUS (mode, accum, tem), add_target ? add_target : accum_target); @@ -2574,7 +2570,7 @@ expand_mult_const (enum machine_mode mode, rtx op0, HOST_WIDE_INT val, case alg_sub_t_m2: tem = expand_shift (LSHIFT_EXPR, mode, op0, - build_int_cst (NULL_TREE, log, 0), + build_int_cst (NULL_TREE, log), NULL_RTX, 0); accum = force_operand (gen_rtx_MINUS (mode, accum, tem), add_target ? add_target : accum_target); @@ -2583,7 +2579,7 @@ expand_mult_const (enum machine_mode mode, rtx op0, HOST_WIDE_INT val, case alg_add_t2_m: accum = expand_shift (LSHIFT_EXPR, mode, accum, - build_int_cst (NULL_TREE, log, 0), + build_int_cst (NULL_TREE, log), shift_subtarget, 0); accum = force_operand (gen_rtx_PLUS (mode, accum, op0), @@ -2593,7 +2589,7 @@ expand_mult_const (enum machine_mode mode, rtx op0, HOST_WIDE_INT val, case alg_sub_t2_m: accum = expand_shift (LSHIFT_EXPR, mode, accum, - build_int_cst (NULL_TREE, log, 0), + build_int_cst (NULL_TREE, log), shift_subtarget, 0); accum = force_operand (gen_rtx_MINUS (mode, accum, op0), add_target ? add_target : accum_target); @@ -2602,7 +2598,7 @@ expand_mult_const (enum machine_mode mode, rtx op0, HOST_WIDE_INT val, case alg_add_factor: tem = expand_shift (LSHIFT_EXPR, mode, accum, - build_int_cst (NULL_TREE, log, 0), + build_int_cst (NULL_TREE, log), NULL_RTX, 0); accum = force_operand (gen_rtx_PLUS (mode, accum, tem), add_target ? add_target : accum_target); @@ -2611,7 +2607,7 @@ expand_mult_const (enum machine_mode mode, rtx op0, HOST_WIDE_INT val, case alg_sub_factor: tem = expand_shift (LSHIFT_EXPR, mode, accum, - build_int_cst (NULL_TREE, log, 0), + build_int_cst (NULL_TREE, log), NULL_RTX, 0); accum = force_operand (gen_rtx_MINUS (mode, tem, accum), (add_target @@ -2907,8 +2903,7 @@ expand_mult_highpart_adjust (enum machine_mode mode, rtx adj_operand, rtx op0, enum rtx_code adj_code = unsignedp ? PLUS : MINUS; tem = expand_shift (RSHIFT_EXPR, mode, op0, - build_int_cst (NULL_TREE, - GET_MODE_BITSIZE (mode) - 1, 0), + build_int_cst (NULL_TREE, GET_MODE_BITSIZE (mode) - 1), NULL_RTX, 0); tem = expand_and (mode, tem, op1, NULL_RTX); adj_operand @@ -2916,8 +2911,7 @@ expand_mult_highpart_adjust (enum machine_mode mode, rtx adj_operand, rtx op0, adj_operand); tem = expand_shift (RSHIFT_EXPR, mode, op1, - build_int_cst (NULL_TREE, - GET_MODE_BITSIZE (mode) - 1, 0), + build_int_cst (NULL_TREE, GET_MODE_BITSIZE (mode) - 1), NULL_RTX, 0); tem = expand_and (mode, tem, op0, NULL_RTX); target = force_operand (gen_rtx_fmt_ee (adj_code, mode, adj_operand, tem), @@ -2938,8 +2932,7 @@ extract_high_half (enum machine_mode mode, rtx op) wider_mode = GET_MODE_WIDER_MODE (mode); op = expand_shift (RSHIFT_EXPR, wider_mode, op, - build_int_cst (NULL_TREE, - GET_MODE_BITSIZE (mode), 0), 0, 1); + build_int_cst (NULL_TREE, GET_MODE_BITSIZE (mode)), 0, 1); return convert_modes (mode, wider_mode, op, 0); } @@ -3202,7 +3195,7 @@ expand_sdiv_pow2 (enum machine_mode mode, rtx op0, HOST_WIDE_INT d) int logd; logd = floor_log2 (d); - shift = build_int_cst (NULL_TREE, logd, 0); + shift = build_int_cst (NULL_TREE, logd); if (d == 2 && BRANCH_COST >= 1) { @@ -3249,7 +3242,7 @@ expand_sdiv_pow2 (enum machine_mode mode, rtx op0, HOST_WIDE_INT d) NULL_RTX, 0, OPTAB_LIB_WIDEN); else temp = expand_shift (RSHIFT_EXPR, mode, temp, - build_int_cst (NULL_TREE, ushift, 0), + build_int_cst (NULL_TREE, ushift), NULL_RTX, 1); temp = expand_binop (mode, add_optab, temp, op0, NULL_RTX, 0, OPTAB_LIB_WIDEN); @@ -3527,7 +3520,7 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, } quotient = expand_shift (RSHIFT_EXPR, compute_mode, op0, build_int_cst (NULL_TREE, - pre_shift, 0), + pre_shift), tquotient, 1); } else if (size <= HOST_BITS_PER_WIDE_INT) @@ -3585,15 +3578,14 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, NULL_RTX); t3 = expand_shift (RSHIFT_EXPR, compute_mode, t2, - build_int_cst (NULL_TREE, 1, 0), + build_int_cst (NULL_TREE, 1), NULL_RTX,1); t4 = force_operand (gen_rtx_PLUS (compute_mode, t1, t3), NULL_RTX); quotient = expand_shift (RSHIFT_EXPR, compute_mode, t4, - build_int_cst (NULL_TREE, - post_shift - 1, 0), + build_int_cst (NULL_TREE, post_shift - 1), tquotient, 1); } else @@ -3606,7 +3598,7 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, t1 = expand_shift (RSHIFT_EXPR, compute_mode, op0, - build_int_cst (NULL_TREE, pre_shift, 0), + build_int_cst (NULL_TREE, pre_shift), NULL_RTX, 1); extra_cost = (shift_cost[compute_mode][pre_shift] @@ -3618,8 +3610,7 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, goto fail1; quotient = expand_shift (RSHIFT_EXPR, compute_mode, t2, - build_int_cst (NULL_TREE, - post_shift, 0), + build_int_cst (NULL_TREE, post_shift), tquotient, 1); } } @@ -3728,11 +3719,11 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, goto fail1; t2 = expand_shift (RSHIFT_EXPR, compute_mode, t1, - build_int_cst (NULL_TREE, post_shift, 0), + build_int_cst (NULL_TREE, post_shift), NULL_RTX, 0); t3 = expand_shift (RSHIFT_EXPR, compute_mode, op0, - build_int_cst (NULL_TREE, size - 1, 0), + build_int_cst (NULL_TREE, size - 1), NULL_RTX, 0); if (d < 0) quotient @@ -3767,11 +3758,11 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, NULL_RTX); t3 = expand_shift (RSHIFT_EXPR, compute_mode, t2, - build_int_cst (NULL_TREE, post_shift, 0), + build_int_cst (NULL_TREE, post_shift), NULL_RTX, 0); t4 = expand_shift (RSHIFT_EXPR, compute_mode, op0, - build_int_cst (NULL_TREE, size - 1, 0), + build_int_cst (NULL_TREE, size - 1), NULL_RTX, 0); if (d < 0) quotient @@ -3828,7 +3819,7 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, } quotient = expand_shift (RSHIFT_EXPR, compute_mode, op0, - build_int_cst (NULL_TREE, pre_shift, 0), + build_int_cst (NULL_TREE, pre_shift), tquotient, 0); } else @@ -3845,7 +3836,7 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, { t1 = expand_shift (RSHIFT_EXPR, compute_mode, op0, - build_int_cst (NULL_TREE, size - 1, 0), + build_int_cst (NULL_TREE, size - 1), NULL_RTX, 0); t2 = expand_binop (compute_mode, xor_optab, op0, t1, NULL_RTX, 0, OPTAB_WIDEN); @@ -3859,7 +3850,7 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, { t4 = expand_shift (RSHIFT_EXPR, compute_mode, t3, - build_int_cst (NULL_TREE, post_shift, 0), + build_int_cst (NULL_TREE, post_shift), NULL_RTX, 1); quotient = expand_binop (compute_mode, xor_optab, t4, t1, tquotient, 0, @@ -3877,7 +3868,7 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, 0, OPTAB_WIDEN); nsign = expand_shift (RSHIFT_EXPR, compute_mode, t2, - build_int_cst (NULL_TREE, size - 1, 0), + build_int_cst (NULL_TREE, size - 1), NULL_RTX, 0); t3 = force_operand (gen_rtx_MINUS (compute_mode, t1, nsign), NULL_RTX); @@ -3992,8 +3983,7 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, rtx t1, t2, t3; unsigned HOST_WIDE_INT d = INTVAL (op1); t1 = expand_shift (RSHIFT_EXPR, compute_mode, op0, - build_int_cst (NULL_TREE, - floor_log2 (d), 0), + build_int_cst (NULL_TREE, floor_log2 (d)), tquotient, 1); t2 = expand_binop (compute_mode, and_optab, op0, GEN_INT (d - 1), @@ -4091,8 +4081,7 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, rtx t1, t2, t3; unsigned HOST_WIDE_INT d = INTVAL (op1); t1 = expand_shift (RSHIFT_EXPR, compute_mode, op0, - build_int_cst (NULL_TREE, - floor_log2 (d), 0), + build_int_cst (NULL_TREE, floor_log2 (d)), tquotient, 0); t2 = expand_binop (compute_mode, and_optab, op0, GEN_INT (d - 1), @@ -4214,7 +4203,7 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, pre_shift = floor_log2 (d & -d); ml = invert_mod2n (d >> pre_shift, size); t1 = expand_shift (RSHIFT_EXPR, compute_mode, op0, - build_int_cst (NULL_TREE, pre_shift, 0), + build_int_cst (NULL_TREE, pre_shift), NULL_RTX, unsignedp); quotient = expand_mult (compute_mode, t1, gen_int_mode (ml, compute_mode), @@ -4249,7 +4238,7 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, } tem = plus_constant (op1, -1); tem = expand_shift (RSHIFT_EXPR, compute_mode, tem, - build_int_cst (NULL_TREE, 1, 0), + build_int_cst (NULL_TREE, 1), NULL_RTX, 1); do_cmp_and_jump (remainder, tem, LEU, compute_mode, label); expand_inc (quotient, const1_rtx); @@ -4275,13 +4264,13 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, abs_rem = expand_abs (compute_mode, remainder, NULL_RTX, 1, 0); abs_op1 = expand_abs (compute_mode, op1, NULL_RTX, 1, 0); tem = expand_shift (LSHIFT_EXPR, compute_mode, abs_rem, - build_int_cst (NULL_TREE, 1, 0), + build_int_cst (NULL_TREE, 1), NULL_RTX, 1); do_cmp_and_jump (tem, abs_op1, LTU, compute_mode, label); tem = expand_binop (compute_mode, xor_optab, op0, op1, NULL_RTX, 0, OPTAB_WIDEN); mask = expand_shift (RSHIFT_EXPR, compute_mode, tem, - build_int_cst (NULL_TREE, size - 1, 0), + build_int_cst (NULL_TREE, size - 1), NULL_RTX, 0); tem = expand_binop (compute_mode, xor_optab, mask, const1_rtx, NULL_RTX, 0, OPTAB_WIDEN); @@ -4434,14 +4423,15 @@ make_tree (tree type, rtx x) < HOST_BITS_PER_WIDE_INT))) hi = -1; - t = build_int_cst (type, INTVAL (x), hi); + t = build_int_cst_wide (type, INTVAL (x), hi); return t; } case CONST_DOUBLE: if (GET_MODE (x) == VOIDmode) - t = build_int_cst (type, CONST_DOUBLE_LOW (x), CONST_DOUBLE_HIGH (x)); + t = build_int_cst_wide (type, + CONST_DOUBLE_LOW (x), CONST_DOUBLE_HIGH (x)); else { REAL_VALUE_TYPE d; |