diff options
author | Igor Shevlyakov <igor@microunity.com> | 2002-09-08 03:34:16 +0000 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2002-09-07 20:34:16 -0700 |
commit | ad9df12ff5182840605b6252b882d36c0f68895c (patch) | |
tree | ba56fa80b290eaa79079e57b916245ec0a74cf53 /gcc/combine.c | |
parent | 54c93c301960dfbc469ee3501ba4872adbfdaf1f (diff) | |
download | gcc-ad9df12ff5182840605b6252b882d36c0f68895c.zip gcc-ad9df12ff5182840605b6252b882d36c0f68895c.tar.gz gcc-ad9df12ff5182840605b6252b882d36c0f68895c.tar.bz2 |
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
Diffstat (limited to 'gcc/combine.c')
-rw-r--r-- | gcc/combine.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/combine.c b/gcc/combine.c index 10ee904..606b200 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 |