combine.c (simplify_shift_const): Calculate rotate count correctly for vector operands.
authorIgor Shevlyakov <igor@microunity.com>
Sun, 8 Sep 2002 03:34:16 +0000 (03:34 +0000)
committerRichard Henderson <rth@gcc.gnu.org>
Sun, 8 Sep 2002 03:34:16 +0000 (20:34 -0700)
        * combine.c (simplify_shift_const): Calculate rotate count
        correctly for vector operands.

From-SVN: r56928

gcc/ChangeLog
gcc/combine.c

index 6fc185a..9ca0341 100644 (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.
index 10ee904..606b200 100644 (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