combine.c (simplify_shift_const): Calculate rotate count correctly for vector operands.

* combine.c (simplify_shift_const): Calculate rotate count
        correctly for vector operands.

From-SVN: r56928
This commit is contained in:
Igor Shevlyakov 2002-09-08 03:34:16 +00:00 committed by Richard Henderson
parent 54c93c3019
commit ad9df12ff5
2 changed files with 13 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2002-09-07 Igor Shevlyakov <igor@microunity.com>
* combine.c (simplify_shift_const): Calculate rotate count
correctly for vector operands.
2002-09-07 Ansgar Esztermann <ansgar@thphy.uni-duesseldorf.de>
* c-typeck.c (c_tree_expr_nonnegative_p): New function.

View File

@ -9046,7 +9046,14 @@ simplify_shift_const (x, code, result_mode, varop, orig_count)
/* Convert ROTATERT to ROTATE. */
if (code == ROTATERT)
code = ROTATE, count = GET_MODE_BITSIZE (result_mode) - count;
{
unsigned int bitsize = GET_MODE_BITSIZE (result_mode);;
code = ROTATE;
if (VECTOR_MODE_P (result_mode))
count = bitsize / GET_MODE_NUNITS (result_mode) - count;
else
count = bitsize - count;
}
/* We need to determine what mode we will do the shift in. If the
shift is a right shift or a ROTATE, we must always do it in the mode