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.h: Clean up REG_OK_{INDEX,BASE}_P.


Hi,

Attached is a patch to clean up REG_OK_{INDEX,BASE}_P by defining and
using REG_OK_{INDEX,BASE}_{NONSTRICT,STRICT}_P.  There is no
functional change.

Built h8300-hms.  Committed as obvious.

Kazu Hirata

2004-01-24  Kazu Hirata  <kazu@cs.umass.edu>

	* config/h8300/h8300.h (REG_OK_FOR_INDEX_NONSTRICT_P): New.
	(REG_OK_FOR_BASE_NONSTRICT_P): Likewise.
	(REG_OK_FOR_INDEX_STRICT_P): Likewise.
	(REG_OK_FOR_BASE_STRICT_P): Likewise.
	(REG_OK_FOR_INDEX_STRICT_P): Use REGNO_OK_FOR_INDEX_P.
	(REG_OK_FOR_BASE_STRICT_P): Use REGNO_OK_FOR_BASE_P.
	(REG_OK_FOR_INDEX_P): Use REG_OK_FOR_INDEX_STRICT_P.
	(REG_OK_FOR_BASE_P): Use REG_OK_FOR_BASE_STRICT_P.

Index: h8300.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/h8300/h8300.h,v
retrieving revision 1.165
diff -c -r1.165 h8300.h
*** h8300.h	22 Jan 2004 21:21:13 -0000	1.165
--- h8300.h	22 Jan 2004 21:35:54 -0000
***************
*** 811,833 ****
     After reload, it makes no difference, since pseudo regs have
     been eliminated by then.  */
  
  #ifndef REG_OK_STRICT
  
! /* Nonzero if X is a hard reg that can be used as an index
!    or if it is a pseudo reg.  */
! #define REG_OK_FOR_INDEX_P(X) 0
! /* Nonzero if X is a hard reg that can be used as a base reg
!    or if it is a pseudo reg.  */
! /* Don't use REGNO_OK_FOR_BASE_P here because it uses reg_renumber.  */
! #define REG_OK_FOR_BASE_P(X) \
! 	(REGNO (X) >= FIRST_PSEUDO_REGISTER || REGNO (X) != 8)
  
  #else
  
! /* Nonzero if X is a hard reg that can be used as an index.  */
! #define REG_OK_FOR_INDEX_P(X) REGNO_OK_FOR_INDEX_P (REGNO (X))
! /* Nonzero if X is a hard reg that can be used as a base reg.  */
! #define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
  
  #endif
  
--- 811,835 ----
     After reload, it makes no difference, since pseudo regs have
     been eliminated by then.  */
  
+ /* Non-strict versions.  */
+ #define REG_OK_FOR_INDEX_NONSTRICT_P(X) 0
+ /* Don't use REGNO_OK_FOR_BASE_P here because it uses reg_renumber.  */
+ #define REG_OK_FOR_BASE_NONSTRICT_P(X)				\
+   (REGNO (X) >= FIRST_PSEUDO_REGISTER || REGNO (X) != 8)
+ 
+ /* Strict versions.  */
+ #define REG_OK_FOR_INDEX_STRICT_P(X) REGNO_OK_FOR_INDEX_P (REGNO (X))
+ #define REG_OK_FOR_BASE_STRICT_P(X)  REGNO_OK_FOR_BASE_P (REGNO (X))
+ 
  #ifndef REG_OK_STRICT
  
! #define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_INDEX_NONSTRICT_P (X)
! #define REG_OK_FOR_BASE_P(X)  REG_OK_FOR_BASE_NONSTRICT_P (X)
  
  #else
  
! #define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_INDEX_STRICT_P (X)
! #define REG_OK_FOR_BASE_P(X)  REG_OK_FOR_BASE_STRICT_P (X)
  
  #endif
  


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