diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2015-06-30 20:56:43 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2015-06-30 20:56:43 +0000 |
commit | 20fceb31cd7e622b5a4d575249858da92d1fd79b (patch) | |
tree | 098dfc3be0a0f599560f5be88b735ac1df50858f /gcc/expr.c | |
parent | ccf5bbdd40aaa0258eb9671cd11c0bab4a16236e (diff) | |
download | gcc-20fceb31cd7e622b5a4d575249858da92d1fd79b.zip gcc-20fceb31cd7e622b5a4d575249858da92d1fd79b.tar.gz gcc-20fceb31cd7e622b5a4d575249858da92d1fd79b.tar.bz2 |
gcc/
* defaults.h (HAVE_load_multiple, gen_load_multiple)
(HAVE_store_multiple, gen_store_multiple): Delete.
* target-insns.def (load_multiple, store_multiple): New targetm
instruction patterns.
* expr.c (move_block_to_reg, move_block_from_reg): Use them instead
of HAVE_*/gen_* interface.
From-SVN: r225210
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 28 |
1 files changed, 11 insertions, 17 deletions
@@ -1491,10 +1491,6 @@ emit_block_move_via_loop (rtx x, rtx y, rtx size, void move_block_to_reg (int regno, rtx x, int nregs, machine_mode mode) { - int i; - rtx pat; - rtx_insn *last; - if (nregs == 0) return; @@ -1502,12 +1498,12 @@ move_block_to_reg (int regno, rtx x, int nregs, machine_mode mode) x = validize_mem (force_const_mem (mode, x)); /* See if the machine can do this with a load multiple insn. */ - if (HAVE_load_multiple) + if (targetm.have_load_multiple ()) { - last = get_last_insn (); - pat = gen_load_multiple (gen_rtx_REG (word_mode, regno), x, - GEN_INT (nregs)); - if (pat) + rtx_insn *last = get_last_insn (); + rtx first = gen_rtx_REG (word_mode, regno); + if (rtx_insn *pat = targetm.gen_load_multiple (first, x, + GEN_INT (nregs))) { emit_insn (pat); return; @@ -1516,7 +1512,7 @@ move_block_to_reg (int regno, rtx x, int nregs, machine_mode mode) delete_insns_since (last); } - for (i = 0; i < nregs; i++) + for (int i = 0; i < nregs; i++) emit_move_insn (gen_rtx_REG (word_mode, regno + i), operand_subword_force (x, i, mode)); } @@ -1527,18 +1523,16 @@ move_block_to_reg (int regno, rtx x, int nregs, machine_mode mode) void move_block_from_reg (int regno, rtx x, int nregs) { - int i; - if (nregs == 0) return; /* See if the machine can do this with a store multiple insn. */ - if (HAVE_store_multiple) + if (targetm.have_store_multiple ()) { rtx_insn *last = get_last_insn (); - rtx pat = gen_store_multiple (x, gen_rtx_REG (word_mode, regno), - GEN_INT (nregs)); - if (pat) + rtx first = gen_rtx_REG (word_mode, regno); + if (rtx_insn *pat = targetm.gen_store_multiple (x, first, + GEN_INT (nregs))) { emit_insn (pat); return; @@ -1547,7 +1541,7 @@ move_block_from_reg (int regno, rtx x, int nregs) delete_insns_since (last); } - for (i = 0; i < nregs; i++) + for (int i = 0; i < nregs; i++) { rtx tem = operand_subword (x, i, 1, BLKmode); |