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] h8300: Remove EIGHTBIT_CONSTANT_ADDRESS_P andTINY_CONSTANT_ADDRESS_P.


Hi,

Attached is a patch to remove EIGHTBIT_CONSTANT_ADDRESS_P and
TINY_CONSTANT_ADDRESS_P since they recently became mere wrappers for
h8300_eightbit_constant_address_p() and
h8300_tiny_constant_address_p().

Tested on h8300 port.  Committed.

Kazu Hirata

2002-11-21  Kazu Hirata  <kazu@cs.umass.edu>

	* config/h8300/h8300.c (print_operand): Use
	h8300_eightbit_constant_address_p and
	h8300_tiny_constant_address_p.
	(h8300_adjust_insn_length): Likewise.
	* config/h8300/h8300.h (EIGHTBIT_CONSTANT_ADDRESS_P): Remove.
	(TINY_CONSTANT_ADDRESS_P): Likewise.
	(OK_FOR_U): Use eightbit_constant_address_p.

Index: h8300.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/h8300/h8300.c,v
retrieving revision 1.159
diff -u -r1.159 h8300.c
--- h8300.c	20 Nov 2002 05:04:31 -0000	1.159
+++ h8300.c	20 Nov 2002 13:46:17 -0000
@@ -1440,10 +1440,9 @@
 	case MEM:
 	  {
 	    rtx addr = XEXP (x, 0);
-	    int eightbit_ok = EIGHTBIT_CONSTANT_ADDRESS_P (addr);
 	    int tiny_ok = ((GET_CODE (addr) == SYMBOL_REF
 			    && TINY_DATA_NAME_P (XSTR (addr, 0)))
-			   || TINY_CONSTANT_ADDRESS_P (addr));
+			   || h8300_tiny_constant_address_p (addr));
 
 	    fprintf (file, "@");
 	    output_address (addr);
@@ -1454,7 +1453,7 @@
 	      {
 	      case 'R':
 		/* Used for mov.b and bit operations.  */
-		if (eightbit_ok)
+		if (h8300_eightbit_constant_address_p (addr))
 		  {
 		    fprintf (file, ":8");
 		    break;
@@ -3729,7 +3728,7 @@
 
 	  /* @aa:8 is 2 bytes shorter than the longest.  */
 	  if (GET_MODE (SET_SRC (pat)) == QImode
-	      && EIGHTBIT_CONSTANT_ADDRESS_P (addr))
+	      && h8300_eightbit_constant_address_p (addr))
 	    return -2;
 	}
       else
@@ -3752,14 +3751,13 @@
 
 	  /* @aa:8 is 6 bytes shorter than the longest.  */
 	  if (GET_MODE (SET_SRC (pat)) == QImode
-	      && ((GET_CODE (addr) == SYMBOL_REF && SYMBOL_REF_FLAG (addr))
-		  || EIGHTBIT_CONSTANT_ADDRESS_P (addr)))
+	      && h8300_eightbit_constant_address_p (addr))
 	    return -6;
 
 	  /* @aa:16 is 4 bytes shorter than the longest.  */
 	  if ((GET_CODE (addr) == SYMBOL_REF
 	       && TINY_DATA_NAME_P (XSTR (addr, 0)))
-	      || TINY_CONSTANT_ADDRESS_P (addr))
+	      || h8300_tiny_constant_address_p (addr))
 	    return -4;
 
 	  /* @aa:24 is 2 bytes shorter than the longest.  */
@@ -3868,6 +3866,9 @@
 }
 #endif /* ! OBJECT_FORMAT_ELF */
 
+/* Nonzero if X is a constant address suitable as an 8-bit absolute,
+   which is a special case of the 'R' operand.  */
+
 int
 h8300_eightbit_constant_address_p (x)
      rtx x;
@@ -3896,6 +3897,9 @@
 	  || (TARGET_H8300H && IN_RANGE (addr, h1, h2))
 	  || (TARGET_H8300S && IN_RANGE (addr, s1, s2)));
 }
+
+/* Nonzero if X is a constant address suitable as an 16-bit absolute
+   on H8/300H and H8S.  */
 
 int
 h8300_tiny_constant_address_p (x)
Index: h8300.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/h8300/h8300.h,v
retrieving revision 1.116
diff -u -r1.116 h8300.h
--- h8300.h	20 Nov 2002 04:54:39 -0000	1.116
+++ h8300.h	20 Nov 2002 13:46:18 -0000
@@ -858,18 +858,6 @@
    ? !h8300_shift_needs_scratch_p (INTVAL (OP), SImode)	\
    : 0)
 
-/* Nonzero if X is a constant address suitable as an 8-bit absolute,
-   which is a special case of the 'R' operand.  */
-
-#define EIGHTBIT_CONSTANT_ADDRESS_P(X)		\
-  h8300_eightbit_constant_address_p (X)
-
-/* Nonzero if X is a constant address suitable as an 16-bit absolute
-   on H8/300H and H8S.  */
-
-#define TINY_CONSTANT_ADDRESS_P(X)		\
-  h8300_tiny_constant_address_p (X)
-
 /* 'U' if valid for a bset destination;
    i.e. a register, register indirect, or the eightbit memory region
    (a SYMBOL_REF with an SYMBOL_REF_FLAG set).
@@ -888,7 +876,7 @@
         && (TARGET_H8300S						\
 	    || SYMBOL_REF_FLAG (XEXP (XEXP (XEXP (OP, 0), 0), 0))))	\
    || (GET_CODE (OP) == MEM						\
-       && EIGHTBIT_CONSTANT_ADDRESS_P (XEXP (OP, 0)))			\
+       && h8300_eightbit_constant_address_p (XEXP (OP, 0)))		\
    || (GET_CODE (OP) == MEM && TARGET_H8300S				\
        && GET_CODE (XEXP (OP, 0)) == CONST_INT))
 


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