cse.c (fold_rtx): Make autoincrement addressing mode tests be runtime selectable.
authorJeffrey A Law <law@cygnus.com>
Tue, 24 Nov 1998 23:15:19 +0000 (23:15 +0000)
committerJeff Law <law@gcc.gnu.org>
Tue, 24 Nov 1998 23:15:19 +0000 (16:15 -0700)
        * cse.c (fold_rtx): Make autoincrement addressing mode tests be
        runtime selectable.
        * expr.c (move_by_pieces): Similarly.
        (move_by_pieces_1, clear_by_pieces, clear_by_pieces_1): Similarly.
        * flow.c (find_auto_inc): Similarly.
        (try_pre_increment): Similarly.
        * loop.c (strength_reduce): Similarly.
        * regclass.c (auto_inc_dec_reg_p): Similarly.
        * regmove.c (try_auto_increment): Similarly.
        (fixup_match_1): Similarly.
        * rtl.h (HAVE_PRE_INCREMENT): Define if not already defined.
        (HAVE_PRE_DECREMENT): Similarly.
        (HAVE_POST_INCREMENT, HAVE_POST_DECREMENT): Similarly.
        sponding changes to all target header files.

From-SVN: r23837

39 files changed:
gcc/ChangeLog
gcc/config/1750a/1750a.h
gcc/config/a29k/a29k.h
gcc/config/alpha/alpha.h
gcc/config/arc/arc.h
gcc/config/c4x/c4x.h
gcc/config/clipper/clipper.h
gcc/config/convex/convex.h
gcc/config/dsp16xx/dsp16xx.h
gcc/config/elxsi/elxsi.h
gcc/config/fx80/fx80.h
gcc/config/gmicro/gmicro.h
gcc/config/h8300/h8300.h
gcc/config/i370/i370.h
gcc/config/i386/i386.h
gcc/config/i860/i860.h
gcc/config/i960/i960.h
gcc/config/m32r/m32r.h
gcc/config/m68k/m68k.h
gcc/config/m88k/m88k.h
gcc/config/mips/mips.h
gcc/config/ns32k/ns32k.h
gcc/config/pa/pa.h
gcc/config/pdp11/pdp11.h
gcc/config/pyr/pyr.h
gcc/config/romp/romp.h
gcc/config/rs6000/rs6000.h
gcc/config/sparc/sparc.h
gcc/config/spur/spur.h
gcc/config/vax/vax.h
gcc/config/we32k/we32k.h
gcc/cse.c
gcc/expr.c
gcc/flow.c
gcc/loop.c
gcc/regclass.c
gcc/regmove.c
gcc/rtl.h
gcc/tm.texi

index d986252563b22c0d5a49b62dff7a7d606461935b..389fbd602eb331e4d86ae2eeab8c65858d1f7237 100644 (file)
@@ -1,3 +1,20 @@
+Wed Nov 25 00:07:11 1998  Jeffrey A Law  (law@cygnus.com)
+
+       * cse.c (fold_rtx): Make autoincrement addressing mode tests be
+       runtime selectable.
+       * expr.c (move_by_pieces): Similarly.
+       (move_by_pieces_1, clear_by_pieces, clear_by_pieces_1): Similarly.
+       * flow.c (find_auto_inc): Similarly.
+       (try_pre_increment): Similarly.
+       * loop.c (strength_reduce): Similarly.
+       * regclass.c (auto_inc_dec_reg_p): Similarly.
+       * regmove.c (try_auto_increment): Similarly.
+       (fixup_match_1): Similarly.
+       * rtl.h (HAVE_PRE_INCREMENT): Define if not already defined.
+       (HAVE_PRE_DECREMENT): Similarly.
+       (HAVE_POST_INCREMENT, HAVE_POST_DECREMENT): Similarly.
+       sponding changes to all target header files.
+
 Tue Nov 24 20:24:59 1998  Jim Wilson  <wilson@cygnus.com>
 
        * configure.in (m68020-*-elf*, m68k-*-elf*): New targets.
index 0a3aa8e3c98701f34e68e62efa5416f90f760a43..8c5607af47141b171cc90b90a055e4c6209583da 100644 (file)
@@ -707,10 +707,10 @@ enum reg_class { NO_REGS, R2, R0_1, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLA
 
 /* 1750 doesn't have a lot of auto-incr./decr. - just for the stack ptr. */
 
-/* #define HAVE_POST_INCREMENT  just for R15 (stack pointer) */
-/* #define HAVE_POST_DECREMENT */
-/* #define HAVE_PRE_DECREMENT   just for R15 (stack pointer) */
-/* #define HAVE_PRE_INCREMENT */
+/* #define HAVE_POST_INCREMENT 0 just for R15 (stack pointer) */
+/* #define HAVE_POST_DECREMENT */
+/* #define HAVE_PRE_DECREMENT 0  just for R15 (stack pointer) */
+/* #define HAVE_PRE_INCREMENT */
 
 /* Macros to check register numbers against specific register classes.  */
 
index c3e61747b42fe3d2073f9e6e49c4ffdfb91c7df5..a6c8941f07b0d7b80e1f19dcc23f4d5b3fef7cb5 100644 (file)
@@ -1067,11 +1067,11 @@ extern char *a29k_function_name;
 \f
 /* Addressing modes, and classification of registers for them.  */
 
-/* #define HAVE_POST_INCREMENT */
-/* #define HAVE_POST_DECREMENT */
+/* #define HAVE_POST_INCREMENT */
+/* #define HAVE_POST_DECREMENT */
 
-/* #define HAVE_PRE_DECREMENT */
-/* #define HAVE_PRE_INCREMENT */
+/* #define HAVE_PRE_DECREMENT */
+/* #define HAVE_PRE_INCREMENT */
 
 /* Macros to check register numbers against specific register classes.  */
 
index 13ce722dc3e495bd66a884e6def09df7f88fdf7d..5490289c2c944fe461fedb81ecc65efa8ed82662 100644 (file)
@@ -1316,11 +1316,11 @@ extern void alpha_init_expanders ();
 \f
 /* Addressing modes, and classification of registers for them.  */
 
-/* #define HAVE_POST_INCREMENT */
-/* #define HAVE_POST_DECREMENT */
+/* #define HAVE_POST_INCREMENT */
+/* #define HAVE_POST_DECREMENT */
 
-/* #define HAVE_PRE_DECREMENT */
-/* #define HAVE_PRE_INCREMENT */
+/* #define HAVE_PRE_DECREMENT */
+/* #define HAVE_PRE_INCREMENT */
 
 /* Macros to check register numbers against specific register classes.  */
 
index ab1dc15311662bde6667897f2de79a726c2193d6..49d9fe2edd2683953fa216324e4235354670f1dd 100644 (file)
@@ -927,8 +927,8 @@ do { \
 #define MAX_REGS_PER_ADDRESS 1
 
 /* We have pre inc/dec (load/store with update).  */
-#define HAVE_PRE_INCREMENT
-#define HAVE_PRE_DECREMENT
+#define HAVE_PRE_INCREMENT 1
+#define HAVE_PRE_DECREMENT 1
 
 /* Recognize any constant value that is a valid address.  */
 #define CONSTANT_ADDRESS_P(X) \
index 527c0a721bd9763bdb2604c0904789dfa23aa210..9715453317d4c16fd450f53d1ef924b219b0b8a4 100644 (file)
@@ -1519,14 +1519,14 @@ extern struct rtx_def *c4x_gen_compare_reg ();
 
 /* Addressing Modes  */
 
-#define HAVE_POST_INCREMENT
-#define HAVE_PRE_INCREMENT
-#define HAVE_POST_DECREMENT
-#define HAVE_PRE_DECREMENT
-#define HAVE_PRE_MODIFY_REG
-#define HAVE_POST_MODIFY_REG
-#define HAVE_PRE_MODIFY_DISP
-#define HAVE_POST_MODIFY_DISP
+#define HAVE_POST_INCREMENT 1
+#define HAVE_PRE_INCREMENT 1
+#define HAVE_POST_DECREMENT 1
+#define HAVE_PRE_DECREMENT 1
+#define HAVE_PRE_MODIFY_REG 1
+#define HAVE_POST_MODIFY_REG 1
+#define HAVE_PRE_MODIFY_DISP 1
+#define HAVE_POST_MODIFY_DISP 1
 
 /* What about LABEL_REF?  */
 #define CONSTANT_ADDRESS_P(X) (GET_CODE (X) == SYMBOL_REF)
index 8ce8c473f59368ca58fe54ee79c29db3fa12205b..666e96d1061714372b2d2f5db86c71b96053c63a 100644 (file)
@@ -639,9 +639,9 @@ do                                                                        \
 \f
 /* Addressing modes, and classification of registers for them.  */
 
-/* #define HAVE_POST_DECREMENT */
+/* #define HAVE_POST_DECREMENT */
 
-/* #define HAVE_PRE_INCREMENT */
+/* #define HAVE_PRE_INCREMENT */
 
 /* Macros to check register numbers against specific register classes.  */
 
index 893d83aee28bd47a1c14ecf7977ad2b7397c2531..f455f961c4aa81fe73489c2d550576c5d85b9bf2 100644 (file)
@@ -892,11 +892,11 @@ enum reg_class {
 \f
 /* Addressing modes, and classification of registers for them.  */
 
-/* #define HAVE_POST_INCREMENT */
-/* #define HAVE_POST_DECREMENT */
+/* #define HAVE_POST_INCREMENT */
+/* #define HAVE_POST_DECREMENT */
 
-/* #define HAVE_PRE_DECREMENT */
-/* #define HAVE_PRE_INCREMENT */
+/* #define HAVE_PRE_DECREMENT */
+/* #define HAVE_PRE_INCREMENT */
 
 /* Macros to check register numbers against specific register classes.  */
 
index d63cc80033747b9ae13df947ec3e7adf086bda1a..f71ed371c6e15a56efa55b42666812ed288b31d5 100644 (file)
@@ -1299,11 +1299,11 @@ extern struct dsp16xx_frame_info current_frame_info;
 /* ADDRESSING MODES */
 
 /* The 1610 has post-increment and decrement, but no pre-modify */
-#define HAVE_POST_INCREMENT
-#define HAVE_POST_DECREMENT
+#define HAVE_POST_INCREMENT 1
+#define HAVE_POST_DECREMENT 1
 
-/* #define HAVE_PRE_DECREMENT */
-/* #define HAVE_PRE_INCREMENT */
+/* #define HAVE_PRE_DECREMENT */
+/* #define HAVE_PRE_INCREMENT */
 
 /* Recognize any constant value that is a valid address.  */
 #define CONSTANT_ADDRESS_P(X)  CONSTANT_P (X)
index 5d35acef74f9e756aaa0e04fe4c81bf4505d5786..6e8da32d91b9f26188a714c85152f7814649473b 100644 (file)
@@ -499,11 +499,11 @@ enum reg_class { NO_REGS, GENERAL_REGS, ALL_REGS, LIM_REG_CLASSES };
 \f
 /* Addressing modes, and classification of registers for them.  */
 
-/* #define HAVE_POST_INCREMENT */
-/* #define HAVE_POST_DECREMENT */
+/* #define HAVE_POST_INCREMENT */
+/* #define HAVE_POST_DECREMENT */
 
-/* #define HAVE_PRE_DECREMENT */
-/* #define HAVE_PRE_INCREMENT */
+/* #define HAVE_PRE_DECREMENT */
+/* #define HAVE_PRE_INCREMENT */
 
 /* Macros to check register numbers against specific register classes.  */
 
index 0826236b6442ac62a7194157ad2cfa77aabb338f..651d13d0a69d501108eb96e14a7567b6acae3f30 100644 (file)
@@ -607,11 +607,11 @@ extern enum reg_class regno_reg_class[];
 \f
 /* Addressing modes, and classification of registers for them.  */
 
-#define HAVE_POST_INCREMENT
-/* #define HAVE_POST_DECREMENT */
+#define HAVE_POST_INCREMENT 1
+/* #define HAVE_POST_DECREMENT */
 
-#define HAVE_PRE_DECREMENT
-/* #define HAVE_PRE_INCREMENT */
+#define HAVE_PRE_DECREMENT 1
+/* #define HAVE_PRE_INCREMENT */
 
 /* Macros to check register numbers against specific register classes.  */
 
index ebcab0ce6fa10f54e7b1ea358be5e416b3181f0d..789ca8439824aef7343770c4879fe8022500f0ee 100644 (file)
@@ -863,11 +863,11 @@ extern enum reg_class regno_reg_class[];
 \f
 /* Addressing modes, and classification of registers for them.  */
 
-/* #define HAVE_POST_INCREMENT */
-/* #define HAVE_POST_DECREMENT */
+/* #define HAVE_POST_INCREMENT */
+/* #define HAVE_POST_DECREMENT */
 
-/* #define HAVE_PRE_DECREMENT */
-/* #define HAVE_PRE_INCREMENT */
+/* #define HAVE_PRE_DECREMENT */
+/* #define HAVE_PRE_INCREMENT */
 
 /* Macros to check register numbers against specific register classes.  */
 
index f159174980d42fadc6ac504d7afef78935632c99..8f617aedecf43e6ebe7d14bc94b4af9b73e31557 100644 (file)
@@ -721,11 +721,11 @@ struct rtx_def *function_arg();
 \f
 /* Addressing modes, and classification of registers for them.  */
 
-#define HAVE_POST_INCREMENT
-/*#define HAVE_POST_DECREMENT */
+#define HAVE_POST_INCREMENT 1
+/*#define HAVE_POST_DECREMENT */
 
-#define HAVE_PRE_DECREMENT
-/*#define HAVE_PRE_INCREMENT */
+#define HAVE_PRE_DECREMENT 1
+/*#define HAVE_PRE_INCREMENT */
 
 /* Macros to check register numbers against specific register classes.  */
 
index 1bb4e069e0a6a385a82981eb76e63241cb6219bf..22675eb1ffc0b66c9c2f358da7f8160dfa7b2f1a 100644 (file)
@@ -612,11 +612,11 @@ enum reg_class
 
 /* Addressing modes, and classification of registers for them.  */
 
-/* #define HAVE_POST_INCREMENT */
-/* #define HAVE_POST_DECREMENT */
+/* #define HAVE_POST_INCREMENT */
+/* #define HAVE_POST_DECREMENT */
 
-/* #define HAVE_PRE_DECREMENT */
-/* #define HAVE_PRE_INCREMENT */
+/* #define HAVE_PRE_DECREMENT */
+/* #define HAVE_PRE_INCREMENT */
 
 /* These assume that REGNO is a hard or pseudo reg number.  They give
    nonzero only if REGNO is a hard reg of the suitable class or a pseudo
index d599c9a7e38c46f6cab513345d4bdc454805359d..9e1150b0be380f17d0f9c84e7ec2633d20abda50 100644 (file)
@@ -1606,11 +1606,11 @@ do {                                            \
 \f
 /* Addressing modes, and classification of registers for them.  */
 
-/* #define HAVE_POST_INCREMENT */
-/* #define HAVE_POST_DECREMENT */
+/* #define HAVE_POST_INCREMENT */
+/* #define HAVE_POST_DECREMENT */
 
-/* #define HAVE_PRE_DECREMENT */
-/* #define HAVE_PRE_INCREMENT */
+/* #define HAVE_PRE_DECREMENT */
+/* #define HAVE_PRE_INCREMENT */
 
 /* Macros to check register numbers against specific register classes.  */
 
index 316ba65a7d0d995674bdcd7fad5389fd4e54dab6..d6b29110eea2e65d9a606c09c58f12c16226de71 100644 (file)
@@ -656,11 +656,11 @@ struct cumulative_args { int ints, floats; };
 \f
 /* Addressing modes, and classification of registers for them.  */
 
-/* #define HAVE_POST_INCREMENT */
-/* #define HAVE_POST_DECREMENT */
+/* #define HAVE_POST_INCREMENT */
+/* #define HAVE_POST_DECREMENT */
 
-/* #define HAVE_PRE_DECREMENT */
-/* #define HAVE_PRE_INCREMENT */
+/* #define HAVE_PRE_DECREMENT */
+/* #define HAVE_PRE_INCREMENT */
 
 /* Macros to check register numbers against specific register classes.  */
 
index fac037bb348d1d2561ab082ac40cd4a1c0ace525..31102e50601becfffc116018f754b2394ab6dd1e 100644 (file)
@@ -924,11 +924,11 @@ extern struct rtx_def *i960_function_arg ();
 \f
 /* Addressing modes, and classification of registers for them.  */
 
-/* #define HAVE_POST_INCREMENT */
-/* #define HAVE_POST_DECREMENT */
+/* #define HAVE_POST_INCREMENT */
+/* #define HAVE_POST_DECREMENT */
 
-/* #define HAVE_PRE_DECREMENT */
-/* #define HAVE_PRE_INCREMENT */
+/* #define HAVE_PRE_DECREMENT */
+/* #define HAVE_PRE_INCREMENT */
 
 /* Macros to check register numbers against specific register classes.  */
 
index d825f98934671f5fb7bf56ad35bb8aff4657158c..425b83cb20b88d228db18dd931a7a356c3af4792 100644 (file)
@@ -1126,9 +1126,9 @@ do { \
 /* We have post-inc load and pre-dec,pre-inc store,
    but only for 4 byte vals.  */
 #if 0
-#define HAVE_PRE_DECREMENT
-#define HAVE_PRE_INCREMENT
-#define HAVE_POST_INCREMENT
+#define HAVE_PRE_DECREMENT 1
+#define HAVE_PRE_INCREMENT 1
+#define HAVE_POST_INCREMENT 1
 #endif
 
 /* Recognize any constant value that is a valid address.  */
index 2641ab6517992f07d42ca8b8138a3d4272a6bbfe..3db12e641e0e9a70aa75a86522992cb0608c36e8 100644 (file)
@@ -1281,11 +1281,11 @@ __transfer_from_trampoline ()                                   \
 \f
 /* Addressing modes, and classification of registers for them.  */
 
-#define HAVE_POST_INCREMENT
-/* #define HAVE_POST_DECREMENT */
+#define HAVE_POST_INCREMENT 1
+/* #define HAVE_POST_DECREMENT */
 
-#define HAVE_PRE_DECREMENT
-/* #define HAVE_PRE_INCREMENT */
+#define HAVE_PRE_DECREMENT 1
+/* #define HAVE_PRE_INCREMENT */
 
 /* Macros to check register numbers against specific register classes.  */
 
index 855b6bf46523b5a06dd685aad55521963468a009..66d218bc82bc646af5ee9514151bb97544dcbf24 100644 (file)
@@ -1259,11 +1259,11 @@ enum reg_class { NO_REGS, AP_REG, XRF_REGS, GENERAL_REGS, AGRF_REGS,
 
 #define SELECT_CC_MODE(OP,X,Y) CCmode
 
-/* #define HAVE_POST_INCREMENT */
-/* #define HAVE_POST_DECREMENT */
+/* #define HAVE_POST_INCREMENT */
+/* #define HAVE_POST_DECREMENT */
 
-/* #define HAVE_PRE_DECREMENT */
-/* #define HAVE_PRE_INCREMENT */
+/* #define HAVE_PRE_DECREMENT */
+/* #define HAVE_PRE_INCREMENT */
 
 /* Recognize any constant value that is a valid address.
    When PIC, we do not accept an address that would require a scratch reg
index 271570d70c48b37b084bc3bb33983717e33de778..f36398a8862080144b7c185771897b7ff3c522c8 100644 (file)
@@ -2634,11 +2634,11 @@ typedef struct mips_args {
 \f
 /* Addressing modes, and classification of registers for them.  */
 
-/* #define HAVE_POST_INCREMENT */
-/* #define HAVE_POST_DECREMENT */
+/* #define HAVE_POST_INCREMENT */
+/* #define HAVE_POST_DECREMENT */
 
-/* #define HAVE_PRE_DECREMENT */
-/* #define HAVE_PRE_INCREMENT */
+/* #define HAVE_PRE_DECREMENT */
+/* #define HAVE_PRE_INCREMENT */
 
 /* These assume that REGNO is a hard or pseudo reg number.
    They give nonzero only if REGNO is a hard reg of the suitable class
index 7c138a4d18b3605deadc286ddf98fc9285688660..d2e81d1f70e2048326c662e092f3e29e99e2db9c 100644 (file)
@@ -808,11 +808,11 @@ __transfer_from_trampoline ()             \
 \f
 /* Addressing modes, and classification of registers for them.  */
 
-/* #define HAVE_POST_INCREMENT */
-/* #define HAVE_POST_DECREMENT */
+/* #define HAVE_POST_INCREMENT */
+/* #define HAVE_POST_DECREMENT */
 
-/* #define HAVE_PRE_DECREMENT */
-/* #define HAVE_PRE_INCREMENT */
+/* #define HAVE_PRE_DECREMENT */
+/* #define HAVE_PRE_INCREMENT */
 
 /* Macros to check register numbers against specific register classes.  */
 
index 411fb99013405414c8d4a00837a5583674720355..7d31381791b1802e899fdcd8c874efcce3150013 100644 (file)
@@ -1368,11 +1368,11 @@ extern struct rtx_def *hppa_builtin_saveregs ();
 \f
 /* Addressing modes, and classification of registers for them.  */
 
-#define HAVE_POST_INCREMENT
-#define HAVE_POST_DECREMENT
+#define HAVE_POST_INCREMENT 1
+#define HAVE_POST_DECREMENT 1
 
-#define HAVE_PRE_DECREMENT
-#define HAVE_PRE_INCREMENT
+#define HAVE_PRE_DECREMENT 1
+#define HAVE_PRE_INCREMENT 1
 
 /* Macros to check register numbers against specific register classes.  */
 
index 55f9993e8127e56f7812d452ff1714989659a42e..a6281971f3e307bd5d14cee10b9cda5cdc18d5fb 100644 (file)
@@ -687,11 +687,11 @@ extern int current_function_pretend_args_size;
 \f
 /* Addressing modes, and classification of registers for them.  */
 
-#define HAVE_POST_INCREMENT
-/* #define HAVE_POST_DECREMENT */
+#define HAVE_POST_INCREMENT 1
+/* #define HAVE_POST_DECREMENT */
 
-#define HAVE_PRE_DECREMENT
-/* #define HAVE_PRE_INCREMENT */
+#define HAVE_PRE_DECREMENT 1
+/* #define HAVE_PRE_INCREMENT */
 
 /* Macros to check register numbers against specific register classes.  */
 
index 42d55c0b84be872ead5b926fd684a750985125bb..e5ffcb8361de4070a5b712a3d67e481db769ebd5 100644 (file)
@@ -803,11 +803,11 @@ extern int current_function_calls_alloca;
 \f
 /*** Addressing modes, and classification of registers for them.  ***/
 
-/* #define HAVE_POST_INCREMENT */      /* pyramid has none of these */
-/* #define HAVE_POST_DECREMENT */
+/* #define HAVE_POST_INCREMENT 0 */    /* pyramid has none of these */
+/* #define HAVE_POST_DECREMENT */
 
-/* #define HAVE_PRE_DECREMENT */
-/* #define HAVE_PRE_INCREMENT */
+/* #define HAVE_PRE_DECREMENT */
+/* #define HAVE_PRE_INCREMENT */
 
 /* Macros to check register numbers against specific register classes.  */
 
index f307e68c8c2828389b639f4d940bbe878d24ef86..82a0186a66ca892ee3aefbb539388b81291a22ef 100644 (file)
@@ -905,11 +905,11 @@ struct rt_cargs {int gregs, fregs; };
 \f
 /* Addressing modes, and classification of registers for them.  */
 
-/* #define HAVE_POST_INCREMENT */
-/* #define HAVE_POST_DECREMENT */
+/* #define HAVE_POST_INCREMENT */
+/* #define HAVE_POST_DECREMENT */
 
-/* #define HAVE_PRE_DECREMENT */
-/* #define HAVE_PRE_INCREMENT */
+/* #define HAVE_PRE_DECREMENT */
+/* #define HAVE_PRE_INCREMENT */
 
 /* Macros to check register numbers against specific register classes.  */
 
index 66e9c9ec3bd7c9b910a4e21ecc190d8e7f5c49ee..e5e699141758458c4c3f35365392fac05535dcc3 100644 (file)
@@ -1755,11 +1755,11 @@ typedef struct rs6000_args
 \f
 /* Addressing modes, and classification of registers for them.  */
 
-/* #define HAVE_POST_INCREMENT */
-/* #define HAVE_POST_DECREMENT */
+/* #define HAVE_POST_INCREMENT */
+/* #define HAVE_POST_DECREMENT */
 
-#define HAVE_PRE_DECREMENT
-#define HAVE_PRE_INCREMENT
+#define HAVE_PRE_DECREMENT 1
+#define HAVE_PRE_INCREMENT 1
 
 /* Macros to check register numbers against specific register classes.  */
 
index 8bcabc5236bcf74189728947cbdc29490b8affad..852a93f19f1e8882efaaac82dc0179902e19dc70 100644 (file)
@@ -2271,11 +2271,11 @@ extern struct rtx_def *sparc_builtin_saveregs ();
 \f
 /* Addressing modes, and classification of registers for them.  */
 
-/* #define HAVE_POST_INCREMENT */
-/* #define HAVE_POST_DECREMENT */
+/* #define HAVE_POST_INCREMENT */
+/* #define HAVE_POST_DECREMENT */
 
-/* #define HAVE_PRE_DECREMENT */
-/* #define HAVE_PRE_INCREMENT */
+/* #define HAVE_PRE_DECREMENT */
+/* #define HAVE_PRE_INCREMENT */
 
 /* Macros to check register numbers against specific register classes.  */
 
index c75caf6f5f12e0284564ff6539e466db6bf4d904..e6d058a4491380203a1d7aed7b0322b824273a6a 100644 (file)
@@ -586,11 +586,11 @@ extern int current_function_pretend_args_size;
 \f
 /* Addressing modes, and classification of registers for them.  */
 
-/* #define HAVE_POST_INCREMENT */
-/* #define HAVE_POST_DECREMENT */
+/* #define HAVE_POST_INCREMENT */
+/* #define HAVE_POST_DECREMENT */
 
-/* #define HAVE_PRE_DECREMENT */
-/* #define HAVE_PRE_INCREMENT */
+/* #define HAVE_PRE_DECREMENT */
+/* #define HAVE_PRE_INCREMENT */
 
 /* Macros to check register numbers against specific register classes.  */
 
index 3b4c54999cce8dea8a357aaad9df193d37715188..ad8fb7cc476397513acd0cb8d5e0876c5d0e9a52 100644 (file)
@@ -579,11 +579,11 @@ gen_rtx (PLUS, Pmode, frame, GEN_INT (12))
 \f
 /* Addressing modes, and classification of registers for them.  */
 
-#define HAVE_POST_INCREMENT
-/* #define HAVE_POST_DECREMENT */
+#define HAVE_POST_INCREMENT 1
+/* #define HAVE_POST_DECREMENT */
 
-#define HAVE_PRE_DECREMENT
-/* #define HAVE_PRE_INCREMENT */
+#define HAVE_PRE_DECREMENT 1
+/* #define HAVE_PRE_INCREMENT */
 
 /* Macros to check register numbers against specific register classes.  */
 
index 07f00107d59f2862c32456f6bb838dbf5b593926..0859ec1cdda5f4e176b5f569f88926d8a689c4f7 100644 (file)
@@ -509,11 +509,11 @@ enum reg_class { NO_REGS, GENERAL_REGS,
 \f
 /* Addressing modes, and classification of registers for them.  */
 
-/* #define HAVE_POST_INCREMENT */
-/* #define HAVE_POST_DECREMENT */
+/* #define HAVE_POST_INCREMENT */
+/* #define HAVE_POST_DECREMENT */
 
-/* #define HAVE_PRE_DECREMENT */
-/* #define HAVE_PRE_INCREMENT */
+/* #define HAVE_PRE_DECREMENT */
+/* #define HAVE_PRE_INCREMENT */
 
 /* Macros to check register numbers against specific register classes.  */
 
index 8fb473af57e44e5ebc88a7f4bdadb48076dae7fd..7b81de47e4e8b335b722fe77b35f1259dd0541ed 100644 (file)
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -5760,14 +5760,14 @@ fold_rtx (x, insn)
                 identical powers of two with post decrement.  */
 
              if (code == PLUS && INTVAL (const_arg1) == INTVAL (inner_const)
-                 && (0
-#if defined(HAVE_PRE_INCREMENT) || defined(HAVE_POST_INCREMENT)
-                     || exact_log2 (INTVAL (const_arg1)) >= 0
-#endif
-#if defined(HAVE_PRE_DECREMENT) || defined(HAVE_POST_DECREMENT)
-                     || exact_log2 (- INTVAL (const_arg1)) >= 0
-#endif
-                 ))
+                 && ((HAVE_PRE_INCREMENT
+                         && exact_log2 (INTVAL (const_arg1)) >= 0)
+                     || (HAVE_POST_INCREMENT
+                         && exact_log2 (INTVAL (const_arg1)) >= 0)
+                     || (HAVE_PRE_DECREMENT
+                         && exact_log2 (- INTVAL (const_arg1)) >= 0)
+                     || (HAVE_POST_DECREMENT
+                         && exact_log2 (- INTVAL (const_arg1)) >= 0)))
                break;
 
              /* Compute the code used to compose the constants.  For example,
index ca0aba102348771236594c676b60201b7aad8b9d..534fac638a7537315559d9fa09b8c2cfba2509b2 100644 (file)
@@ -1442,40 +1442,32 @@ move_by_pieces (to, from, len, align)
   if (!(data.autinc_from && data.autinc_to)
       && move_by_pieces_ninsns (len, align) > 2)
     {
-#ifdef HAVE_PRE_DECREMENT
-      if (data.reverse && ! data.autinc_from)
+      if (HAVE_PRE_DECREMENT && data.reverse && ! data.autinc_from)
        {
          data.from_addr = copy_addr_to_reg (plus_constant (from_addr, len));
          data.autinc_from = 1;
          data.explicit_inc_from = -1;
        }
-#endif
-#ifdef HAVE_POST_INCREMENT
-      if (! data.autinc_from)
+      if (HAVE_POST_INCREMENT && ! data.autinc_from)
        {
          data.from_addr = copy_addr_to_reg (from_addr);
          data.autinc_from = 1;
          data.explicit_inc_from = 1;
        }
-#endif
       if (!data.autinc_from && CONSTANT_P (from_addr))
        data.from_addr = copy_addr_to_reg (from_addr);
-#ifdef HAVE_PRE_DECREMENT
-      if (data.reverse && ! data.autinc_to)
+      if (HAVE_PRE_DECREMENT && data.reverse && ! data.autinc_to)
        {
          data.to_addr = copy_addr_to_reg (plus_constant (to_addr, len));
          data.autinc_to = 1;
          data.explicit_inc_to = -1;
        }
-#endif
-#ifdef HAVE_POST_INCREMENT
-      if (! data.reverse && ! data.autinc_to)
+      if (HAVE_POST_INCREMENT && ! data.reverse && ! data.autinc_to)
        {
          data.to_addr = copy_addr_to_reg (to_addr);
          data.autinc_to = 1;
          data.explicit_inc_to = 1;
        }
-#endif
       if (!data.autinc_to && CONSTANT_P (to_addr))
        data.to_addr = copy_addr_to_reg (to_addr);
     }
@@ -1586,20 +1578,16 @@ move_by_pieces_1 (genfun, mode, data)
                                                      data->offset))));
       MEM_IN_STRUCT_P (from1) = data->from_struct;
 
-#ifdef HAVE_PRE_DECREMENT
-      if (data->explicit_inc_to < 0)
+      if (HAVE_PRE_DECREMENT && data->explicit_inc_to < 0)
        emit_insn (gen_add2_insn (data->to_addr, GEN_INT (-size)));
-      if (data->explicit_inc_from < 0)
+      if (HAVE_PRE_DECREMENT && data->explicit_inc_from < 0)
        emit_insn (gen_add2_insn (data->from_addr, GEN_INT (-size)));
-#endif
 
       emit_insn ((*genfun) (to1, from1));
-#ifdef HAVE_POST_INCREMENT
-      if (data->explicit_inc_to > 0)
+      if (HAVE_POST_INCREMENT && data->explicit_inc_to > 0)
        emit_insn (gen_add2_insn (data->to_addr, GEN_INT (size)));
-      if (data->explicit_inc_from > 0)
+      if (HAVE_POST_INCREMENT && data->explicit_inc_from > 0)
        emit_insn (gen_add2_insn (data->from_addr, GEN_INT (size)));
-#endif
 
       if (! data->reverse) data->offset += size;
 
@@ -2267,22 +2255,18 @@ clear_by_pieces (to, len, align)
   if (!data.autinc_to
       && move_by_pieces_ninsns (len, align) > 2)
     {
-#ifdef HAVE_PRE_DECREMENT
-      if (data.reverse && ! data.autinc_to)
+      if (HAVE_PRE_DECREMENT && data.reverse && ! data.autinc_to)
        {
          data.to_addr = copy_addr_to_reg (plus_constant (to_addr, len));
          data.autinc_to = 1;
          data.explicit_inc_to = -1;
        }
-#endif
-#ifdef HAVE_POST_INCREMENT
-      if (! data.reverse && ! data.autinc_to)
+      if (HAVE_POST_INCREMENT && ! data.reverse && ! data.autinc_to)
        {
          data.to_addr = copy_addr_to_reg (to_addr);
          data.autinc_to = 1;
          data.explicit_inc_to = 1;
        }
-#endif
       if (!data.autinc_to && CONSTANT_P (to_addr))
        data.to_addr = copy_addr_to_reg (to_addr);
     }
@@ -2345,16 +2329,12 @@ clear_by_pieces_1 (genfun, mode, data)
                                                        data->offset))));
       MEM_IN_STRUCT_P (to1) = data->to_struct;
 
-#ifdef HAVE_PRE_DECREMENT
-      if (data->explicit_inc_to < 0)
+      if (HAVE_PRE_DECREMENT && data->explicit_inc_to < 0)
        emit_insn (gen_add2_insn (data->to_addr, GEN_INT (-size)));
-#endif
 
       emit_insn ((*genfun) (to1, const0_rtx));
-#ifdef HAVE_POST_INCREMENT
-      if (data->explicit_inc_to > 0)
+      if (HAVE_POST_INCREMENT && data->explicit_inc_to > 0)
        emit_insn (gen_add2_insn (data->to_addr, GEN_INT (size)));
-#endif
 
       if (! data->reverse) data->offset += size;
 
index 51be372988c2ff3b9ea1952de66bbb704538c6e6..510c011677f504eecc72bd5567c126886649564f 100644 (file)
@@ -2444,20 +2444,14 @@ find_auto_inc (needed, x, insn)
          && (y = SET_SRC (set), GET_CODE (y) == PLUS)
          && XEXP (y, 0) == addr
          && GET_CODE (XEXP (y, 1)) == CONST_INT
-         && (0
-#ifdef HAVE_POST_INCREMENT
-             || (INTVAL (XEXP (y, 1)) == size && offset == 0)
-#endif
-#ifdef HAVE_POST_DECREMENT
-             || (INTVAL (XEXP (y, 1)) == - size && offset == 0)
-#endif
-#ifdef HAVE_PRE_INCREMENT
-             || (INTVAL (XEXP (y, 1)) == size && offset == size)
-#endif
-#ifdef HAVE_PRE_DECREMENT
-             || (INTVAL (XEXP (y, 1)) == - size && offset == - size)
-#endif
-             )
+         && ((HAVE_POST_INCREMENT
+              && (INTVAL (XEXP (y, 1)) == size && offset == 0))
+             || (HAVE_POST_DECREMENT
+                 && (INTVAL (XEXP (y, 1)) == - size && offset == 0))
+             || (HAVE_PRE_INCREMENT
+                 && (INTVAL (XEXP (y, 1)) == size && offset == size))
+             || (HAVE_PRE_DECREMENT
+                 && (INTVAL (XEXP (y, 1)) == - size && offset == - size)))
          /* Make sure this reg appears only once in this insn.  */
          && (use = find_use_as_address (PATTERN (insn), addr, offset),
              use != 0 && use != (rtx) 1))
@@ -3021,23 +3015,15 @@ try_pre_increment (insn, reg, amount)
 
   /* From the sign of increment, see which possibilities are conceivable
      on this target machine.  */
-#ifdef HAVE_PRE_INCREMENT
-  if (amount > 0)
+  if (HAVE_PRE_INCREMENT && amount > 0)
     pre_ok = 1;
-#endif
-#ifdef HAVE_POST_INCREMENT
-  if (amount > 0)
+  if (HAVE_POST_INCREMENT && amount > 0)
     post_ok = 1;
-#endif
 
-#ifdef HAVE_PRE_DECREMENT
-  if (amount < 0)
+  if (HAVE_PRE_DECREMENT && amount < 0)
     pre_ok = 1;
-#endif
-#ifdef HAVE_POST_DECREMENT
-  if (amount < 0)
+  if (HAVE_POST_DECREMENT && amount < 0)
     post_ok = 1;
-#endif
 
   if (! (pre_ok || post_ok))
     return 0;
index 7eafea08df114e49f776e4b8d3c274e5bc149f55..b664e388047a8922e42106b0e2585de38dd66c56 100644 (file)
@@ -4168,14 +4168,18 @@ strength_reduce (scan_start, end, loop_top, insn_count,
          if (v->giv_type == DEST_ADDR
              && GET_CODE (v->mult_val) == CONST_INT)
            {
-#if defined (HAVE_POST_INCREMENT) || defined (HAVE_PRE_INCREMENT)
-             if (INTVAL (v->mult_val) == GET_MODE_SIZE (v->mem_mode))
+             if (HAVE_POST_INCREMENT
+                 && INTVAL (v->mult_val) == GET_MODE_SIZE (v->mem_mode))
                benefit += add_cost * bl->biv_count;
-#endif
-#if defined (HAVE_POST_DECREMENT) || defined (HAVE_PRE_DECREMENT)
-             if (-INTVAL (v->mult_val) == GET_MODE_SIZE (v->mem_mode))
+             else if (HAVE_PRE_INCREMENT
+                      && INTVAL (v->mult_val) == GET_MODE_SIZE (v->mem_mode))
+               benefit += add_cost * bl->biv_count;
+             else if (HAVE_POST_DECREMENT
+                      && -INTVAL (v->mult_val) == GET_MODE_SIZE (v->mem_mode))
+               benefit += add_cost * bl->biv_count;
+             else if (HAVE_PRE_DECREMENT
+                      && -INTVAL (v->mult_val) == GET_MODE_SIZE (v->mem_mode))
                benefit += add_cost * bl->biv_count;
-#endif
            }
 #endif
 
index 1788c3d68ac6fc77adf786d52e3ca06af1074713..1c249ea05291043a041157aeb25fa1aec5ebbc55 100644 (file)
@@ -1770,25 +1770,21 @@ auto_inc_dec_reg_p (reg, mode)
      rtx reg;
      enum machine_mode mode;
 {
-#ifdef HAVE_POST_INCREMENT
-  if (memory_address_p (mode, gen_rtx_POST_INC (Pmode, reg)))
+  if (HAVE_POST_INCREMENT
+      && memory_address_p (mode, gen_rtx_POST_INC (Pmode, reg)))
     return 1;
-#endif
 
-#ifdef HAVE_POST_DECREMENT
-  if (memory_address_p (mode, gen_rtx_POST_DEC (Pmode, reg)))
+  if (HAVE_POST_DECREMENT
+      && memory_address_p (mode, gen_rtx_POST_DEC (Pmode, reg)))
     return 1;
-#endif
 
-#ifdef HAVE_PRE_INCREMENT
-  if (memory_address_p (mode, gen_rtx_PRE_INC (Pmode, reg)))
+  if (HAVE_PRE_INCREMENT
+      && memory_address_p (mode, gen_rtx_PRE_INC (Pmode, reg)))
     return 1;
-#endif
 
-#ifdef HAVE_PRE_DECREMENT
-  if (memory_address_p (mode, gen_rtx_PRE_DEC (Pmode, reg)))
+  if (HAVE_PRE_DECREMENT
+      && memory_address_p (mode, gen_rtx_PRE_DEC (Pmode, reg)))
     return 1;
-#endif
 
   return 0;
 }
index f1353c8cedeaaeedb20ce6bf361d71162f62dd36..937241a5db2f2a0cecdf6411a392e6c47f575a30 100644 (file)
@@ -52,9 +52,7 @@ struct match {
   int early_clobber[MAX_RECOG_OPERANDS];
 };
 
-#ifdef AUTO_INC_DEC
 static int try_auto_increment PROTO((rtx, rtx, rtx, rtx, HOST_WIDE_INT, int));
-#endif
 static int find_matches PROTO((rtx, struct match *));
 static int fixup_match_1 PROTO((rtx, rtx, rtx, rtx, rtx, int, int, int, FILE *))
 ;
@@ -93,7 +91,6 @@ gen_add3_insn (r0, r1, c)
   return (GEN_FCN (icode) (r0, r1, c));
 }
 
-#ifdef AUTO_INC_DEC
 
 /* INC_INSN is an instruction that adds INCREMENT to REG.
    Try to fold INC_INSN as a post/pre in/decrement into INSN.
@@ -117,18 +114,14 @@ try_auto_increment (insn, inc_insn, inc_insn_set, reg, increment, pre)
        {
          int size = GET_MODE_SIZE (GET_MODE (use));
          if (0
-#ifdef HAVE_POST_INCREMENT
-             || (pre == 0 && (inc_code = POST_INC, increment == size))
-#endif
-#ifdef HAVE_PRE_INCREMENT
-             || (pre == 1 && (inc_code = PRE_INC, increment == size))
-#endif
-#ifdef HAVE_POST_DECREMENT
-             || (pre == 0 && (inc_code = POST_DEC, increment == -size))
-#endif
-#ifdef HAVE_PRE_DECREMENT
-             || (pre == 1 && (inc_code = PRE_DEC, increment == -size))
-#endif
+             || (HAVE_POST_INCREMENT
+                 && pre == 0 && (inc_code = POST_INC, increment == size))
+             || (HAVE_PRE_INCREMENT
+                 && pre == 1 && (inc_code = PRE_INC, increment == size))
+             || (HAVE_POST_DECREMENT
+                 && pre == 0 && (inc_code = POST_DEC, increment == -size))
+             || (HAVE_PRE_DECREMENT
+                 && pre == 1 && (inc_code = PRE_DEC, increment == -size))
          )
            {
              if (inc_insn_set)
@@ -156,7 +149,6 @@ try_auto_increment (insn, inc_insn, inc_insn_set, reg, increment, pre)
     }
   return 0;
 }
-#endif  /* AUTO_INC_DEC */
 
 static int *regno_src_regno;
 
@@ -1725,11 +1717,10 @@ fixup_match_1 (insn, set, src, src_subreg, dst, backward, operand_number,
   if (code == MINUS)
     {
       post_inc = emit_insn_after (copy_rtx (PATTERN (insn)), p);
-#if defined (HAVE_PRE_INCREMENT) || defined (HAVE_PRE_DECREMENT)
-      if (search_end
+      if ((HAVE_PRE_INCREMENT || HAVE_PRE_DECREMENT)
+         && search_end
          && try_auto_increment (search_end, post_inc, 0, src, newconst, 1))
        post_inc = 0;
-#endif
       validate_change (insn, &XEXP (SET_SRC (set), 1), GEN_INT (insn_const), 0);
       REG_N_SETS (REGNO (src))++;
       REG_N_REFS (REGNO (src)) += true_loop_depth;
@@ -1834,31 +1825,23 @@ fixup_match_1 (insn, set, src, src_subreg, dst, backward, operand_number,
      else in the next two conditionally included code blocks.  */
   if (0)
     {;}
-#if defined (HAVE_PRE_INCREMENT) || defined (HAVE_PRE_DECREMENT)
-  else if ((code == PLUS || code == MINUS) && insn_const
+  else if ((HAVE_PRE_INCREMENT || HAVE_PRE_DECREMENT)
+          && (code == PLUS || code == MINUS) && insn_const
           && try_auto_increment (p, insn, 0, src, insn_const, 1))
     insn = p;
-#endif
-#if defined (HAVE_POST_INCREMENT) || defined (HAVE_POST_DECREMENT)
-  else if (post_inc
+  else if ((HAVE_POST_INCREMENT || HAVE_POST_DECREMENT)
+          && post_inc
           && try_auto_increment (p, post_inc, post_inc_set, src, newconst, 0))
     post_inc = 0;
-#endif
-#if defined (HAVE_PRE_INCREMENT) || defined (HAVE_PRE_DECREMENT)
   /* If post_inc still prevails, try to find an
      insn where it can be used as a pre-in/decrement.
      If code is MINUS, this was already tried.  */
   if (post_inc && code == PLUS
   /* Check that newconst is likely to be usable
      in a pre-in/decrement before starting the search.  */
-      && (0
-#if defined (HAVE_PRE_INCREMENT)
-         || (newconst > 0 && newconst <= MOVE_MAX)
-#endif
-#if defined (HAVE_PRE_DECREMENT)
-         || (newconst < 0 && newconst >= -MOVE_MAX)
-#endif
-        ) && exact_log2 (newconst))
+      && ((HAVE_PRE_INCREMENT && newconst > 0 && newconst <= MOVE_MAX)
+         || (HAVE_PRE_DECREMENT && newconst < 0 && newconst >= -MOVE_MAX))
+      && exact_log2 (newconst))
     {
       rtx q, inc_dest;
 
@@ -1895,7 +1878,6 @@ fixup_match_1 (insn, set, src, src_subreg, dst, backward, operand_number,
            }
        }
     }
-#endif /* defined (HAVE_PRE_INCREMENT) || defined (HAVE_PRE_DECREMENT) */
   /* Move the death note for DST to INSN if it is used
      there.  */
   if (reg_overlap_mentioned_p (dst, PATTERN (insn)))
index 4c558bfd1e69778a004afbbea69ca620ddcf7ec7..6c47f2f9a1ccf6b61ab8c05e1e438d4715672320 100644 (file)
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -699,6 +699,22 @@ extern char *note_insn_name[];
 #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
+
 /* Accessors for RANGE_INFO.  */
 /* For RANGE_{START,END} notes return the RANGE_START note.  */
 #define RANGE_INFO_NOTE_START(INSN) (XEXP (INSN, 0))
index 7a0dd0e4756b3b4e6ac8ad2db5f12b919a9ac8ba..be5ccc9a1faac0444be555e3c6941b9990021b4f 100644 (file)
@@ -4156,7 +4156,7 @@ This is about addressing modes.
 @table @code
 @findex HAVE_POST_INCREMENT
 @item HAVE_POST_INCREMENT
-Define this macro if the machine supports post-increment addressing.
+A C expression that is nonzero the machine supports post-increment addressing.
 
 @findex HAVE_PRE_INCREMENT
 @findex HAVE_POST_DECREMENT