[PATCH] [mep] delete unused constraint-related macros and functions

2012-08-02 Thread Nathan Froyd
mep uses {constraints,predicates}.md and #if 0'd out the old macro versions.
In the interest of not keeping dead code around, I'd like to delete these.
I think this falls under the obvious rule, so I'll commit this in a couple of
days after waiting to hear from DJ.

Tested by building mep-elf.

-Nathan

* config/mep/mep.h (REG_CLASS_FROM_CONSTRAINT): Delete.
(CONST_OK_FOR_LETTER_P, CONST_DOUBLE_OK_FOR_LETTER_P): Delete.
(CONSTRAINT_LEN, EXTRA_CONSTRAINT): Delete.
* config/mep/mep.c (mep_reg_class_from_constraint): Delete.
(mep_const_ok_for_letter_p, mep_extra_constraint): Delete.
* config/mep/mep-protos.h (mep_reg_class_from_constraint): Delete.
(mep_const_ok_for_letter_p, mep_extra_constraint): Delete.
---
 gcc/ChangeLog   |   10 
 gcc/config/mep/mep-protos.h |3 -
 gcc/config/mep/mep.c|  126 ---
 gcc/config/mep/mep.h|   15 -
 4 files changed, 10 insertions(+), 144 deletions(-)

diff --git a/gcc/config/mep/mep-protos.h b/gcc/config/mep/mep-protos.h
index edfbaf7..f0f3496 100644
--- a/gcc/config/mep/mep-protos.h
+++ b/gcc/config/mep/mep-protos.h
@@ -20,9 +20,6 @@ along with GCC; see the file COPYING3.  If not see
 http://www.gnu.org/licenses/.  */
 
 extern int mep_regno_reg_class (int);
-extern int mep_reg_class_from_constraint (int, const char *);
-extern bool mep_const_ok_for_letter_p (HOST_WIDE_INT, int);
-extern bool mep_extra_constraint (rtx, int);
 extern rtx mep_mulr_source (rtx, rtx, rtx, rtx);
 extern bool mep_reuse_lo_p (rtx, rtx, rtx, bool);
 extern bool mep_use_post_modify_p (rtx, rtx, rtx);
diff --git a/gcc/config/mep/mep.c b/gcc/config/mep/mep.c
index bba0327..5089e03 100644
--- a/gcc/config/mep/mep.c
+++ b/gcc/config/mep/mep.c
@@ -596,132 +596,6 @@ mep_regno_reg_class (int regno)
   return NO_REGS;
 }
 
-#if 0
-int
-mep_reg_class_from_constraint (int c, const char *str)
-{
-  switch (c)
-{
-case 'a':
-  return SP_REGS;
-case 'b':
-  return TP_REGS;
-case 'c':
-  return CONTROL_REGS;
-case 'd':
-  return HILO_REGS;
-case 'e':
-  {
-   switch (str[1])
- {
- case 'm':
-   return LOADABLE_CR_REGS;
- case 'x':
-   return mep_have_copro_copro_moves_p ? CR_REGS : NO_REGS;
- case 'r':
-   return mep_have_core_copro_moves_p ? CR_REGS : NO_REGS;
- default:
-   return NO_REGS;
- }
-  }
-case 'h':
-  return HI_REGS;
-case 'j':
-  return RPC_REGS;
-case 'l':
-  return LO_REGS;
-case 't':
-  return TPREL_REGS;
-case 'v':
-  return GP_REGS;
-case 'x':
-  return CR_REGS;
-case 'y':
-  return CCR_REGS;
-case 'z':
-  return R0_REGS;
-
-case 'A':
-case 'B':
-case 'C':
-case 'D':
-  {
-   enum reg_class which = c - 'A' + USER0_REGS;
-   return (reg_class_size[which]  0 ? which : NO_REGS);
-  }
-
-default:
-  return NO_REGS;
-}
-}
-
-bool
-mep_const_ok_for_letter_p (HOST_WIDE_INT value, int c)
-{
-  switch (c)
-{
-  case 'I': return value = -32768  value   32768;
-  case 'J': return value =  0  value   65536;
-  case 'K': return value =  0  value  0x0100;
-  case 'L': return value =-32  value  32;
-  case 'M': return value =  0  value  32;
-  case 'N': return value =  0  value  16;
-  case 'O':
-   if (value  0x)
- return false;
-   return value = -2147483647-1  value = 2147483647;
-default:
-  gcc_unreachable ();
-}
-}
-
-bool
-mep_extra_constraint (rtx value, int c)
-{
-  encode_pattern (value);
-
-  switch (c)
-{
-case 'R':
-  /* For near symbols, like what call uses.  */
-  if (GET_CODE (value) == REG)
-   return 0;
-  return mep_call_address_operand (value, GET_MODE (value));
-
-case 'S':
-  /* For signed 8-bit immediates.  */
-  return (GET_CODE (value) == CONST_INT
-  INTVAL (value) = -128
-  INTVAL (value) = 127);
-
-case 'T':
-  /* For tp/gp relative symbol values.  */
-  return (RTX_IS (u3s) || RTX_IS (u2s)
-  || RTX_IS (+u3si) || RTX_IS (+u2si));
-
-case 'U':
-  /* Non-absolute memories.  */
-  return GET_CODE (value) == MEM  ! CONSTANT_P (XEXP (value, 0));
-
-case 'W':
-  /* %hi(sym) */
-  return RTX_IS (Hs);
-
-case 'Y':
-  /* Register indirect.  */
-  return RTX_IS (mr);
-
-case 'Z':
-  return mep_section_tag (value) == 'c'  RTX_IS (ms);
-}
-
-  return false;
-}
-#endif
-
-#undef PASS
-#undef FAIL
-
 static bool
 const_in_range (rtx x, int minv, int maxv)
 {
diff --git a/gcc/config/mep/mep.h b/gcc/config/mep/mep.h
index 920120c..9a382e6 100644
--- a/gcc/config/mep/mep.h
+++ b/gcc/config/mep/mep.h
@@ -408,11 +408,6 @@ enum reg_class
 #define BASE_REG_CLASS GENERAL_REGS
 #define 

Re: [PATCH] [mep] delete unused constraint-related macros and functions

2012-08-02 Thread DJ Delorie

That's fine with me.