]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
combine.c (try_widen_shift_mode): Allow widening if the high-order bits are zero.
authorAdam Nemet <anemet@caviumnetworks.com>
Sat, 18 Jul 2009 21:48:19 +0000 (21:48 +0000)
committerAdam Nemet <nemet@gcc.gnu.org>
Sat, 18 Jul 2009 21:48:19 +0000 (21:48 +0000)
* combine.c (try_widen_shift_mode) <LSHIFTRT>: Allow widening if the
high-order bits are zero.

From-SVN: r149779

gcc/ChangeLog
gcc/combine.c

index 96430050d90b87784929a33370b7f54bcf27a31d..1c418d1a04b77293620d20db2ca959187df46b51 100644 (file)
@@ -1,3 +1,8 @@
+2009-07-18  Adam Nemet  <anemet@caviumnetworks.com>
+
+       * combine.c (try_widen_shift_mode) <LSHIFTRT>: Allow widening if the
+       high-order bits are zero.
+
 2009-07-18  Adam Nemet  <anemet@caviumnetworks.com>
 
        * combine.c (simplify_shift_const_1): Split code to determine
index a0157df71406e33272b0223a297cb025e0f40076..12f0ed8223f1d25f15533767d0595d573fd45aa8 100644 (file)
@@ -9005,8 +9005,15 @@ try_widen_shift_mode (enum rtx_code code, rtx op,
          > (unsigned) (GET_MODE_BITSIZE (mode)
                        - GET_MODE_BITSIZE (orig_mode)))
        return mode;
-      /* fall through */
+      return orig_mode;
+
     case LSHIFTRT:
+      /* Similarly here but with zero bits.  */
+      if (GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT
+         && (nonzero_bits (op, mode) & ~GET_MODE_MASK (orig_mode)) == 0)
+       return mode;
+      /* fall through */
+
     case ROTATE:
       return orig_mode;