aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorJeffrey A Law <law@cygnus.com>1998-11-24 23:15:19 +0000
committerJeff Law <law@gcc.gnu.org>1998-11-24 16:15:19 -0700
commit940da3246db50a1c1fde531ba1457e6bef61b3f9 (patch)
tree488e0bd31e47424105f777ed841d306134aabbfd /gcc/expr.c
parent83f660b7585eed3232073f360075fd93a2c66468 (diff)
downloadgcc-940da3246db50a1c1fde531ba1457e6bef61b3f9.zip
gcc-940da3246db50a1c1fde531ba1457e6bef61b3f9.tar.gz
gcc-940da3246db50a1c1fde531ba1457e6bef61b3f9.tar.bz2
cse.c (fold_rtx): Make autoincrement addressing mode tests be runtime selectable.
* 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
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c44
1 files changed, 12 insertions, 32 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index ca0aba1..534fac6 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -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;