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]

[RFA, trunk] Another round of complex simplification.


L.S.,

The attached patch was bootstrapped (C/Fortran), make check'd (Fortran
only), installed and compared against a fresh -O2 -ffast-math run of the
LAPACK tests.

No regressions.  OK to install ?

Thanks,

-- 
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
Join GNU Fortran 95: http://g95.sourceforge.net/ (under construction)
2002-05-19  Toon Moene  <toon@moene.indiv.nluug.nl>

	* optabs.c (expand_cmplxdiv_wide): Use complex_part_zero_p.
	(expand_binop): Ditto (3 times).

*** optabs.c.orig	Sun May 19 11:07:37 2002
--- optabs.c	Sun May 19 17:21:31 2002
*************** expand_cmplxdiv_wide (real0, real1, imag
*** 555,559 ****
    /* Calculate dividend.  */
  
!   if (imag0 == 0)
      {
        /* Compute a / (c+id) as a(c/d) / (c(c/d)+d) + i (-a) / (c(c/d)+d).  */
--- 555,559 ----
    /* Calculate dividend.  */
  
!   if (complex_part_zero_p (imag0, class, submode))
      {
        /* Compute a / (c+id) as a(c/d) / (c(c/d)+d) + i (-a) / (c(c/d)+d).  */
*************** expand_binop (mode, binoptab, op0, op1, 
*** 1554,1558 ****
  	real1 = op1;
  
!       if (real0 == 0 || real1 == 0 || ! (imag0 != 0|| imag1 != 0))
  	abort ();
  
--- 1554,1558 ----
  	real1 = op1;
  
!       if (real0 == 0 || real1 == 0 || ! (imag0 != 0 || imag1 != 0))
  	abort ();
  
*************** expand_binop (mode, binoptab, op0, op1, 
*** 1571,1578 ****
  	    emit_move_insn (realr, res);
  
! 	  if (imag0 && imag1)
  	    res = expand_binop (submode, binoptab, imag0, imag1,
  				imagr, unsignedp, methods);
! 	  else if (imag0)
  	    res = imag0;
  	  else if (binoptab->code == MINUS)
--- 1571,1579 ----
  	    emit_move_insn (realr, res);
  
! 	  if (!complex_part_zero_p (imag0, class, submode)
! 	      && !complex_part_zero_p (imag1, class, submode))
  	    res = expand_binop (submode, binoptab, imag0, imag1,
  				imagr, unsignedp, methods);
! 	  else if (!complex_part_zero_p (imag0, class, submode))
  	    res = imag0;
  	  else if (binoptab->code == MINUS)
*************** expand_binop (mode, binoptab, op0, op1, 
*** 1594,1598 ****
  	  /* (a+ib) * (c+id) = (ac-bd) + i(ad+cb) */
  
! 	  if (imag0 && imag1)
  	    {
  	      rtx temp1, temp2;
--- 1595,1600 ----
  	  /* (a+ib) * (c+id) = (ac-bd) + i(ad+cb) */
  
! 	  if (!complex_part_zero_p (imag0, class, submode)
! 	       && !complex_part_zero_p (imag1, class, submode))
  	    {
  	      rtx temp1, temp2;
*************** expand_binop (mode, binoptab, op0, op1, 
*** 1657,1661 ****
  		emit_move_insn (realr, res);
  
! 	      if (imag0 != 0)
  		res = expand_binop (submode, binoptab,
  				    real1, imag0, imagr, unsignedp, methods);
--- 1659,1663 ----
  		emit_move_insn (realr, res);
  
! 	      if (!complex_part_zero_p (imag0, class, submode))
  		res = expand_binop (submode, binoptab,
  				    real1, imag0, imagr, unsignedp, methods);

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