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] - 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-26  Igor Shevlyakov <igor@microunity.com>

	* combine.c (simplify_shift_const): Converting from ROTATERT to
ROTATE for
	  vector operands calculated shift count incorrectly.

======= 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	26 Aug 2002 22:22:56 -0000
*************** simplify_shift_const (x, code, result_mo
*** 9041,9048 ****
  	break;
  
        /* 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
--- 9041,9053 ----
  	break;
  
        /* 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]