sh.c (force_into): New function.

* sh.c (force_into): New function.
	(expand_block_move): Use it.

From-SVN: r25540
This commit is contained in:
J"orn Rennecke 1999-03-02 16:42:59 +00:00 committed by Joern Rennecke
parent 4ed9f2126d
commit 0aa692fc03
2 changed files with 25 additions and 8 deletions

View File

@ -1,3 +1,8 @@
Wed Mar 3 00:00:37 1999 J"orn Rennecke <amylaar@cygnus.co.uk>
* sh.c (force_into): New function.
(expand_block_move): Use it.
Tue Mar 2 10:39:43 1999 Nick Clifton <nickc@cygnus.com>
* cccp.c (struct default_include): Add 'included' field.

View File

@ -305,6 +305,18 @@ print_operand (stream, x, code)
}
}
static void force_into PROTO ((rtx, rtx));
/* Like force_operand, but guarantees that VALUE ends up in TARGET. */
static void
force_into (value, target)
rtx value, target;
{
value = force_operand (value, target);
if (! rtx_equal_p (value, target))
emit_insn (gen_move_insn (target, value));
}
/* Emit code to perform a block move. Choose the best method.
OPERANDS[0] is the destination.
@ -342,8 +354,8 @@ expand_block_move (operands)
= copy_to_mode_reg (Pmode,
gen_rtx_SYMBOL_REF (Pmode,
IDENTIFIER_POINTER (entry_name)));
emit_insn (gen_move_insn (r4, XEXP (operands[0], 0)));
emit_insn (gen_move_insn (r5, XEXP (operands[1], 0)));
force_into (XEXP (operands[0], 0), r4);
force_into (XEXP (operands[1], 0), r5);
emit_insn (gen_block_move_real_i4 (func_addr_rtx));
return 1;
}
@ -363,8 +375,8 @@ expand_block_move (operands)
= copy_to_mode_reg (Pmode,
gen_rtx_SYMBOL_REF (Pmode,
IDENTIFIER_POINTER (entry_name)));
emit_insn (gen_move_insn (r4, XEXP (operands[0], 0)));
emit_insn (gen_move_insn (r5, XEXP (operands[1], 0)));
force_into (XEXP (operands[0], 0), r4);
force_into (XEXP (operands[1], 0), r5);
dwords = bytes >> 3;
emit_insn (gen_move_insn (r6, GEN_INT (dwords - 1)));
@ -389,8 +401,8 @@ expand_block_move (operands)
= copy_to_mode_reg (Pmode,
gen_rtx (SYMBOL_REF, Pmode,
IDENTIFIER_POINTER (entry_name)));
emit_insn (gen_move_insn (r4, XEXP (operands[0], 0)));
emit_insn (gen_move_insn (r5, XEXP (operands[1], 0)));
force_into (XEXP (operands[0], 0), r4);
force_into (XEXP (operands[1], 0), r5);
emit_insn (gen_block_move_real (func_addr_rtx));
return 1;
}
@ -411,8 +423,8 @@ expand_block_move (operands)
= copy_to_mode_reg (Pmode,
gen_rtx (SYMBOL_REF, Pmode,
IDENTIFIER_POINTER (entry_name)));
emit_insn (gen_move_insn (r4, XEXP (operands[0], 0)));
emit_insn (gen_move_insn (r5, XEXP (operands[1], 0)));
force_into (XEXP (operands[0], 0), r4);
force_into (XEXP (operands[1], 0), r5);
/* r6 controls the size of the move. 16 is decremented from it
for each 64 bytes moved. Then the negative bit left over is used