From: rth Date: Sun, 8 Sep 2002 03:34:16 +0000 (+0000) Subject: * combine.c (simplify_shift_const): Calculate rotate count X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=commitdiff_plain;h=77f1f7c1b1201df83ce1e5021f566beb8efdf374 * combine.c (simplify_shift_const): Calculate rotate count correctly for vector operands. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@56928 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6fc185ae984..9ca0341e360 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2002-09-07 Igor Shevlyakov + + * combine.c (simplify_shift_const): Calculate rotate count + correctly for vector operands. + 2002-09-07 Ansgar Esztermann * c-typeck.c (c_tree_expr_nonnegative_p): New function. diff --git a/gcc/combine.c b/gcc/combine.c index 10ee904681e..606b200a957 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -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