aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorAnatoly Sokolov <aesok@post.ru>2010-04-15 02:05:32 +0400
committerAnatoly Sokolov <aesok@gcc.gnu.org>2010-04-15 02:05:32 +0400
commit2bd1333d629dababe7b7d18c46d59c0489929e8b (patch)
tree9138061992a73bba986379151a1a1c756a746bf2 /gcc/tree.c
parent8b9b8e930562b7cf5598dc5b564fa71d989ebb3c (diff)
downloadgcc-2bd1333d629dababe7b7d18c46d59c0489929e8b.zip
gcc-2bd1333d629dababe7b7d18c46d59c0489929e8b.tar.gz
gcc-2bd1333d629dababe7b7d18c46d59c0489929e8b.tar.bz2
double-int.h (HOST_BITS_PER_DOUBLE_INT): Define.
* double-int.h (HOST_BITS_PER_DOUBLE_INT): Define. (double_int_not, double_int_lshift, double_int_rshift): Declare. (double_int_negative_p): Convert to static inline function. * double-int.c (double_int_lshift, double_int_lshift): Add new function. (double_int_negative_p): Remove. * tree.h (lshift_double, rshift_double): * tree.c (build_low_bits_mask): Clean up, use double_int_* functions. * fold-const.c (fold_convert_const_int_from_real, fold_convert_const_int_from_fixed, div_if_zero_remainder): (Ditto.). (lshift_double): Change type of arith argument to bool. (rshift_double): Change type of arith argument to bool. Correct comment. * expmed.c (mask_rtx, lshift_value): (Ditto.). From-SVN: r158360
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c24
1 files changed, 5 insertions, 19 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 5da8206..83f1237 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -1221,32 +1221,18 @@ build_int_cst_wide (tree type, unsigned HOST_WIDE_INT low, HOST_WIDE_INT hi)
tree
build_low_bits_mask (tree type, unsigned bits)
{
- unsigned HOST_WIDE_INT low;
- HOST_WIDE_INT high;
- unsigned HOST_WIDE_INT all_ones = ~(unsigned HOST_WIDE_INT) 0;
+ double_int mask;
gcc_assert (bits <= TYPE_PRECISION (type));
if (bits == TYPE_PRECISION (type)
&& !TYPE_UNSIGNED (type))
- {
- /* Sign extended all-ones mask. */
- low = all_ones;
- high = -1;
- }
- else if (bits <= HOST_BITS_PER_WIDE_INT)
- {
- low = all_ones >> (HOST_BITS_PER_WIDE_INT - bits);
- high = 0;
- }
+ /* Sign extended all-ones mask. */
+ mask = double_int_minus_one;
else
- {
- bits -= HOST_BITS_PER_WIDE_INT;
- low = all_ones;
- high = all_ones >> (HOST_BITS_PER_WIDE_INT - bits);
- }
+ mask = double_int_mask (bits);
- return build_int_cst_wide (type, low, high);
+ return build_int_cst_wide (type, mask.low, mask.high);
}
/* Checks that X is integer constant that can be expressed in (unsigned)