Commit 853d8828 by Richard Henderson Committed by Richard Henderson

combine.c (simplify_shift_const): Revert previous two changes.

        * combine.c (simplify_shift_const): Revert previous two
        changes.  If SHIFT_COUNT_TRUNCATED, crop the shift count
        before the main loop.

From-SVN: r35742
parent cbd273a8
2000-08-16 Richard Henderson <rth@cygnus.com>
* combine.c (simplify_shift_const): Revert previous two
changes. If SHIFT_COUNT_TRUNCATED, crop the shift count
before the main loop.
2000-08-15 Richard Henderson <rth@cygnus.com> 2000-08-15 Richard Henderson <rth@cygnus.com>
* combine.c (simplify_shift_const): Bound shift count when * combine.c (simplify_shift_const): Bound shift count when
......
...@@ -8851,6 +8851,14 @@ simplify_shift_const (x, code, result_mode, varop, input_count) ...@@ -8851,6 +8851,14 @@ simplify_shift_const (x, code, result_mode, varop, input_count)
count = input_count; count = input_count;
/* Make sure and truncate the "natural" shift on the way in. We don't
want to do this inside the loop as it makes it more difficult to
combine shifts. */
#ifdef SHIFT_COUNT_TRUNCATED
if (SHIFT_COUNT_TRUNCATED)
count %= GET_MODE_BITSIZE (mode);
#endif
/* Unless one of the branches of the `if' in this loop does a `continue', /* Unless one of the branches of the `if' in this loop does a `continue',
we will `break' the loop after the `if'. */ we will `break' the loop after the `if'. */
...@@ -8879,11 +8887,10 @@ simplify_shift_const (x, code, result_mode, varop, input_count) ...@@ -8879,11 +8887,10 @@ simplify_shift_const (x, code, result_mode, varop, input_count)
? result_mode : mode); ? result_mode : mode);
/* Handle cases where the count is greater than the size of the mode /* Handle cases where the count is greater than the size of the mode
minus 1. If SHIFT_COUNT_TRUNCATED, there aren't really any such minus 1. For ASHIFT, use the size minus one as the count (this can
cases. Otherwise, for ASHIFT, use the size minus one as the count occur when simplifying (lshiftrt (ashiftrt ..))). For rotates,
(this can occur when simplifying (lshiftrt (ashiftrt ..))). For take the count modulo the size. For other shifts, the result is
rotates, take the count modulo the size. For other shifts, the zero.
result is zero.
Since these shifts are being produced by the compiler by combining Since these shifts are being produced by the compiler by combining
multiple operations, each of which are defined, we know what the multiple operations, each of which are defined, we know what the
...@@ -8891,11 +8898,6 @@ simplify_shift_const (x, code, result_mode, varop, input_count) ...@@ -8891,11 +8898,6 @@ simplify_shift_const (x, code, result_mode, varop, input_count)
if (count > GET_MODE_BITSIZE (shift_mode) - 1) if (count > GET_MODE_BITSIZE (shift_mode) - 1)
{ {
#ifdef SHIFT_COUNT_TRUNCATED
if (SHIFT_COUNT_TRUNCATED)
count %= GET_MODE_BITSIZE (shift_mode);
else
#endif
if (code == ASHIFTRT) if (code == ASHIFTRT)
count = GET_MODE_BITSIZE (shift_mode) - 1; count = GET_MODE_BITSIZE (shift_mode) - 1;
else if (code == ROTATE || code == ROTATERT) else if (code == ROTATE || code == ROTATERT)
...@@ -9149,8 +9151,6 @@ simplify_shift_const (x, code, result_mode, varop, input_count) ...@@ -9149,8 +9151,6 @@ simplify_shift_const (x, code, result_mode, varop, input_count)
break; break;
count += first_count; count += first_count;
if (count >= GET_MODE_BITSIZE (shift_mode))
count = GET_MODE_BITSIZE (shift_mode) - 1;
varop = XEXP (varop, 0); varop = XEXP (varop, 0);
continue; continue;
} }
...@@ -9204,9 +9204,6 @@ simplify_shift_const (x, code, result_mode, varop, input_count) ...@@ -9204,9 +9204,6 @@ simplify_shift_const (x, code, result_mode, varop, input_count)
else else
count = signed_count; count = signed_count;
if (count >= GET_MODE_BITSIZE (shift_mode))
count = GET_MODE_BITSIZE (shift_mode) - 1;
varop = XEXP (varop, 0); varop = XEXP (varop, 0);
continue; continue;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment