This is the mail archive of the gcc@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]

expmed.c change


1998-10-02  Torbjorn Granlund  <tege@matematik.su.se>

	* expmed.c (expand_divmod): Don't widen for computing remainder
	if we seem to have a divmod pattern for needed mode.

*** expmed.c	1998/04/08 17:33:10	1.2
--- expmed.c	1998/10/02 15:21:07
***************
*** 3649,3658 ****
  
        if (rem_flag)
  	{
! 	  /* Try to produce the remainder directly without a library call.  */
! 	  remainder = sign_expand_binop (compute_mode, umod_optab, smod_optab,
! 					 op0, op1, target,
! 					 unsignedp, OPTAB_WIDEN);
  	  if (remainder == 0)
  	    {
  	      /* No luck there.  Can we do remainder and divide at once
--- 3649,3670 ----
  
        if (rem_flag)
  	{
! 	  /* Try to produce the remainder without producing the quotient.
! 	     If we seem to have a divmod patten that does not require widening,
! 	     don't try windening here.  We should really have an WIDEN argument
! 	     to expand_twoval_binop, since what we'd really like to do here is
! 	     1) try a mod insn in compute_mode
! 	     2) try a divmod insn in compute_mode
! 	     3) try a div insn in compute_mode and multiply-subtract to get
! 	        remainder
! 	     4) try the same things with widening allowed.  */
! 	  remainder
! 	    = sign_expand_binop (compute_mode, umod_optab, smod_optab,
! 				 op0, op1, target,
! 				 unsignedp,
! 				 ((optab2->handlers[(int) compute_mode].insn_code
! 				   != CODE_FOR_nothing)
! 				  ? OPTAB_DIRECT : OPTAB_WIDEN));
  	  if (remainder == 0)
  	    {
  	      /* No luck there.  Can we do remainder and divide at once


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