aboutsummaryrefslogtreecommitdiff
path: root/gcc/fixed-value.c
diff options
context:
space:
mode:
authorKenneth Zadeck <zadeck@naturalbridge.com>2012-06-02 16:08:39 +0000
committerKenneth Zadeck <zadeck@gcc.gnu.org>2012-06-02 16:08:39 +0000
commit49ab6098eefb9414d849b79df3f27cfc82c3ffe6 (patch)
tree54bcdf56261e3cfcb1001f1f939e53c80efd210e /gcc/fixed-value.c
parente3c888eb0e3923981bcb914f818c29a054843d9e (diff)
downloadgcc-49ab6098eefb9414d849b79df3f27cfc82c3ffe6.zip
gcc-49ab6098eefb9414d849b79df3f27cfc82c3ffe6.tar.gz
gcc-49ab6098eefb9414d849b79df3f27cfc82c3ffe6.tar.bz2
2012-06-2 Kenneth Zadeck <zadeck@naturalbridge.com>
* expmed.c (expand_mult, choose_multiplier): Change "2 * HOST_BITS_PER_WIDE_INT" to "HOST_BITS_PER_DOUBLE_INT". * expr.c (convert_modes): Likewise. * explow.c (plus_constant): Likewise. * fixed-value.c (fixed_saturate1, fixed_saturate2) (do_fixed_add, do_fixed_multiply, do_fixed_multiply) (do_fixed_multiply, do_fixed_multiply, do_fixed_divide) (do_fixed_divide, do_fixed_divide, do_fixed_divide) (do_fixed_divide, do_fixed_divide, do_fixed_shift, do_fixed_shift) (do_fixed_shift, fixed_convert, fixed_convert) (fixed_convert_from_int, fixed_convert_from_int) (fixed_convert_from_real): Likewise. * fold-const.c (fold_convert_const_int_from_fixed, sign_bit_p) (native_interpret_int, fold_binary_loc, fold_ternary_loc): Likewise. * varasm.c (output_constructor_bitfield): Likewise. * tree-vrp.c (register_edge_assert_for_2): Likewise. * double-int.c (rshift_double, lshift_double): Likewise. * double-int.h (double_int_fits_in_uhwi_p, double_int, double_int): Likewise. * simplify-rtx.c (mode_signbit_p) (simplify_const_unary_operation, simplify_binary_operation_1) (simplify_immed_subreg): Likewise. * builtins.c (c_readstr, fold_builtin_bitop): Likewise. * tree-vect-generic.c (build_replicated_const): Likewise. * dbxout.c (stabstr_O): Likewise. * emit-rtl.c (immed_double_int_const, immed_double_const) (gen_lowpart_common, init_emit_once): Likewise. * tree.c (integer_pow2p, tree_log2, tree_floor_log2) (widest_int_cst_value, upper_bound_in_type): Likewise. * stor-layout.c (initialize_sizetypes, fixup_signed_type) (fixup_unsigned_type): Likewise. * real.c (real_to_integer2, real_from_integer): Likewise. * dwarf2out.c (size_of_loc_descr, size_of_die, output_die) (clz_loc_descriptor, mem_loc_descriptor): Likewise. From-SVN: r188139
Diffstat (limited to 'gcc/fixed-value.c')
-rw-r--r--gcc/fixed-value.c64
1 files changed, 32 insertions, 32 deletions
diff --git a/gcc/fixed-value.c b/gcc/fixed-value.c
index 022f60e..97aa8b5 100644
--- a/gcc/fixed-value.c
+++ b/gcc/fixed-value.c
@@ -177,7 +177,7 @@ fixed_saturate1 (enum machine_mode mode, double_int a, double_int *f,
min.high = 0;
min.low = 1;
lshift_double (min.low, min.high, i_f_bits,
- 2 * HOST_BITS_PER_WIDE_INT,
+ HOST_BITS_PER_DOUBLE_INT,
&min.low, &min.high, 1);
min = double_int_ext (min, 1 + i_f_bits, 0);
if (double_int_cmp (a, max, 0) == 1)
@@ -245,7 +245,7 @@ fixed_saturate2 (enum machine_mode mode, double_int a_high, double_int a_low,
min_s.high = 0;
min_s.low = 1;
lshift_double (min_s.low, min_s.high, i_f_bits,
- 2 * HOST_BITS_PER_WIDE_INT,
+ HOST_BITS_PER_DOUBLE_INT,
&min_s.low, &min_s.high, 1);
min_s = double_int_ext (min_s, 1 + i_f_bits, 0);
if (double_int_cmp (a_high, max_r, 0) == 1
@@ -354,7 +354,7 @@ do_fixed_add (FIXED_VALUE_TYPE *f, const FIXED_VALUE_TYPE *a,
f->data.low = 1;
f->data.high = 0;
lshift_double (f->data.low, f->data.high, i_f_bits,
- 2 * HOST_BITS_PER_WIDE_INT,
+ HOST_BITS_PER_DOUBLE_INT,
&f->data.low, &f->data.high, 1);
if (get_fixed_sign_bit (a->data, i_f_bits) == 0)
{
@@ -389,7 +389,7 @@ do_fixed_multiply (FIXED_VALUE_TYPE *f, const FIXED_VALUE_TYPE *a,
f->data = double_int_mul (a->data, b->data);
lshift_double (f->data.low, f->data.high,
(-GET_MODE_FBIT (f->mode)),
- 2 * HOST_BITS_PER_WIDE_INT,
+ HOST_BITS_PER_DOUBLE_INT,
&f->data.low, &f->data.high, !unsigned_p);
overflow_p = fixed_saturate1 (f->mode, f->data, &f->data, sat_p);
}
@@ -451,7 +451,7 @@ do_fixed_multiply (FIXED_VALUE_TYPE *f, const FIXED_VALUE_TYPE *a,
r = double_int_sub (r, a->data);
/* Shift right the result by FBIT. */
- if (GET_MODE_FBIT (f->mode) == 2 * HOST_BITS_PER_WIDE_INT)
+ if (GET_MODE_FBIT (f->mode) == HOST_BITS_PER_DOUBLE_INT)
{
s.low = r.low;
s.high = r.high;
@@ -472,12 +472,12 @@ do_fixed_multiply (FIXED_VALUE_TYPE *f, const FIXED_VALUE_TYPE *a,
{
lshift_double (s.low, s.high,
(-GET_MODE_FBIT (f->mode)),
- 2 * HOST_BITS_PER_WIDE_INT,
+ HOST_BITS_PER_DOUBLE_INT,
&s.low, &s.high, 0);
lshift_double (r.low, r.high,
- (2 * HOST_BITS_PER_WIDE_INT
+ (HOST_BITS_PER_DOUBLE_INT
- GET_MODE_FBIT (f->mode)),
- 2 * HOST_BITS_PER_WIDE_INT,
+ HOST_BITS_PER_DOUBLE_INT,
&f->data.low, &f->data.high, 0);
f->data.low = f->data.low | s.low;
f->data.high = f->data.high | s.high;
@@ -485,7 +485,7 @@ do_fixed_multiply (FIXED_VALUE_TYPE *f, const FIXED_VALUE_TYPE *a,
s.high = f->data.high;
lshift_double (r.low, r.high,
(-GET_MODE_FBIT (f->mode)),
- 2 * HOST_BITS_PER_WIDE_INT,
+ HOST_BITS_PER_DOUBLE_INT,
&r.low, &r.high, !unsigned_p);
}
@@ -512,7 +512,7 @@ do_fixed_divide (FIXED_VALUE_TYPE *f, const FIXED_VALUE_TYPE *a,
{
lshift_double (a->data.low, a->data.high,
GET_MODE_FBIT (f->mode),
- 2 * HOST_BITS_PER_WIDE_INT,
+ HOST_BITS_PER_DOUBLE_INT,
&f->data.low, &f->data.high, !unsigned_p);
f->data = double_int_div (f->data, b->data, unsigned_p, TRUNC_DIV_EXPR);
overflow_p = fixed_saturate1 (f->mode, f->data, &f->data, sat_p);
@@ -543,7 +543,7 @@ do_fixed_divide (FIXED_VALUE_TYPE *f, const FIXED_VALUE_TYPE *a,
pos_b = b->data;
/* Left shift pos_a to {r, s} by FBIT. */
- if (GET_MODE_FBIT (f->mode) == 2 * HOST_BITS_PER_WIDE_INT)
+ if (GET_MODE_FBIT (f->mode) == HOST_BITS_PER_DOUBLE_INT)
{
r = pos_a;
s.high = 0;
@@ -553,12 +553,12 @@ do_fixed_divide (FIXED_VALUE_TYPE *f, const FIXED_VALUE_TYPE *a,
{
lshift_double (pos_a.low, pos_a.high,
GET_MODE_FBIT (f->mode),
- 2 * HOST_BITS_PER_WIDE_INT,
+ HOST_BITS_PER_DOUBLE_INT,
&s.low, &s.high, 0);
lshift_double (pos_a.low, pos_a.high,
- - (2 * HOST_BITS_PER_WIDE_INT
+ - (HOST_BITS_PER_DOUBLE_INT
- GET_MODE_FBIT (f->mode)),
- 2 * HOST_BITS_PER_WIDE_INT,
+ HOST_BITS_PER_DOUBLE_INT,
&r.low, &r.high, 0);
}
@@ -570,13 +570,13 @@ do_fixed_divide (FIXED_VALUE_TYPE *f, const FIXED_VALUE_TYPE *a,
quo_s.high = 0;
quo_s.low = 0;
- for (i = 0; i < 2 * HOST_BITS_PER_WIDE_INT; i++)
+ for (i = 0; i < HOST_BITS_PER_DOUBLE_INT; i++)
{
/* Record the leftmost bit of mod. */
int leftmost_mod = (mod.high < 0);
/* Shift left mod by 1 bit. */
- lshift_double (mod.low, mod.high, 1, 2 * HOST_BITS_PER_WIDE_INT,
+ lshift_double (mod.low, mod.high, 1, HOST_BITS_PER_DOUBLE_INT,
&mod.low, &mod.high, 0);
/* Test the leftmost bit of s to add to mod. */
@@ -584,7 +584,7 @@ do_fixed_divide (FIXED_VALUE_TYPE *f, const FIXED_VALUE_TYPE *a,
mod.low += 1;
/* Shift left quo_s by 1 bit. */
- lshift_double (quo_s.low, quo_s.high, 1, 2 * HOST_BITS_PER_WIDE_INT,
+ lshift_double (quo_s.low, quo_s.high, 1, HOST_BITS_PER_DOUBLE_INT,
&quo_s.low, &quo_s.high, 0);
/* Try to calculate (mod - pos_b). */
@@ -597,7 +597,7 @@ do_fixed_divide (FIXED_VALUE_TYPE *f, const FIXED_VALUE_TYPE *a,
}
/* Shift left s by 1 bit. */
- lshift_double (s.low, s.high, 1, 2 * HOST_BITS_PER_WIDE_INT,
+ lshift_double (s.low, s.high, 1, HOST_BITS_PER_DOUBLE_INT,
&s.low, &s.high, 0);
}
@@ -645,7 +645,7 @@ do_fixed_shift (FIXED_VALUE_TYPE *f, const FIXED_VALUE_TYPE *a,
{
lshift_double (a->data.low, a->data.high,
left_p ? b->data.low : (-b->data.low),
- 2 * HOST_BITS_PER_WIDE_INT,
+ HOST_BITS_PER_DOUBLE_INT,
&f->data.low, &f->data.high, !unsigned_p);
if (left_p) /* Only left shift saturates. */
overflow_p = fixed_saturate1 (f->mode, f->data, &f->data, sat_p);
@@ -653,7 +653,7 @@ do_fixed_shift (FIXED_VALUE_TYPE *f, const FIXED_VALUE_TYPE *a,
else /* We need two double_int to store the left-shift result. */
{
double_int temp_high, temp_low;
- if (b->data.low == 2 * HOST_BITS_PER_WIDE_INT)
+ if (b->data.low == HOST_BITS_PER_DOUBLE_INT)
{
temp_high = a->data;
temp_low.high = 0;
@@ -663,12 +663,12 @@ do_fixed_shift (FIXED_VALUE_TYPE *f, const FIXED_VALUE_TYPE *a,
{
lshift_double (a->data.low, a->data.high,
b->data.low,
- 2 * HOST_BITS_PER_WIDE_INT,
+ HOST_BITS_PER_DOUBLE_INT,
&temp_low.low, &temp_low.high, !unsigned_p);
/* Logical shift right to temp_high. */
lshift_double (a->data.low, a->data.high,
- b->data.low - 2 * HOST_BITS_PER_WIDE_INT,
- 2 * HOST_BITS_PER_WIDE_INT,
+ b->data.low - HOST_BITS_PER_DOUBLE_INT,
+ HOST_BITS_PER_DOUBLE_INT,
&temp_high.low, &temp_high.high, 0);
}
if (!unsigned_p && a->data.high < 0) /* Signed-extend temp_high. */
@@ -837,13 +837,13 @@ fixed_convert (FIXED_VALUE_TYPE *f, enum machine_mode mode,
int amount = GET_MODE_FBIT (mode) - GET_MODE_FBIT (a->mode);
lshift_double (a->data.low, a->data.high,
amount,
- 2 * HOST_BITS_PER_WIDE_INT,
+ HOST_BITS_PER_DOUBLE_INT,
&temp_low.low, &temp_low.high,
SIGNED_FIXED_POINT_MODE_P (a->mode));
/* Logical shift right to temp_high. */
lshift_double (a->data.low, a->data.high,
- amount - 2 * HOST_BITS_PER_WIDE_INT,
- 2 * HOST_BITS_PER_WIDE_INT,
+ amount - HOST_BITS_PER_DOUBLE_INT,
+ HOST_BITS_PER_DOUBLE_INT,
&temp_high.low, &temp_high.high, 0);
if (SIGNED_FIXED_POINT_MODE_P (a->mode)
&& a->data.high < 0) /* Signed-extend temp_high. */
@@ -905,7 +905,7 @@ fixed_convert (FIXED_VALUE_TYPE *f, enum machine_mode mode,
double_int temp;
lshift_double (a->data.low, a->data.high,
GET_MODE_FBIT (mode) - GET_MODE_FBIT (a->mode),
- 2 * HOST_BITS_PER_WIDE_INT,
+ HOST_BITS_PER_DOUBLE_INT,
&temp.low, &temp.high,
SIGNED_FIXED_POINT_MODE_P (a->mode));
f->mode = mode;
@@ -980,7 +980,7 @@ fixed_convert_from_int (FIXED_VALUE_TYPE *f, enum machine_mode mode,
/* Left shift a to temp_high, temp_low. */
double_int temp_high, temp_low;
int amount = GET_MODE_FBIT (mode);
- if (amount == 2 * HOST_BITS_PER_WIDE_INT)
+ if (amount == HOST_BITS_PER_DOUBLE_INT)
{
temp_high = a;
temp_low.low = 0;
@@ -990,13 +990,13 @@ fixed_convert_from_int (FIXED_VALUE_TYPE *f, enum machine_mode mode,
{
lshift_double (a.low, a.high,
amount,
- 2 * HOST_BITS_PER_WIDE_INT,
+ HOST_BITS_PER_DOUBLE_INT,
&temp_low.low, &temp_low.high, 0);
/* Logical shift right to temp_high. */
lshift_double (a.low, a.high,
- amount - 2 * HOST_BITS_PER_WIDE_INT,
- 2 * HOST_BITS_PER_WIDE_INT,
+ amount - HOST_BITS_PER_DOUBLE_INT,
+ HOST_BITS_PER_DOUBLE_INT,
&temp_high.low, &temp_high.high, 0);
}
if (!unsigned_p && a.high < 0) /* Signed-extend temp_high. */
@@ -1094,7 +1094,7 @@ fixed_convert_from_real (FIXED_VALUE_TYPE *f, enum machine_mode mode,
f->data.low = 1;
f->data.high = 0;
lshift_double (f->data.low, f->data.high, i_f_bits,
- 2 * HOST_BITS_PER_WIDE_INT,
+ HOST_BITS_PER_DOUBLE_INT,
&f->data.low, &f->data.high, 1);
f->data = double_int_ext (f->data, 1 + i_f_bits, 0);
}