Autoincrement examples
Michael Hayes
m.hayes@elec.canterbury.ac.nz
Fri Dec 10 13:36:00 GMT 1999
Joern Rennecke writes:
> It appears your patch is not intended for existing ports. Or is there
> another patch for defaults.h ?
Here are my diffs for rtl.h again. In an earlier post on this thread
I sent this with other patches to support post_modify addressing modes
throughout the compiler.
Michael.
Index: rtl.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/rtl.h,v
retrieving revision 1.158
diff -c -3 -p -r1.158 rtl.h
*** rtl.h 1999/12/04 03:00:03 1.158
--- rtl.h 1999/12/10 21:32:14
*************** extern const char * const note_insn_name
*** 763,803 ****
/* 1 means a SYMBOL_REF has been the library function in emit_library_call. */
#define SYMBOL_REF_USED(RTX) ((RTX)->used)
/* Define a macro to look for REG_INC notes,
but save time on machines where they never exist. */
! /* Don't continue this line--convex cc version 4.1 would lose. */
! #if (defined (HAVE_PRE_INCREMENT) || defined (HAVE_PRE_DECREMENT) || defined (HAVE_POST_INCREMENT) || defined (HAVE_POST_DECREMENT))
! #define FIND_REG_INC_NOTE(insn, reg) (find_reg_note ((insn), REG_INC, (reg)))
! #else
! #define FIND_REG_INC_NOTE(insn, reg) 0
#endif
/* Indicate whether the machine has any sort of auto increment addressing.
If not, we can avoid checking for REG_INC notes. */
/* Don't continue this line--convex cc version 4.1 would lose. */
! #if (defined (HAVE_PRE_INCREMENT) || defined (HAVE_PRE_DECREMENT) || defined (HAVE_POST_INCREMENT) || defined (HAVE_POST_DECREMENT))
#define AUTO_INC_DEC
#endif
#ifndef HAVE_PRE_INCREMENT
! #define HAVE_PRE_INCREMENT 0
#endif
#ifndef HAVE_PRE_DECREMENT
! #define HAVE_PRE_DECREMENT 0
#endif
#ifndef HAVE_POST_INCREMENT
! #define HAVE_POST_INCREMENT 0
#endif
#ifndef HAVE_POST_DECREMENT
! #define HAVE_POST_DECREMENT 0
#endif
/* Some architectures do not have complete pre/post increment/decrement
instruction sets, or only move some modes efficiently. These macros
allow us to tune autoincrement generation. */
--- 763,833 ----
/* 1 means a SYMBOL_REF has been the library function in emit_library_call. */
#define SYMBOL_REF_USED(RTX) ((RTX)->used)
+ #if (defined (HAVE_PRE_MODIFY_DISP) || defined (HAVE_PRE_MODIFY_REG) || defined (HAVE_POST_MODIFY_DISP) || defined (HAVE_POST_MODIFY_REG))
+ #define HAVE_AUTO_MODIFY
+ #endif
+
+ #if (defined (HAVE_PRE_INCREMENT) || defined (HAVE_POST_INCREMENT))
+ #define HAVE_AUTO_INC
+ #endif
+
/* Define a macro to look for REG_INC notes,
but save time on machines where they never exist. */
! #if (defined (HAVE_PRE_DECREMENT) || defined (HAVE_POST_DECREMENT))
! #define HAVE_AUTO_DEC
#endif
/* Indicate whether the machine has any sort of auto increment addressing.
If not, we can avoid checking for REG_INC notes. */
/* Don't continue this line--convex cc version 4.1 would lose. */
! #if (defined (HAVE_AUTO_MODIFY) || defined (HAVE_AUTO_INC) || defined (HAVE_AUTO_DEC))
#define AUTO_INC_DEC
#endif
+ /* Define a macro to look for REG_INC notes,
+ but save time on machines where they never exist. */
+
+ #ifdef AUTO_INC_DEC
+ #define FIND_REG_INC_NOTE(insn, reg) (find_reg_note ((insn), REG_INC, (reg)))
+ #else
+ #define FIND_REG_INC_NOTE(insn, reg) 0
+ #endif
+
#ifndef HAVE_PRE_INCREMENT
! #define HAVE_PRE_INCREMENT 0
#endif
#ifndef HAVE_PRE_DECREMENT
! #define HAVE_PRE_DECREMENT 0
#endif
#ifndef HAVE_POST_INCREMENT
! #define HAVE_POST_INCREMENT 0
#endif
#ifndef HAVE_POST_DECREMENT
! #define HAVE_POST_DECREMENT 0
#endif
+ #ifndef HAVE_POST_MODIFY_DISP
+ #define HAVE_POST_MODIFY_DISP 0
+ #endif
+
+ #ifndef HAVE_PRE_MODIFY_DISP
+ #define HAVE_PRE_MODIFY_DISP 0
+ #endif
+
+ #ifndef HAVE_POST_MODIFY_REG
+ #define HAVE_POST_MODIFY_REG 0
+ #endif
+ #ifndef HAVE_PRE_MODIFY_REG
+ #define HAVE_PRE_MODIFY_REG 0
+ #endif
+
+
/* Some architectures do not have complete pre/post increment/decrement
instruction sets, or only move some modes efficiently. These macros
allow us to tune autoincrement generation. */
*************** extern const char * const note_insn_name
*** 834,840 ****
--- 864,902 ----
#define USE_STORE_PRE_DECREMENT(MODE) HAVE_PRE_DECREMENT
#endif
+ #ifndef USE_LOAD_POST_MODIFY_DISP
+ #define USE_LOAD_POST_MODIFY_DISP(MODE) HAVE_POST_MODIFY_DISP
+ #endif
+
+ #ifndef USE_LOAD_PRE_MODIFY_DISP
+ #define USE_LOAD_PRE_MODIFY_DISP(MODE) HAVE_PRE_MODIFY_DISP
+ #endif
+
+ #ifndef USE_STORE_POST_MODIFY_DISP
+ #define USE_STORE_POST_MODIFY_DISP(MODE) HAVE_POST_MODIFY_DISP
+ #endif
+
+ #ifndef USE_STORE_PRE_MODIFY_DISP
+ #define USE_STORE_PRE_MODIFY_DISP(MODE) HAVE_PRE_MODIFY_DISP
+ #endif
+
+ #ifndef USE_LOAD_PRE_MODIFY_REG
+ #define USE_LOAD_PRE_MODIFY_REG(MODE) HAVE_PRE_MODIFY_REG
+ #endif
+
+ #ifndef USE_LOAD_POST_MODIFY_REG
+ #define USE_LOAD_POST_MODIFY_REG(MODE) HAVE_POST_MODIFY_REG
+ #endif
+
+ #ifndef USE_STORE_PRE_MODIFY_REG
+ #define USE_STORE_PRE_MODIFY_REG(MODE) HAVE_PRE_MODIFY_REG
+ #endif
+
+ #ifndef USE_STORE_POST_MODIFY_REG
+ #define USE_STORE_POST_MODIFY_REG(MODE) HAVE_POST_MODIFY_REG
+ #endif
+
/* Accessors for RANGE_INFO. */
/* For RANGE_{START,END} notes return the RANGE_START note. */
#define RANGE_INFO_NOTE_START(INSN) XCEXP (INSN, 0, RANGE_INFO)
More information about the Gcc
mailing list