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]

PATCH: Fix unsigned branches on vax


This patch fixes a number of testsuite FAILs on the vax involving unsigned
branches.  I am going to install in a day or so if there are no negative
comments or suggestions.  NOTICE_UPDATE_CC is getting pretty ugly and the
whole thing should be rewritten using insn attributes.  However, that's a
project for another day.  Tested with several bootstraps and check-gcc
under vax-dec-ultrix4.3.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

2001-05-09  John David Anglin  <dave@hiauly1.hia.nrc.ca>

	* vax.h (NOTICE_UPDATE_CC): Set CC_NO_OVERFLOW in cc_status.flags
	for integer operations that don't update C bit.

--- vax.h.orig	Thu May  3 18:02:05 2001
+++ vax.h	Wed May  9 16:16:41 2001
@@ -986,7 +986,30 @@
 	CC_STATUS_INIT;						\
       else if (GET_CODE (SET_DEST (EXP)) != ZERO_EXTRACT	\
 	       && GET_CODE (SET_DEST (EXP)) != PC)		\
-	{ cc_status.flags = 0;					\
+	{							\
+	  cc_status.flags = 0;					\
+	  /* The integer operations below don't set carry or	\
+	     set it in an incompatible way.  That's ok though	\
+	     as the Z bit is all we need when doing unsigned	\
+	     comparisons on the result of these insns (since	\
+	     they're always with 0).  Set CC_NO_OVERFLOW to	\
+	     generate the correct unsigned branches.  */	\
+	  switch (GET_CODE (SET_SRC (EXP)))			\
+	    {							\
+	    case NEG:						\
+	      if (GET_MODE_CLASS (GET_MODE (EXP)) == MODE_FLOAT)\
+	 	break;						\
+	    case AND:						\
+	    case IOR:						\
+	    case XOR:						\
+	    case NOT:						\
+	    case MEM:						\
+	    case REG:						\
+	      cc_status.flags = CC_NO_OVERFLOW;			\
+	      break;						\
+	    default:						\
+	      break;						\
+	    }							\
 	  cc_status.value1 = SET_DEST (EXP);			\
 	  cc_status.value2 = SET_SRC (EXP); } }			\
   else if (GET_CODE (EXP) == PARALLEL				\


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