aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Evans <dje@gnu.org>1997-04-13 23:29:50 +0000
committerDoug Evans <dje@gnu.org>1997-04-13 23:29:50 +0000
commit58a32c5c030a7928ea45640bde5cd3854cc8bce2 (patch)
treeeba52ea5e0ab3092ee11bd2595f7cbb3fab063c4
parentad5780142a62bf2937d21341b3c488c9d143449f (diff)
downloadgcc-58a32c5c030a7928ea45640bde5cd3854cc8bce2.zip
gcc-58a32c5c030a7928ea45640bde5cd3854cc8bce2.tar.gz
gcc-58a32c5c030a7928ea45640bde5cd3854cc8bce2.tar.bz2
* expr.c (move_block_from_reg): Try using an integral mov operation first.
From-SVN: r13897
-rw-r--r--gcc/expr.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 31e63a1..7a855ad 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -1717,9 +1717,21 @@ move_block_from_reg (regno, x, nregs, size)
{
int i;
rtx pat, last;
+ enum machine_mode mode;
+ /* If SIZE is that of a mode no bigger than a word, just use that
+ mode's store operation. */
+ if (size <= UNITS_PER_WORD
+ && (mode = mode_for_size (size * BITS_PER_UNIT, MODE_INT, 0)) != BLKmode)
+ {
+ emit_move_insn (change_address (x, mode, NULL),
+ gen_rtx (REG, mode, regno));
+ return;
+ }
+
/* Blocks smaller than a word on a BYTES_BIG_ENDIAN machine must be aligned
- to the left before storing to memory. */
+ to the left before storing to memory. Note that the previous test
+ doesn't handle all cases (e.g. SIZE == 3). */
if (size < UNITS_PER_WORD && BYTES_BIG_ENDIAN)
{
rtx tem = operand_subword (x, 0, 1, BLKmode);