revert: simplify-rtx.c (simplify_const_binary_operation): Use the shift_truncation_ma...
authorBernd Schmidt <bernds@codesourcery.com>
Wed, 6 Jul 2011 23:56:28 +0000 (23:56 +0000)
committerBernd Schmidt <bernds@gcc.gnu.org>
Wed, 6 Jul 2011 23:56:28 +0000 (23:56 +0000)
Revert:
* simplify-rtx.c (simplify_const_binary_operation): Use the
shift_truncation_mask hook instead of performing modulo by
width.  Compare against mode precision, not bitsize.
* combine.c (combine_simplify_rtx, simplify_shift_const_1):
Use shift_truncation_mask instead of constructing the value
manually.

From-SVN: r175949

gcc/ChangeLog
gcc/combine.c
gcc/simplify-rtx.c

index 6c4d352053ae438e1e3fb4b6736b5b5ce8728fa1..9295bb4fcaa0f59b92e00013a3471898a6b63fde 100644 (file)
        simplify_comparison, record_promoted_value, simplify_compare_const,
        record_dead_and_set_regs_1): Likewise.
 
+       Revert:
+       * simplify-rtx.c (simplify_const_binary_operation): Use the
+       shift_truncation_mask hook instead of performing modulo by
+       width.  Compare against mode precision, not bitsize.
+       * combine.c (combine_simplify_rtx, simplify_shift_const_1):
+       Use shift_truncation_mask instead of constructing the value
+       manually.
+
 2011-07-06  Michael Meissner  <meissner@linux.vnet.ibm.com>
 
        * config/rs6000/rs6000-protos.h (rs6000_call_indirect_aix): New
index 787b0db98208ad302c5939731de4698b8f54a888..4dbf022fd1be5b6e6dabb0b8470055fab43cfb87 100644 (file)
@@ -5939,7 +5939,9 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int in_dest,
       else if (SHIFT_COUNT_TRUNCATED && !REG_P (XEXP (x, 1)))
        SUBST (XEXP (x, 1),
               force_to_mode (XEXP (x, 1), GET_MODE (XEXP (x, 1)),
-                             targetm.shift_truncation_mask (GET_MODE (x)),
+                             ((unsigned HOST_WIDE_INT) 1
+                              << exact_log2 (GET_MODE_BITSIZE (GET_MODE (x))))
+                             - 1,
                              0));
       break;
 
@@ -9875,7 +9877,7 @@ simplify_shift_const_1 (enum rtx_code code, enum machine_mode result_mode,
      want to do this inside the loop as it makes it more difficult to
      combine shifts.  */
   if (SHIFT_COUNT_TRUNCATED)
-    orig_count &= targetm.shift_truncation_mask (mode);
+    orig_count &= GET_MODE_BITSIZE (mode) - 1;
 
   /* If we were given an invalid count, don't do anything except exactly
      what was requested.  */
index 5a98b69abbc97bb58b7fb89cef23bffaae5737e5..82b818b02f1c597c02e4618269b47beb19d8ad70 100644 (file)
@@ -3768,8 +3768,8 @@ simplify_const_binary_operation (enum rtx_code code, enum machine_mode mode,
             shift_truncation_mask, since the shift might not be part of an
             ashlM3, lshrM3 or ashrM3 instruction.  */
          if (SHIFT_COUNT_TRUNCATED)
-           arg1 &= targetm.shift_truncation_mask (mode);
-         else if (arg1 < 0 || arg1 >= GET_MODE_PRECISION (mode))
+           arg1 = (unsigned HOST_WIDE_INT) arg1 % width;
+         else if (arg1 < 0 || arg1 >= GET_MODE_BITSIZE (mode))
            return 0;
 
          val = (code == ASHIFT