OSDN Git Service

Daily bump.
[pf3gnuchains/gcc-fork.git] / gcc / double-int.c
index 8e4a3f5..0c0eacf 100644 (file)
@@ -1013,18 +1013,6 @@ 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.  */
@@ -1055,22 +1043,24 @@ double_int_rshift (double_int a, HOST_WIDE_INT count, unsigned int prec, bool ar
 tree
 double_int_to_tree (tree type, double_int cst)
 {
-  cst = double_int_ext (cst, TYPE_PRECISION (type), TYPE_UNSIGNED (type));
-
-  return build_int_cst_wide (type, cst.low, cst.high);
+  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;
 }
 
-/* Returns true if CST fits into range of TYPE.  Signedness of CST is assumed
-   to be the same as the signedness of TYPE.  */
+/* 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.  */
 
-bool
-double_int_fits_to_tree_p (const_tree type, double_int cst)
+double_int
+double_int_lshift (double_int a, HOST_WIDE_INT count, unsigned int prec, bool arith)
 {
-  double_int ext = double_int_ext (cst,
-                                  TYPE_PRECISION (type),
-                                  TYPE_UNSIGNED (type));
-
-  return double_int_equal_p (cst, ext);
+  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