diff options
author | Anatoly Sokolov <aesok@post.ru> | 2010-04-20 20:33:46 +0400 |
---|---|---|
committer | Anatoly Sokolov <aesok@gcc.gnu.org> | 2010-04-20 20:33:46 +0400 |
commit | 54fb1ae03e7eda76d322545955cd128412887d23 (patch) | |
tree | fc2fe7aa9ff67f2d7f7bb70f4b04a3ccb15037d4 /gcc/double-int.c | |
parent | e4ba7a600e70bce0065a2fde0f2f85cdee746cfb (diff) | |
download | gcc-54fb1ae03e7eda76d322545955cd128412887d23.zip gcc-54fb1ae03e7eda76d322545955cd128412887d23.tar.gz gcc-54fb1ae03e7eda76d322545955cd128412887d23.tar.bz2 |
double-int.h (double_int_setbit): Declare.
* double-int.h (double_int_setbit): Declare.
* double-int.c (double_int_setbit): New function.
* rtl.h (immed_double_int_const): Declare.
* emit-rtl.c (immed_double_int_const): New function.
* builtins.c (expand_builtin_signbit): Clean up, use double_int_*
and immed_double_int_const functions.
* optabs.c (expand_absneg_bit, expand_copysign_absneg,
expand_copysign_bit): (Ditto.).
* simplify-rtx.c (simplify_binary_operation_1): (Ditto.).
* tree-ssa-address.c (addr_for_mem_ref): (Ditto.).
* dojump.c (prefer_and_bit_test): (Ditto.).
* expr.c (convert_modes, reduce_to_bit_field_precision,
const_vector_from_tree): (Ditto.).
* expmed.c (mask_rtx, lshift_value): (Ditto.).
From-SVN: r158566
Diffstat (limited to 'gcc/double-int.c')
-rw-r--r-- | gcc/double-int.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/double-int.c b/gcc/double-int.c index 2af97ba..8e4a3f5 100644 --- a/gcc/double-int.c +++ b/gcc/double-int.c @@ -1013,6 +1013,18 @@ double_int_umod (double_int a, double_int b, unsigned code) return double_int_mod (a, b, true, code); } +/* Set BITPOS bit in A. */ +double_int +double_int_setbit (double_int a, unsigned bitpos) +{ + if (bitpos < HOST_BITS_PER_WIDE_INT) + a.low |= (unsigned HOST_WIDE_INT) 1 << bitpos; + else + a.high |= (HOST_WIDE_INT) 1 << (bitpos - HOST_BITS_PER_WIDE_INT); + + return a; +} + /* Shift A left by COUNT places keeping only PREC bits of result. Shift right if COUNT is negative. ARITH true specifies arithmetic shifting; otherwise use logical shift. */ |