Commit 0be4693a by Kazuhiro Inaoka Committed by Nick Clifton

m32r.c (m32r_expand_block_move): Return 0 if nothing was done.

* config/m32r/m32r.c (m32r_expand_block_move):  Return 0 if nothing was done.
* config/m32r/m32r.md (movmemsi):  If m32r_expand_block_move did nothing then FAIL.
* config/m32r/m32r/m32r-protos.h  (m32r_expand_block_move): Update prototype.

From-SVN: r100095
parent 37495922
2005-05-24 Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>
* config/m32r/m32r.c (m32r_expand_block_move): Return 0 if
nothing was done.
* config/m32r/m32r.md (movmemsi): If m32r_expand_block_move did
nothing then FAIL.
* config/m32r/m32r/m32r-protos.h (m32r_expand_block_move): Update
prototype.
2005-05-23 Jeff Law <law@redhat.com> 2005-05-23 Jeff Law <law@redhat.com>
* tree-ssa-dom.c (cprop_into_stmt): Do not call * tree-ssa-dom.c (cprop_into_stmt): Do not call
......
...@@ -47,7 +47,7 @@ extern void m32r_initialize_trampoline (rtx, rtx, rtx); ...@@ -47,7 +47,7 @@ extern void m32r_initialize_trampoline (rtx, rtx, rtx);
extern int zero_and_one (rtx, rtx); extern int zero_and_one (rtx, rtx);
extern char * emit_cond_move (rtx *, rtx); extern char * emit_cond_move (rtx *, rtx);
extern void m32r_output_block_move (rtx, rtx *); extern void m32r_output_block_move (rtx, rtx *);
extern void m32r_expand_block_move (rtx *); extern int m32r_expand_block_move (rtx *);
extern void m32r_print_operand (FILE *, rtx, int); extern void m32r_print_operand (FILE *, rtx, int);
extern void m32r_print_operand_address (FILE *, rtx); extern void m32r_print_operand_address (FILE *, rtx);
extern int m32r_not_same_reg (rtx, rtx); extern int m32r_not_same_reg (rtx, rtx);
......
...@@ -2201,9 +2201,11 @@ block_move_call (rtx dest_reg, rtx src_reg, rtx bytes_rtx) ...@@ -2201,9 +2201,11 @@ block_move_call (rtx dest_reg, rtx src_reg, rtx bytes_rtx)
operands[0] is the pointer to the destination. operands[0] is the pointer to the destination.
operands[1] is the pointer to the source. operands[1] is the pointer to the source.
operands[2] is the number of bytes to move. operands[2] is the number of bytes to move.
operands[3] is the alignment. */ operands[3] is the alignment.
void Returns 1 upon success, 0 otherwise. */
int
m32r_expand_block_move (rtx operands[]) m32r_expand_block_move (rtx operands[])
{ {
rtx orig_dst = operands[0]; rtx orig_dst = operands[0];
...@@ -2218,7 +2220,7 @@ m32r_expand_block_move (rtx operands[]) ...@@ -2218,7 +2220,7 @@ m32r_expand_block_move (rtx operands[])
rtx dst_reg; rtx dst_reg;
if (constp && bytes <= 0) if (constp && bytes <= 0)
return; return 1;
/* Move the address into scratch registers. */ /* Move the address into scratch registers. */
dst_reg = copy_addr_to_reg (XEXP (orig_dst, 0)); dst_reg = copy_addr_to_reg (XEXP (orig_dst, 0));
...@@ -2233,7 +2235,7 @@ m32r_expand_block_move (rtx operands[]) ...@@ -2233,7 +2235,7 @@ m32r_expand_block_move (rtx operands[])
if (optimize_size || ! constp || align != UNITS_PER_WORD) if (optimize_size || ! constp || align != UNITS_PER_WORD)
{ {
block_move_call (dst_reg, src_reg, bytes_rtx); block_move_call (dst_reg, src_reg, bytes_rtx);
return; return 0;
} }
leftover = bytes % MAX_MOVE_BYTES; leftover = bytes % MAX_MOVE_BYTES;
...@@ -2290,6 +2292,7 @@ m32r_expand_block_move (rtx operands[]) ...@@ -2290,6 +2292,7 @@ m32r_expand_block_move (rtx operands[])
emit_insn (gen_movmemsi_internal (dst_reg, src_reg, GEN_INT (leftover), emit_insn (gen_movmemsi_internal (dst_reg, src_reg, GEN_INT (leftover),
gen_reg_rtx (SImode), gen_reg_rtx (SImode),
gen_reg_rtx (SImode))); gen_reg_rtx (SImode)));
return 1;
} }
......
...@@ -2542,10 +2542,12 @@ ...@@ -2542,10 +2542,12 @@
"" ""
" "
{ {
if (operands[0]) /* avoid unused code messages */ if (operands[0]) /* Avoid unused code messages. */
{ {
m32r_expand_block_move (operands); if (m32r_expand_block_move (operands))
DONE; DONE;
else
FAIL;
} }
}") }")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment