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]

loop.c and new fp conditionals infr. once again


Agan wrong list :(

Hi
I've finally got time to return to this patch.  This one should be fine now.
Originally I got confused by the did_reverse_condition code around - it is
somewhat obfstructated, but it just duplicates the logic of
reversed_comparison_code, so it is redundant.

This patch also brings considerably better results ifcvt.c on making fp
conditional moves on i386.

Honza

Wed Feb 21 18:30:02 CET 2001  Jan Hubicka  <jh@suse.cz>

	* loop.c (canonicalize_condition): Move to reversed_comparison_code.

Index: loop.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/loop.c,v
retrieving revision 1.322
diff -c -3 -p -r1.322 loop.c
*** loop.c	2001/01/26 22:06:41	1.322
--- loop.c	2001/02/21 17:29:30
*************** canonicalize_condition (insn, cond, reve
*** 8305,8311 ****
    rtx tem;
    rtx op0, op1;
    int reverse_code = 0;
-   int did_reverse_condition = 0;
    enum machine_mode mode;
  
    code = GET_CODE (cond);
--- 8305,8310 ----
*************** canonicalize_condition (insn, cond, reve
*** 8314,8323 ****
    op1 = XEXP (cond, 1);
  
    if (reverse)
!     {
!       code = reverse_condition (code);
!       did_reverse_condition ^= 1;
!     }
  
    if (earliest)
      *earliest = insn;
--- 8313,8321 ----
    op1 = XEXP (cond, 1);
  
    if (reverse)
!     code = reversed_comparison_code (cond, insn);
!   if (code == UNKNOWN)
!     return 0;
  
    if (earliest)
      *earliest = insn;
*************** canonicalize_condition (insn, cond, reve
*** 8434,8443 ****
  		       || mode == VOIDmode || inner_mode == VOIDmode))
  
  	    {
- 	      /* We might have reversed a LT to get a GE here.  But this wasn't
- 		 actually the comparison of data, so we don't flag that we
- 		 have had to reverse the condition.  */
- 	      did_reverse_condition ^= 1;
  	      reverse_code = 1;
  	      x = SET_SRC (set);
  	    }
--- 8438,8443 ----
*************** canonicalize_condition (insn, cond, reve
*** 8455,8464 ****
  	    code = GET_CODE (x);
  	  if (reverse_code)
  	    {
! 	      code = reverse_condition (code);
  	      if (code == UNKNOWN)
  		return 0;
- 	      did_reverse_condition ^= 1;
  	      reverse_code = 0;
  	    }
  
--- 8455,8463 ----
  	    code = GET_CODE (x);
  	  if (reverse_code)
  	    {
! 	      code = reversed_comparison_code (x, prev);
  	      if (code == UNKNOWN)
  		return 0;
  	      reverse_code = 0;
  	    }
  
*************** canonicalize_condition (insn, cond, reve
*** 8520,8534 ****
  	  break;
  	}
      }
- 
-   /* If this was floating-point and we reversed anything other than an
-      EQ or NE or (UN)ORDERED, return zero.  */
-   if (TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT
-       && did_reverse_condition
-       && code != NE && code != EQ && code != UNORDERED && code != ORDERED
-       && ! flag_fast_math
-       && GET_MODE_CLASS (GET_MODE (op0)) == MODE_FLOAT)
-     return 0;
  
  #ifdef HAVE_cc0
    /* Never return CC0; return zero instead.  */
--- 8519,8524 ----


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