This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] redo - fix optimizations on vector ROTATERT in combine.c
- From: "Igor Shevlyakov" <igor at microunity dot com>
- To: <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 28 Aug 2002 11:23:02 -0700
- Subject: [PATCH] redo - fix optimizations on vector ROTATERT in combine.c
- Organization: Microunity
When combine.c (simplify_shift_const) converting ROTATERT to ROTATE new
shift count is calculated incorrectly for vector operands since each
element is rotated by count not whole vector as bit-stream. This patch
fixes it
======= ChangeLog entry =======
2002-08-28 Igor Shevlyakov <igor@microunity.com>
* combine.c (simplify_shift_const): Calculate rotate count
correctly for vector operands.
======= patch ===============
Index: combine.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/combine.c,v
retrieving revision 1.310
diff -c -3 -p -r1.310 combine.c
*** combine.c 19 Aug 2002 18:18:11 -0000 1.310
--- combine.c 28 Aug 2002 18:18:15 -0000
*************** simplify_shift_const (x, code, result_mo
*** 9042,9048 ****
/* Convert ROTATERT to ROTATE. */
if (code == ROTATERT)
! code = ROTATE, count = GET_MODE_BITSIZE (result_mode) - 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
--- 9042,9054 ----
/* Convert ROTATERT to ROTATE. */
if (code == ROTATERT)
! {
! code = ROTATE;
! if (VECTOR_MODE_P (result_mode))
! count = GET_MODE_BITSIZE (result_mode) / GET_MODE_NUNITS
(result_mode) - count;
! else
! count = GET_MODE_BITSIZE (result_mode) - 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