X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=blobdiff_plain;f=gcc%2Fdouble-int.c;h=000be2bf7b08000b135b53943b3287e2ac9d3523;hp=0c0eacf246dc0e899c10b2be98500f2504e47a3f;hb=f730f36c4c1fe1dfc04e0a8a627fb3374276d2be;hpb=b01ea83208c555df8e974af14ad051e0fbcb997a diff --git a/gcc/double-int.c b/gcc/double-int.c index 0c0eacf246d..000be2bf7b0 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. */ @@ -1037,32 +1049,6 @@ double_int_rshift (double_int a, HOST_WIDE_INT count, unsigned int prec, bool ar return ret; } -/* Constructs tree in type TYPE from with value given by CST. Signedness of CST - is assumed to be the same as the signedness of TYPE. */ - -tree -double_int_to_tree (tree type, double_int cst) -{ - 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. */ - -double_int -double_int_lshift (double_int a, HOST_WIDE_INT count, unsigned int prec, bool arith) -{ - double_int ret; - lshift_double (a.low, a.high, count, prec, &ret.low, &ret.high, arith); - return ret; -} - /* Returns -1 if A < B, 0 if A == B and 1 if A > B. Signedness of the comparison is given by UNS. */