This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] redo - fix optimizations on vector ROTATERT in combine.c


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]