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 V850] Use existing predicates for RTL objects


According to projects/beginner.html
* Use predicates for RTL objects

This patch is to use existing predicates for RTL objects at config/v850 directory.
Tested on v850-elf simulator.


Cheers,
Pearly
2009-06-02  Shujing Zhao  <pearly.zhao@oracle.com>

	* config/v850/predicates.md: Use REG_P, MEM_P, CONST_INT_P, LABEL_P,
	NONJUMP_INSN_P and NOTE_P where applicable.
	* config/v850/v850.c: Ditto.
	* config/v850/v850.h: Ditto.
	* config/v850/v850.md: Ditto.

Index: predicates.md
===================================================================
--- predicates.md	(revision 148027)
+++ predicates.md	(working copy)
@@ -22,7 +22,7 @@
 (define_predicate "reg_or_0_operand"
   (match_code "reg,subreg,const_int,const_double")
 {
-  if (GET_CODE (op) == CONST_INT)
+  if (CONST_INT_P (op))
     return INTVAL (op) == 0;
 
   else if (GET_CODE (op) == CONST_DOUBLE)
@@ -38,7 +38,7 @@ (define_predicate "reg_or_0_operand"
 (define_predicate "reg_or_int5_operand"
   (match_code "reg,subreg,const_int")
 {
-  if (GET_CODE (op) == CONST_INT)
+  if (CONST_INT_P (op))
     return CONST_OK_FOR_J (INTVAL (op));
 
   else
@@ -51,7 +51,7 @@ (define_predicate "reg_or_int5_operand"
 (define_predicate "reg_or_int9_operand"
   (match_code "reg,subreg,const_int")
 {
-  if (GET_CODE (op) == CONST_INT)
+  if (CONST_INT_P (op))
     return CONST_OK_FOR_O (INTVAL (op));
 
   return register_operand (op, mode);
@@ -62,7 +62,7 @@ (define_predicate "reg_or_int9_operand"
 (define_predicate "reg_or_const_operand"
   (match_code "reg,const_int")
 {
-  if (GET_CODE (op) == CONST_INT)
+  if (CONST_INT_P (op))
     return TRUE;
 
   return register_operand (op, mode);
@@ -75,8 +75,8 @@ (define_predicate "call_address_operand"
 {
   /* Only registers are valid call operands if TARGET_LONG_CALLS.  */
   if (TARGET_LONG_CALLS)
-    return GET_CODE (op) == REG;
-  return (GET_CODE (op) == SYMBOL_REF || GET_CODE (op) == REG);
+    return REG_P (op);
+  return (GET_CODE (op) == SYMBOL_REF || REG_P (op));
 })
 
 ;; TODO: Add a comment here.
@@ -88,7 +88,7 @@ (define_predicate "movsi_source_operand"
      must be done with HIGH & LO_SUM patterns.  */
   if (CONSTANT_P (op)
       && GET_CODE (op) != HIGH
-      && !(GET_CODE (op) == CONST_INT
+      && !(CONST_INT_P (op)
            && (CONST_OK_FOR_J (INTVAL (op))
                || CONST_OK_FOR_K (INTVAL (op))
                || CONST_OK_FOR_L (INTVAL (op)))))
@@ -104,7 +104,7 @@ (define_predicate "special_symbolref_ope
 {
   if (GET_CODE (op) == CONST
       && GET_CODE (XEXP (op, 0)) == PLUS
-      && GET_CODE (XEXP (XEXP (op, 0), 1)) == CONST_INT
+      && CONST_INT_P (XEXP (XEXP (op, 0), 1))
       && CONST_OK_FOR_K (INTVAL (XEXP (XEXP (op, 0), 1))))
     op = XEXP (XEXP (op, 0), 0);
 
@@ -120,7 +120,7 @@ (define_predicate "special_symbolref_ope
 (define_predicate "power_of_two_operand"
   (match_code "const_int")
 {
-  if (GET_CODE (op) != CONST_INT)
+  if (!CONST_INT_P (op))
     return 0;
 
   if (exact_log2 (INTVAL (op)) == -1)
@@ -171,9 +171,9 @@ (define_predicate "pattern_is_ok_for_pro
       dest = SET_DEST (vector_element);
       src = SET_SRC (vector_element);
 
-      if (GET_CODE (dest) != MEM
+      if (!MEM_P (dest)
 	  || GET_MODE (dest) != SImode
-	  || GET_CODE (src) != REG
+	  || !REG_P (src)
 	  || GET_MODE (src) != SImode
 	  || ! register_is_ok_for_epilogue (src, SImode))
 	return 0;
@@ -181,10 +181,10 @@ (define_predicate "pattern_is_ok_for_pro
       plus = XEXP (dest, 0);
 
       if ( GET_CODE (plus) != PLUS
-	  || GET_CODE (XEXP (plus, 0)) != REG
+	  || !REG_P (XEXP (plus, 0))
 	  || GET_MODE (XEXP (plus, 0)) != SImode
 	  || REGNO (XEXP (plus, 0)) != STACK_POINTER_REGNUM
-	  || GET_CODE (XEXP (plus, 1)) != CONST_INT)
+	  || !CONST_INT_P (XEXP (plus, 1)))
 	return 0;
 
       /* If the register is being pushed somewhere other than the stack
@@ -203,7 +203,7 @@ (define_predicate "pattern_is_ok_for_pro
       vector_element = XVECEXP (op, 0, i);
 
       if (GET_CODE (vector_element) != CLOBBER
-	  || GET_CODE (XEXP (vector_element, 0)) != REG
+	  || !REG_P (XEXP (vector_element, 0))
 	  || !(REGNO (XEXP (vector_element, 0)) == 10
 	       || (TARGET_LONG_CALLS ? (REGNO (XEXP (vector_element, 0)) == 11) : 0 )))
 	return 0;
@@ -252,20 +252,20 @@ (define_predicate "pattern_is_ok_for_epi
       dest = SET_DEST (vector_element);
       src = SET_SRC (vector_element);
 
-      if (GET_CODE (dest) != REG
+      if (!REG_P (dest)
 	  || GET_MODE (dest) != SImode
 	  || ! register_is_ok_for_epilogue (dest, SImode)
-	  || GET_CODE (src) != MEM
+	  || !MEM_P (src)
 	  || GET_MODE (src) != SImode)
 	return 0;
 
       plus = XEXP (src, 0);
 
       if (GET_CODE (plus) != PLUS
-	  || GET_CODE (XEXP (plus, 0)) != REG
+	  || !REG_P (XEXP (plus, 0))
 	  || GET_MODE (XEXP (plus, 0)) != SImode
 	  || REGNO (XEXP (plus, 0)) != STACK_POINTER_REGNUM
-	  || GET_CODE (XEXP (plus, 1)) != CONST_INT)
+	  || !CONST_INT_P (XEXP (plus, 1)))
 	return 0;
     }
 
@@ -279,7 +279,7 @@ (define_predicate "register_is_ok_for_ep
   (match_code "reg")
 {
   /* The save/restore routines can only cope with registers 20 - 31.  */
-  return ((GET_CODE (op) == REG)
+  return ((REG_P (op))
           && (((REGNO (op) >= 20) && REGNO (op) <= 31)));
 })
 
@@ -324,20 +324,20 @@ (define_predicate "pattern_is_ok_for_dis
       dest = SET_DEST (vector_element);
       src  = SET_SRC (vector_element);
 
-      if (   GET_CODE (dest) != REG
+      if (   !REG_P (dest)
 	  || GET_MODE (dest) != SImode
 	  || ! register_is_ok_for_epilogue (dest, SImode)
-	  || GET_CODE (src) != MEM
+	  || !MEM_P (src)
 	  || GET_MODE (src) != SImode)
 	return 0;
 
       plus = XEXP (src, 0);
 
       if (   GET_CODE (plus) != PLUS
-	  || GET_CODE (XEXP (plus, 0)) != REG
+	  || !REG_P (XEXP (plus, 0))
 	  || GET_MODE (XEXP (plus, 0)) != SImode
 	  || REGNO    (XEXP (plus, 0)) != STACK_POINTER_REGNUM
-	  || GET_CODE (XEXP (plus, 1)) != CONST_INT)
+	  || !CONST_INT_P (XEXP (plus, 1)))
 	return 0;
     }
 
@@ -385,9 +385,9 @@ (define_predicate "pattern_is_ok_for_pre
       dest = SET_DEST (vector_element);
       src  = SET_SRC (vector_element);
 
-      if (   GET_CODE (dest) != MEM
+      if (   !MEM_P (dest)
 	  || GET_MODE (dest) != SImode
-	  || GET_CODE (src) != REG
+	  || !REG_P (src)
 	  || GET_MODE (src) != SImode
 	  || ! register_is_ok_for_epilogue (src, SImode)
 	     )
@@ -396,10 +396,10 @@ (define_predicate "pattern_is_ok_for_pre
       plus = XEXP (dest, 0);
 
       if (   GET_CODE (plus) != PLUS
-	  || GET_CODE (XEXP (plus, 0)) != REG
+	  || !REG_P (XEXP (plus, 0))
 	  || GET_MODE (XEXP (plus, 0)) != SImode
 	  || REGNO    (XEXP (plus, 0)) != STACK_POINTER_REGNUM
-	  || GET_CODE (XEXP (plus, 1)) != CONST_INT)
+	  || !CONST_INT_P (XEXP (plus, 1)))
 	return 0;
 
       /* If the register is being pushed somewhere other than the stack
@@ -429,7 +429,7 @@ (define_predicate "not_power_of_two_oper
   else
     return 0;
 
-  if (GET_CODE (op) != CONST_INT)
+  if (!CONST_INT_P (op))
     return 0;
 
   if (exact_log2 (~INTVAL (op) & mask) == -1)
Index: v850.c
===================================================================
--- v850.c	(revision 148027)
+++ v850.c	(working copy)
@@ -450,9 +450,9 @@ v850_rtx_costs (rtx x,
 	      || GET_MODE (x) == HImode
 	      || GET_MODE (x) == QImode))
         {
-	  if (GET_CODE (XEXP (x, 1)) == REG)
+	  if (REG_P (XEXP (x, 1)))
 	    *total = 4;
-	  else if (GET_CODE (XEXP (x, 1)) == CONST_INT)
+	  else if (CONST_INT_P (XEXP (x, 1)))
 	    {
 	      if (CONST_OK_FOR_O (INTVAL (XEXP (x, 1))))
 	        *total = 6;
@@ -623,7 +623,7 @@ print_operand (FILE * file, rtx x, int c
 	case MEM:
 	  x = XEXP (adjust_address (x, SImode, 4), 0);
 	  print_operand_address (file, x);
-	  if (GET_CODE (x) == CONST_INT)
+	  if (CONST_INT_P (x))
 	    fprintf (file, "[r0]");
 	  break;
 	  
@@ -634,7 +634,7 @@ print_operand (FILE * file, rtx x, int c
     case 'S':
       {
         /* If it's a reference to a TDA variable, use sst/sld vs. st/ld.  */
-        if (GET_CODE (x) == MEM && ep_memory_operand (x, GET_MODE (x), FALSE))
+        if (MEM_P (x) && ep_memory_operand (x, GET_MODE (x), FALSE))
           fputs ("s", file);
 
         break;
@@ -642,7 +642,7 @@ print_operand (FILE * file, rtx x, int c
     case 'T':
       {
 	/* Like an 'S' operand above, but for unsigned loads only.  */
-        if (GET_CODE (x) == MEM && ep_memory_operand (x, GET_MODE (x), TRUE))
+        if (MEM_P (x) && ep_memory_operand (x, GET_MODE (x), TRUE))
           fputs ("s", file);
 
         break;
@@ -663,7 +663,7 @@ print_operand (FILE * file, rtx x, int c
       fputs (reg_names[0], file);
       break;
     case 'z':			/* reg or zero */
-      if (GET_CODE (x) == REG)
+      if (REG_P (x))
 	fputs (reg_names[REGNO (x)], file);
       else
 	{
@@ -675,7 +675,7 @@ print_operand (FILE * file, rtx x, int c
       switch (GET_CODE (x))
 	{
 	case MEM:
-	  if (GET_CODE (XEXP (x, 0)) == CONST_INT)
+	  if (CONST_INT_P (XEXP (x, 0)))
 	    output_address (gen_rtx_PLUS (SImode, gen_rtx_REG (SImode, 0),
 					  XEXP (x, 0)));
 	  else
@@ -717,7 +717,7 @@ print_operand_address (FILE * file, rtx 
       fprintf (file, "]");
       break;
     case LO_SUM:
-      if (GET_CODE (XEXP (addr, 0)) == REG)
+      if (REG_P (XEXP (addr, 0)))
 	{
 	  /* reg,foo */
 	  fprintf (file, "lo(");
@@ -728,7 +728,7 @@ print_operand_address (FILE * file, rtx 
 	}
       break;
     case PLUS:
-      if (GET_CODE (XEXP (addr, 0)) == REG
+      if (REG_P (XEXP (addr, 0))
 	  || GET_CODE (XEXP (addr, 0)) == SUBREG)
 	{
 	  /* reg,foo */
@@ -833,7 +833,7 @@ v850_output_addr_const_extra (FILE * fil
      (cf gcc.c-torture/compile/990801-1.c).  */
   if (GET_CODE (x) == MINUS
       && GET_CODE (XEXP (x, 0)) == LABEL_REF
-      && GET_CODE (XEXP (XEXP (x, 0), 0)) == CODE_LABEL
+      && LABEL_P (XEXP (XEXP (x, 0), 0))
       && INSN_DELETED_P (XEXP (XEXP (x, 0), 0)))
     return 1;
 
@@ -855,7 +855,7 @@ output_move_single (rtx * operands)
       if (REG_P (src))
 	return "mov %1,%0";
 
-      else if (GET_CODE (src) == CONST_INT)
+      else if (CONST_INT_P (src))
 	{
 	  HOST_WIDE_INT value = INTVAL (src);
 
@@ -898,7 +898,7 @@ output_move_single (rtx * operands)
 	    return "movhi hi(%F1),%.,%0\n\tmovea lo(%F1),%0,%0";
 	}
 
-      else if (GET_CODE (src) == MEM)
+      else if (MEM_P (src))
 	return "%S1ld%W1 %1,%0";
 
       else if (special_symbolref_operand (src, VOIDmode))
@@ -925,12 +925,12 @@ output_move_single (rtx * operands)
 	}
     }
 
-  else if (GET_CODE (dst) == MEM)
+  else if (MEM_P (dst))
     {
       if (REG_P (src))
 	return "%S0st%W0 %1,%0";
 
-      else if (GET_CODE (src) == CONST_INT && INTVAL (src) == 0)
+      else if (CONST_INT_P (src) && INTVAL (src) == 0)
 	return "%S0st%W0 %.,%0";
 
       else if (GET_CODE (src) == CONST_DOUBLE
@@ -1003,7 +1003,7 @@ ep_memory_operand (rtx op, enum machine_
   if (!TARGET_EP)
     return FALSE;
 
-  if (GET_CODE (op) != MEM)
+  if (!MEM_P (op))
     return FALSE;
 
   max_offset = ep_memory_offset (mode, unsigned_load);
@@ -1028,12 +1028,12 @@ ep_memory_operand (rtx op, enum machine_
     case PLUS:
       op0 = XEXP (addr, 0);
       op1 = XEXP (addr, 1);
-      if (GET_CODE (op1) == CONST_INT
+      if (CONST_INT_P (op1)
 	  && INTVAL (op1) < max_offset
 	  && INTVAL (op1) >= 0
 	  && (INTVAL (op1) & mask) == 0)
 	{
-	  if (GET_CODE (op0) == REG && REGNO (op0) == EP_REGNUM)
+	  if (REG_P (op0) && REGNO (op0) == EP_REGNUM)
 	    return TRUE;
 
 	  if (GET_CODE (op0) == SYMBOL_REF && SYMBOL_REF_TDA_P (op0))
@@ -1073,13 +1073,13 @@ Saved %d bytes (%d uses of register %s) 
 	     IDENTIFIER_POINTER (DECL_NAME (current_function_decl)),
 	     INSN_UID (first_insn), INSN_UID (last_insn));
 
-  if (GET_CODE (first_insn) == NOTE)
+  if (NOTE_P (first_insn))
     first_insn = next_nonnote_insn (first_insn);
 
   last_insn = next_nonnote_insn (last_insn);
   for (insn = first_insn; insn && insn != last_insn; insn = NEXT_INSN (insn))
     {
-      if (GET_CODE (insn) == INSN)
+      if (NONJUMP_INSN_P (insn))
 	{
 	  rtx pattern = single_set (insn);
 
@@ -1090,22 +1090,22 @@ Saved %d bytes (%d uses of register %s) 
 	      /* Memory operands are signed by default.  */
 	      int unsignedp = FALSE;
 
-	      if (GET_CODE (SET_DEST (pattern)) == MEM
-		  && GET_CODE (SET_SRC (pattern)) == MEM)
+	      if (MEM_P (SET_DEST (pattern))
+		  && MEM_P (SET_SRC (pattern)))
 		p_mem = (rtx *)0;
 
-	      else if (GET_CODE (SET_DEST (pattern)) == MEM)
+	      else if (MEM_P (SET_DEST (pattern)))
 		p_mem = &SET_DEST (pattern);
 
-	      else if (GET_CODE (SET_SRC (pattern)) == MEM)
+	      else if (MEM_P (SET_SRC (pattern)))
 		p_mem = &SET_SRC (pattern);
 
 	      else if (GET_CODE (SET_SRC (pattern)) == SIGN_EXTEND
-		       && GET_CODE (XEXP (SET_SRC (pattern), 0)) == MEM)
+		       && MEM_P (XEXP (SET_SRC (pattern), 0)))
 		p_mem = &XEXP (SET_SRC (pattern), 0);
 
 	      else if (GET_CODE (SET_SRC (pattern)) == ZERO_EXTEND
-		       && GET_CODE (XEXP (SET_SRC (pattern), 0)) == MEM)
+		       && MEM_P (XEXP (SET_SRC (pattern), 0)))
 		{
 		  p_mem = &XEXP (SET_SRC (pattern), 0);
 		  unsignedp = TRUE;
@@ -1117,13 +1117,13 @@ Saved %d bytes (%d uses of register %s) 
 		{
 		  rtx addr = XEXP (*p_mem, 0);
 
-		  if (GET_CODE (addr) == REG && REGNO (addr) == (unsigned) regno)
+		  if (REG_P (addr) && REGNO (addr) == (unsigned) regno)
 		    *p_mem = change_address (*p_mem, VOIDmode, *p_ep);
 
 		  else if (GET_CODE (addr) == PLUS
-			   && GET_CODE (XEXP (addr, 0)) == REG
+			   && REG_P (XEXP (addr, 0))
 			   && REGNO (XEXP (addr, 0)) == (unsigned) regno
-			   && GET_CODE (XEXP (addr, 1)) == CONST_INT
+			   && CONST_INT_P (XEXP (addr, 1))
 			   && ((INTVAL (XEXP (addr, 1)))
 			       < ep_memory_offset (GET_MODE (*p_mem),
 						   unsignedp))
@@ -1139,7 +1139,7 @@ Saved %d bytes (%d uses of register %s) 
 
   /* Optimize back to back cases of ep <- r1 & r1 <- ep.  */
   insn = prev_nonnote_insn (first_insn);
-  if (insn && GET_CODE (insn) == INSN
+  if (insn && NONJUMP_INSN_P (insn)
       && GET_CODE (PATTERN (insn)) == SET
       && SET_DEST (PATTERN (insn)) == *p_ep
       && SET_SRC (PATTERN (insn)) == *p_r1)
@@ -1238,29 +1238,29 @@ v850_reorg (void)
 	      /* We might have (SUBREG (MEM)) here, so just get rid of the
 		 subregs to make this code simpler.  */
 	      if (GET_CODE (dest) == SUBREG
-		  && (GET_CODE (SUBREG_REG (dest)) == MEM
-		      || GET_CODE (SUBREG_REG (dest)) == REG))
+		  && (MEM_P (SUBREG_REG (dest))
+		      || REG_P (SUBREG_REG (dest))))
 		alter_subreg (&dest);
 	      if (GET_CODE (src) == SUBREG
-		  && (GET_CODE (SUBREG_REG (src)) == MEM
-		      || GET_CODE (SUBREG_REG (src)) == REG))
+		  && (MEM_P (SUBREG_REG (src))
+		      || REG_P (SUBREG_REG (src))))
 		alter_subreg (&src);
 
-	      if (GET_CODE (dest) == MEM && GET_CODE (src) == MEM)
+	      if (MEM_P (dest) && MEM_P (src))
 		mem = NULL_RTX;
 
-	      else if (GET_CODE (dest) == MEM)
+	      else if (MEM_P (dest))
 		mem = dest;
 
-	      else if (GET_CODE (src) == MEM)
+	      else if (MEM_P (src))
 		mem = src;
 
 	      else if (GET_CODE (src) == SIGN_EXTEND
-		       && GET_CODE (XEXP (src, 0)) == MEM)
+		       && MEM_P (XEXP (src, 0)))
 		mem = XEXP (src, 0);
 
 	      else if (GET_CODE (src) == ZERO_EXTEND
-		       && GET_CODE (XEXP (src, 0)) == MEM)
+		       && MEM_P (XEXP (src, 0)))
 		{
 		  mem = XEXP (src, 0);
 		  unsignedp = TRUE;
@@ -1278,15 +1278,15 @@ v850_reorg (void)
 		  int regno = -1;
 		  int short_p;
 
-		  if (GET_CODE (addr) == REG)
+		  if (REG_P (addr))
 		    {
 		      short_p = TRUE;
 		      regno = REGNO (addr);
 		    }
 
 		  else if (GET_CODE (addr) == PLUS
-			   && GET_CODE (XEXP (addr, 0)) == REG
-			   && GET_CODE (XEXP (addr, 1)) == CONST_INT
+			   && REG_P (XEXP (addr, 0))
+			   && CONST_INT_P (XEXP (addr, 1))
 			   && ((INTVAL (XEXP (addr, 1)))
 			       < ep_memory_offset (GET_MODE (mem), unsignedp))
 			   && ((INTVAL (XEXP (addr, 1))) >= 0))
@@ -1309,7 +1309,7 @@ v850_reorg (void)
 
 	      /* Loading up a register in the basic block zaps any savings
 		 for the register */
-	      if (GET_CODE (dest) == REG)
+	      if (REG_P (dest))
 		{
 		  enum machine_mode mode = GET_MODE (dest);
 		  int regno;
@@ -2235,7 +2235,7 @@ construct_restore_jr (rtx op)
      registers.  */
   gcc_assert (GET_CODE (XVECEXP (op, 0, 1)) == SET);
   gcc_assert (GET_CODE (SET_SRC (XVECEXP (op, 0, 1))) == PLUS);
-  gcc_assert (GET_CODE (XEXP (SET_SRC (XVECEXP (op, 0, 1)), 1)) == CONST_INT);
+  gcc_assert (CONST_INT_P (XEXP (SET_SRC (XVECEXP (op, 0, 1)), 1)));
     
   stack_bytes = INTVAL (XEXP (SET_SRC (XVECEXP (op, 0, 1)), 1));
 
@@ -2256,7 +2256,7 @@ construct_restore_jr (rtx op)
       rtx vector_element = XVECEXP (op, 0, i);
       
       gcc_assert (GET_CODE (vector_element) == SET);
-      gcc_assert (GET_CODE (SET_DEST (vector_element)) == REG);
+      gcc_assert (REG_P (SET_DEST (vector_element)));
       gcc_assert (register_is_ok_for_epilogue (SET_DEST (vector_element),
 					       SImode));
       
@@ -2341,8 +2341,8 @@ construct_save_jarl (rtx op)
   /* Paranoia.  */
   gcc_assert (GET_CODE (XVECEXP (op, 0, 0)) == SET);
   gcc_assert (GET_CODE (SET_SRC (XVECEXP (op, 0, 0))) == PLUS);
-  gcc_assert (GET_CODE (XEXP (SET_SRC (XVECEXP (op, 0, 0)), 0)) == REG);
-  gcc_assert (GET_CODE (XEXP (SET_SRC (XVECEXP (op, 0, 0)), 1)) == CONST_INT);
+  gcc_assert (REG_P (XEXP (SET_SRC (XVECEXP (op, 0, 0)), 0)));
+  gcc_assert (CONST_INT_P (XEXP (SET_SRC (XVECEXP (op, 0, 0)), 1)));
     
   /* Work out how many bytes to push onto the stack after storing the
      registers.  */
@@ -2365,7 +2365,7 @@ construct_save_jarl (rtx op)
       rtx vector_element = XVECEXP (op, 0, i);
       
       gcc_assert (GET_CODE (vector_element) == SET);
-      gcc_assert (GET_CODE (SET_SRC (vector_element)) == REG);
+      gcc_assert (REG_P (SET_SRC (vector_element)));
       gcc_assert (register_is_ok_for_epilogue (SET_SRC (vector_element),
 					       SImode));
       
@@ -2641,7 +2641,7 @@ construct_dispose_instruction (rtx op)
      stack before retrieving registers.  */
   gcc_assert (GET_CODE (XVECEXP (op, 0, 1)) == SET);
   gcc_assert (GET_CODE (SET_SRC (XVECEXP (op, 0, 1))) == PLUS);
-  gcc_assert (GET_CODE (XEXP (SET_SRC (XVECEXP (op, 0, 1)), 1)) == CONST_INT);
+  gcc_assert (CONST_INT_P (XEXP (SET_SRC (XVECEXP (op, 0, 1)), 1)));
     
   stack_bytes = INTVAL (XEXP (SET_SRC (XVECEXP (op, 0, 1)), 1));
 
@@ -2664,7 +2664,7 @@ construct_dispose_instruction (rtx op)
       rtx vector_element = XVECEXP (op, 0, i);
       
       gcc_assert (GET_CODE (vector_element) == SET);
-      gcc_assert (GET_CODE (SET_DEST (vector_element)) == REG);
+      gcc_assert (REG_P (SET_DEST (vector_element)));
       gcc_assert (register_is_ok_for_epilogue (SET_DEST (vector_element),
 					       SImode));
 
@@ -2762,7 +2762,7 @@ construct_prepare_instruction (rtx op)
      the stack after storing the registers.  */
   gcc_assert (GET_CODE (XVECEXP (op, 0, 0)) == SET);
   gcc_assert (GET_CODE (SET_SRC (XVECEXP (op, 0, 0))) == PLUS);
-  gcc_assert (GET_CODE (XEXP (SET_SRC (XVECEXP (op, 0, 0)), 1)) == CONST_INT);
+  gcc_assert (CONST_INT_P (XEXP (SET_SRC (XVECEXP (op, 0, 0)), 1)));
     
   stack_bytes = INTVAL (XEXP (SET_SRC (XVECEXP (op, 0, 0)), 1));
 
@@ -2784,7 +2784,7 @@ construct_prepare_instruction (rtx op)
       rtx vector_element = XVECEXP (op, 0, i);
       
       gcc_assert (GET_CODE (vector_element) == SET);
-      gcc_assert (GET_CODE (SET_SRC (vector_element)) == REG);
+      gcc_assert (REG_P (SET_SRC (vector_element)));
       gcc_assert (register_is_ok_for_epilogue (SET_SRC (vector_element),
 					       SImode));
 
Index: v850.h
===================================================================
--- v850.h	(revision 148027)
+++ v850.h	(working copy)
@@ -704,7 +704,7 @@ struct cum_arg { int nbytes; int anonymo
    possibilities here, in particular, should accept ZDA_NAME SYMBOL_REFs.  */
 
 #define CONSTANT_ADDRESS_P(X)   \
-  (GET_CODE (X) == CONST_INT				\
+  (CONST_INT_P (X)				\
    && CONST_OK_FOR_K (INTVAL (X)))
 
 /* Maximum number of registers that can appear in a valid memory address.  */
@@ -805,7 +805,7 @@ do {									\
       && REG_P (XEXP (X, 0))						\
       && REG_OK_FOR_BASE_P (XEXP (X, 0))				\
       && CONSTANT_P (XEXP (X, 1))					\
-      && (GET_CODE (XEXP (X, 1)) != CONST_INT				\
+      && (!CONST_INT_P (XEXP (X, 1))				\
 	  || ((MODE == QImode || INTVAL (XEXP (X, 1)) % 2 == 0)		\
 	      && CONST_OK_FOR_K (INTVAL (XEXP (X, 1)))))		\
       && GET_MODE_SIZE (MODE) <= GET_MODE_SIZE (word_mode))		\
@@ -831,7 +831,7 @@ do {									\
    || !(GET_CODE (X) == CONST						\
 	&& GET_CODE (XEXP (X, 0)) == PLUS				\
 	&& GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF		\
-	&& GET_CODE (XEXP (XEXP (X, 0), 1)) == CONST_INT		\
+	&& CONST_INT_P (XEXP (XEXP (X, 0), 1))		\
 	&& ! CONST_OK_FOR_K (INTVAL (XEXP (XEXP (X, 0), 1)))))
 
 /* Tell final.c how to eliminate redundant test instructions.  */
Index: v850.md
===================================================================
--- v850.md	(revision 148027)
+++ v850.md	(working copy)
@@ -163,7 +163,7 @@ (define_expand "movsi"
       && GET_CODE (operands[1]) != HIGH
       && ! TARGET_V850E
       && !special_symbolref_operand (operands[1], VOIDmode)
-      && !(GET_CODE (operands[1]) == CONST_INT
+      && !(CONST_INT_P (operands[1])
 	   && (CONST_OK_FOR_J (INTVAL (operands[1]))
 	       || CONST_OK_FOR_K (INTVAL (operands[1]))
 	       || CONST_OK_FOR_L (INTVAL (operands[1])))))
@@ -335,7 +335,7 @@ (define_expand "mulhisi3"
 	  (sign_extend:SI (match_operand:HI 1 "register_operand" ""))
 	  (sign_extend:SI (match_operand:HI 2 "nonmemory_operand" ""))))]
   ""
-  "if (GET_CODE (operands[2]) == CONST_INT)
+  "if (CONST_INT_P (operands[2]))
      {
        emit_insn (gen_mulhisi3_internal2 (operands[0], operands[1], operands[2]));
        DONE;
@@ -741,8 +741,8 @@ (define_expand "movsicc"
   "TARGET_V850E"
   "
 {
-  if (   (GET_CODE (operands[2]) == CONST_INT
-       && GET_CODE (operands[3]) == CONST_INT))
+  if (   (CONST_INT_P (operands[2])
+       && CONST_INT_P (operands[3])))
     {
       int o2 = INTVAL (operands[2]);
       int o3 = INTVAL (operands[3]);
@@ -762,9 +762,9 @@ (define_expand "movsicc"
     }
   else
     {
-      if (GET_CODE (operands[2]) != REG)
+      if (!REG_P (operands[2]))
 	operands[2] = copy_to_mode_reg (SImode,operands[2]);
-      if (GET_CODE (operands[3]) != REG)
+      if (!REG_P (operands[3]))
 	operands[3] = copy_to_mode_reg (SImode, operands[3]);
     }
 }")
@@ -870,7 +870,7 @@ (define_split
   "TARGET_V850E
    && ((INTVAL (operands[2]) ^ INTVAL (operands[3])) == 1)
    && ((INTVAL (operands[2]) + INTVAL (operands[3])) != 1)
-   && (GET_CODE (operands[5]) == CONST_INT
+   && (CONST_INT_P (operands[5])
       || REGNO (operands[0]) != REGNO (operands[5]))
    && REGNO (operands[0]) != REGNO (operands[4])"
   [(set (match_dup 0) (match_dup 6))
@@ -1125,7 +1125,7 @@ (define_insn "call_internal_long"
   {
   if (which_alternative == 0)
     {
-      if (GET_CODE (operands[0]) == REG)
+      if (REG_P (operands[0]))
         return \"jarl %0,r31\";
       else
         return \"movhi hi(%0), r0, r11 ; movea lo(%0), r11, r11 ; jarl .+4,r31 ; add 4, r31 ; jmp r11\";
@@ -1182,7 +1182,7 @@ (define_insn "call_value_internal_long"
   {
   if (which_alternative == 0)
     {
-      if (GET_CODE (operands[1]) == REG)
+      if (REG_P (operands[1]))
         return \"jarl %1, r31\";
       else
       /* Reload can generate this pattern....  */

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