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 7/8] Remove 'I'-'P' and 'G'/'H' cases


After the previous patch, we can remove the separate 'I'-'P' and 'G'/'H'
cases without increasing compile time.  I didn't bother adding the kind of
fast-path for 'G'/'H' that I did for 'I'-'P' since it should be much rarer.

This removes the last use of CONST_DOUBLE_OK_FOR_CONSTRAINT_P, so I deleted
the code that defines it and added it to the poison list.  The only remaining
old-style macro is CONST_INT_OK_FOR_CONSTRAINT_P, which is used by the s390
backend.  If this series is OK I'll follow up with a patch to remove that
usage and poison CONST_INT_OK_FOR_CONSTRAINT_P too.

Richard


gcc/
	* system.h (CONST_DOUBLE_OK_FOR_CONSTRAINT_P): Poison.
	* genpreds.c (have_const_dbl_constraints): Delete.
	(add_constraint): Don't set it.
	(write_tm_preds_h): Don't call CONST_DOUBLE_OK_FOR_CONSTRAINT_P.
	* ira-costs.c (record_reg_classes): Handle CONST_INT and CONST_DOUBLE
	constraints using the lookup_constraint logic.
	* ira-lives.c (single_reg_class): Likewise.
	* ira.c (ira_setup_alts): Likewise.
	* lra-constraints.c (process_alt_operands): Likewise.
	* recog.c (asm_operand_ok, constrain_operands): Likewise.
	* reload.c (find_reloads): Likewise.

Index: gcc/system.h
===================================================================
--- gcc/system.h	2014-06-05 22:05:00.271579419 +0100
+++ gcc/system.h	2014-06-05 22:07:23.048734932 +0100
@@ -933,7 +933,7 @@ #define realloc xrealloc
 	CONST_DOUBLE_OK_FOR_LETTER_P EXTRA_CONSTRAINT			   \
 	REG_CLASS_FROM_CONSTRAINT REG_CLASS_FOR_CONSTRAINT		   \
 	EXTRA_CONSTRAINT_STR EXTRA_MEMORY_CONSTRAINT			   \
-	EXTRA_ADDRESS_CONSTRAINT
+	EXTRA_ADDRESS_CONSTRAINT CONST_DOUBLE_OK_FOR_CONSTRAINT_P
 
 /* Hooks that are no longer used.  */
  #pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE	\
Index: gcc/genpreds.c
===================================================================
--- gcc/genpreds.c	2014-06-05 22:05:01.980593126 +0100
+++ gcc/genpreds.c	2014-06-05 22:32:31.329547134 +0100
@@ -684,7 +684,6 @@ static const char const_dbl_constraints[
 static bool have_address_constraints;
 static bool have_extra_constraints;
 static bool have_const_int_constraints;
-static bool have_const_dbl_constraints;
 static unsigned int num_constraints;
 
 static const constraint_data **enum_order;
@@ -888,7 +887,6 @@ add_constraint (const char *name, const
   constraint_max_namelen = MAX (constraint_max_namelen, strlen (name));
   have_register_constraints |= c->is_register;
   have_const_int_constraints |= c->is_const_int;
-  have_const_dbl_constraints |= c->is_const_dbl;
   have_extra_constraints |= c->is_extra;
   have_memory_constraints |= c->is_memory;
   have_address_constraints |= c->is_address;
@@ -1375,11 +1373,6 @@ #define GCC_TM_PREDS_H\n\
 	      "{\n"
 	      "  return false;\n"
 	      "}\n");
-      if (have_const_dbl_constraints)
-	puts ("#define CONST_DOUBLE_OK_FOR_CONSTRAINT_P(v_,c_,s_) \\\n"
-	      "    constraint_satisfied_p (v_, lookup_constraint (s_))\n");
-      else
-	puts ("#define CONST_DOUBLE_OK_FOR_CONSTRAINT_P(v_,c_,s_) 0\n");
 
       puts ("enum constraint_type\n"
 	    "{\n"
Index: gcc/ira-costs.c
===================================================================
--- gcc/ira-costs.c	2014-06-05 22:05:01.981593134 +0100
+++ gcc/ira-costs.c	2014-06-05 22:32:31.329547134 +0100
@@ -703,13 +703,6 @@ record_reg_classes (int n_alts, int n_op
 		    win = 1;
 		  break;
 
-		case 'G':
-		case 'H':
-		  if (CONST_DOUBLE_AS_FLOAT_P (op) 
-		      && CONST_DOUBLE_OK_FOR_CONSTRAINT_P (op, c, p))
-		    win = 1;
-		  break;
-
 		case 's':
 		  if (CONST_SCALAR_INT_P (op)) 
 		    break;
@@ -725,19 +718,6 @@ record_reg_classes (int n_alts, int n_op
 		    win = 1;
 		  break;
 
-		case 'I':
-		case 'J':
-		case 'K':
-		case 'L':
-		case 'M':
-		case 'N':
-		case 'O':
-		case 'P':
-		  if (CONST_INT_P (op)
-		      && CONST_OK_FOR_CONSTRAINT_P (INTVAL (op), c, p))
-		    win = 1;
-		  break;
-
 		case 'X':
 		  win = 1;
 		  break;
Index: gcc/ira-lives.c
===================================================================
--- gcc/ira-lives.c	2014-06-05 22:05:00.264579363 +0100
+++ gcc/ira-lives.c	2014-06-05 22:32:31.329547134 +0100
@@ -801,23 +801,6 @@ single_reg_class (const char *constraint
 	    return NO_REGS;
 	  break;
 
-	case 'I':
-	case 'J':
-	case 'K':
-	case 'L':
-	case 'M':
-	case 'N':
-	case 'O':
-	case 'P':
-	  if ((CONST_INT_P (op)
-	       && CONST_OK_FOR_CONSTRAINT_P (INTVAL (op), c, constraints))
-	      || (equiv_const != NULL_RTX
-		  && CONST_INT_P (equiv_const)
-		  && CONST_OK_FOR_CONSTRAINT_P (INTVAL (equiv_const),
-						c, constraints)))
-	    return NO_REGS;
-	  break;
-
 	case 'E':
 	case 'F':
 	  if (CONST_DOUBLE_AS_FLOAT_P (op) 
@@ -831,17 +814,9 @@ single_reg_class (const char *constraint
 	    return NO_REGS;
 	  break;
 
-	case 'G':
-	case 'H':
-	  if ((CONST_DOUBLE_AS_FLOAT_P (op) 
-	       && CONST_DOUBLE_OK_FOR_CONSTRAINT_P (op, c, constraints))
-	      || (equiv_const != NULL_RTX
-		  && CONST_DOUBLE_AS_FLOAT_P (equiv_const) 
-		  && CONST_DOUBLE_OK_FOR_CONSTRAINT_P (equiv_const,
-						       c, constraints)))
-	    return NO_REGS;
-	  break;
-
+	case 'I': case 'J': case 'K': case 'L': case 'M': case 'N':
+	case 'O': case 'P':
+	case 'G': case 'H':
 	case 'r':
 	case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
 	case 'h': case 'j': case 'k': case 'l':
Index: gcc/ira.c
===================================================================
--- gcc/ira.c	2014-06-05 22:05:01.983593150 +0100
+++ gcc/ira.c	2014-06-05 22:32:31.329547134 +0100
@@ -1883,13 +1883,6 @@ ira_setup_alts (rtx insn, HARD_REG_SET &
 		      goto op_success;
 		    break;
 		    
-		  case 'G':
-		  case 'H':
-		    if (CONST_DOUBLE_AS_FLOAT_P (op)
-			&& CONST_DOUBLE_OK_FOR_CONSTRAINT_P (op, c, p))
-		      goto op_success;
-		    break;
-		    
 		  case 's':
 		    if (CONST_SCALAR_INT_P (op))
 		      break;
@@ -1903,19 +1896,6 @@ ira_setup_alts (rtx insn, HARD_REG_SET &
 		      goto op_success;
 		    break;
 		    
-		  case 'I':
-		  case 'J':
-		  case 'K':
-		  case 'L':
-		  case 'M':
-		  case 'N':
-		  case 'O':
-		  case 'P':
-		    if (CONST_INT_P (op)
-			&& CONST_OK_FOR_CONSTRAINT_P (INTVAL (op), c, p))
-		      goto op_success;
-		    break;
-		    
 		  case 'V':
 		    if (MEM_P (op) && ! offsettable_memref_p (op))
 		      goto op_success;
Index: gcc/lra-constraints.c
===================================================================
--- gcc/lra-constraints.c	2014-06-05 22:05:01.985593166 +0100
+++ gcc/lra-constraints.c	2014-06-05 22:32:31.329547134 +0100
@@ -1980,13 +1980,6 @@ process_alt_operands (int only_alternati
 		    win = true;
 		  break;
 
-		case 'G':
-		case 'H':
-		  if (CONST_DOUBLE_AS_FLOAT_P (op)
-		      && CONST_DOUBLE_OK_FOR_CONSTRAINT_P (op, c, p))
-		    win = true;
-		  break;
-
 		case 's':
 		  if (CONST_SCALAR_INT_P (op))
 		    break;
@@ -2001,19 +1994,6 @@ process_alt_operands (int only_alternati
 		    win = true;
 		  break;
 
-		case 'I':
-		case 'J':
-		case 'K':
-		case 'L':
-		case 'M':
-		case 'N':
-		case 'O':
-		case 'P':
-		  if (CONST_INT_P (op)
-		      && CONST_OK_FOR_CONSTRAINT_P (INTVAL (op), c, p))
-		    win = true;
-		  break;
-
 		case 'X':
 		  /* This constraint should be excluded by the fast
 		     track.  */
Index: gcc/recog.c
===================================================================
--- gcc/recog.c	2014-06-05 22:05:01.986593174 +0100
+++ gcc/recog.c	2014-06-05 22:32:31.329547134 +0100
@@ -1827,17 +1827,6 @@ asm_operand_ok (rtx op, const char *cons
 	    result = 1;
 	  break;
 
-	case 'G':
-	  if (CONST_DOUBLE_AS_FLOAT_P (op)
-	      && CONST_DOUBLE_OK_FOR_CONSTRAINT_P (op, 'G', constraint))
-	    result = 1;
-	  break;
-	case 'H':
-	  if (CONST_DOUBLE_AS_FLOAT_P (op)
-	      && CONST_DOUBLE_OK_FOR_CONSTRAINT_P (op, 'H', constraint))
-	    result = 1;
-	  break;
-
 	case 's':
 	  if (CONST_SCALAR_INT_P (op))
 	    break;
@@ -1853,47 +1842,6 @@ asm_operand_ok (rtx op, const char *cons
 	    result = 1;
 	  break;
 
-	case 'I':
-	  if (CONST_INT_P (op)
-	      && CONST_OK_FOR_CONSTRAINT_P (INTVAL (op), 'I', constraint))
-	    result = 1;
-	  break;
-	case 'J':
-	  if (CONST_INT_P (op)
-	      && CONST_OK_FOR_CONSTRAINT_P (INTVAL (op), 'J', constraint))
-	    result = 1;
-	  break;
-	case 'K':
-	  if (CONST_INT_P (op)
-	      && CONST_OK_FOR_CONSTRAINT_P (INTVAL (op), 'K', constraint))
-	    result = 1;
-	  break;
-	case 'L':
-	  if (CONST_INT_P (op)
-	      && CONST_OK_FOR_CONSTRAINT_P (INTVAL (op), 'L', constraint))
-	    result = 1;
-	  break;
-	case 'M':
-	  if (CONST_INT_P (op)
-	      && CONST_OK_FOR_CONSTRAINT_P (INTVAL (op), 'M', constraint))
-	    result = 1;
-	  break;
-	case 'N':
-	  if (CONST_INT_P (op)
-	      && CONST_OK_FOR_CONSTRAINT_P (INTVAL (op), 'N', constraint))
-	    result = 1;
-	  break;
-	case 'O':
-	  if (CONST_INT_P (op)
-	      && CONST_OK_FOR_CONSTRAINT_P (INTVAL (op), 'O', constraint))
-	    result = 1;
-	  break;
-	case 'P':
-	  if (CONST_INT_P (op)
-	      && CONST_OK_FOR_CONSTRAINT_P (INTVAL (op), 'P', constraint))
-	    result = 1;
-	  break;
-
 	case 'X':
 	  result = 1;
 	  break;
@@ -2802,13 +2750,6 @@ constrain_operands (int strict)
 		  win = 1;
 		break;
 
-	      case 'G':
-	      case 'H':
-		if (CONST_DOUBLE_AS_FLOAT_P (op)
-		    && CONST_DOUBLE_OK_FOR_CONSTRAINT_P (op, c, p))
-		  win = 1;
-		break;
-
 	      case 's':
 		if (CONST_SCALAR_INT_P (op))
 		  break;
@@ -2822,19 +2763,6 @@ constrain_operands (int strict)
 		  win = 1;
 		break;
 
-	      case 'I':
-	      case 'J':
-	      case 'K':
-	      case 'L':
-	      case 'M':
-	      case 'N':
-	      case 'O':
-	      case 'P':
-		if (CONST_INT_P (op)
-		    && CONST_OK_FOR_CONSTRAINT_P (INTVAL (op), c, p))
-		  win = 1;
-		break;
-
 	      case 'V':
 		if (MEM_P (op)
 		    && ((strict > 0 && ! offsettable_memref_p (op))
Index: gcc/reload.c
===================================================================
--- gcc/reload.c	2014-06-05 22:07:49.950954766 +0100
+++ gcc/reload.c	2014-06-05 22:40:14.946489460 +0100
@@ -3434,13 +3434,6 @@ find_reloads (rtx insn, int replace, int
 		      win = 1;
 		    break;
 
-		  case 'G':
-		  case 'H':
-		    if (CONST_DOUBLE_AS_FLOAT_P (operand)
-			&& CONST_DOUBLE_OK_FOR_CONSTRAINT_P (operand, c, p))
-		      win = 1;
-		    break;
-
 		  case 's':
 		    if (CONST_SCALAR_INT_P (operand))
 		      break;
@@ -3455,19 +3448,6 @@ find_reloads (rtx insn, int replace, int
 		      win = 1;
 		    break;
 
-		  case 'I':
-		  case 'J':
-		  case 'K':
-		  case 'L':
-		  case 'M':
-		  case 'N':
-		  case 'O':
-		  case 'P':
-		    if (CONST_INT_P (operand)
-			&& CONST_OK_FOR_CONSTRAINT_P (INTVAL (operand), c, p))
-		      win = 1;
-		    break;
-
 		  case 'X':
 		    force_reload = 0;
 		    win = 1;


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