]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
double-int.h (double_int_and_not): New function.
authorRichard Guenther <rguenther@suse.de>
Thu, 29 Jul 2010 13:45:47 +0000 (13:45 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 29 Jul 2010 13:45:47 +0000 (13:45 +0000)
2010-07-28  Richard Guenther  <rguenther@suse.de>

* double-int.h (double_int_and_not): New function.
* combine.c (try_combine): Use it.
* tree-vrp.c (simplify_bit_ops_using_ranges): Likewise.

From-SVN: r162681

gcc/ChangeLog
gcc/combine.c
gcc/double-int.h
gcc/tree-vrp.c

index e081dc26e684359bfa8d54f1fd7a0ce7dc9f7085..40edbc5f48b4c0554e8ed9b118116bc0bcaa60e0 100644 (file)
@@ -1,3 +1,9 @@
+2010-07-28  Richard Guenther  <rguenther@suse.de>
+
+       * double-int.h (double_int_and_not): New function.
+       * combine.c (try_combine): Use it.
+       * tree-vrp.c (simplify_bit_ops_using_ranges): Likewise.
+
 2010-07-29  Bernd Schmidt  <bernds@codesourcery.com>
 
        PR rtl-optimization/42575
index ad96e031c7318b1cabe96591b7ec3cdc7a00e961..9754b089675622ec4b18c23708d18804f15c7aff 100644 (file)
@@ -2601,7 +2601,7 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p)
          i = double_int_and (i, m);
          m = double_int_lshift (m, offset, HOST_BITS_PER_DOUBLE_INT, false);
          i = double_int_lshift (i, offset, HOST_BITS_PER_DOUBLE_INT, false);
-         o = double_int_ior (double_int_and (o, double_int_not (m)), i);
+         o = double_int_ior (double_int_and_not (o, m), i);
 
          combine_merges++;
          subst_insn = i3;
index 00ec4efdad1566c82b9a1f68243b284f1345e5f4..b14693d4fbdbcf07bde5c58592efb66f058ad618 100644 (file)
@@ -158,7 +158,7 @@ static inline double_int
 double_int_not (double_int a)
 {
   a.low = ~a.low;
-  a.high = ~ a.high;
+  a.high = ~a.high;
   return a;
 }
 
@@ -182,6 +182,16 @@ double_int_and (double_int a, double_int b)
   return a;
 }
 
+/* Returns A & ~B.  */
+
+static inline double_int
+double_int_and_not (double_int a, double_int b)
+{
+  a.low &= ~b.low;
+  a.high &= ~b.high;
+  return a;
+}
+
 /* Returns A ^ B.  */
 
 static inline double_int
index fbb549febd52b06ae781fb19a6974c13cfeec19f..05fa186ecbe636bda6f43e7894d4434daf4c6bc1 100644 (file)
@@ -6953,15 +6953,13 @@ simplify_bit_ops_using_ranges (gimple_stmt_iterator *gsi, gimple stmt)
   switch (gimple_assign_rhs_code (stmt))
     {
     case BIT_AND_EXPR:
-      mask = double_int_and (may_be_nonzero0,
-                            double_int_not (must_be_nonzero1));
+      mask = double_int_and_not (may_be_nonzero0, must_be_nonzero1);
       if (double_int_zero_p (mask))
        {
          op = op0;
          break;
        }
-      mask = double_int_and (may_be_nonzero1,
-                            double_int_not (must_be_nonzero0));
+      mask = double_int_and_not (may_be_nonzero1, must_be_nonzero0);
       if (double_int_zero_p (mask))
        {
          op = op1;
@@ -6969,15 +6967,13 @@ simplify_bit_ops_using_ranges (gimple_stmt_iterator *gsi, gimple stmt)
        }
       break;
     case BIT_IOR_EXPR:
-      mask = double_int_and (may_be_nonzero0,
-                            double_int_not (must_be_nonzero1));
+      mask = double_int_and_not (may_be_nonzero0, must_be_nonzero1);
       if (double_int_zero_p (mask))
        {
          op = op1;
          break;
        }
-      mask = double_int_and (may_be_nonzero1,
-                            double_int_not (must_be_nonzero0));
+      mask = double_int_and_not (may_be_nonzero1, must_be_nonzero0);
       if (double_int_zero_p (mask))
        {
          op = op0;