alpha.c (alpha_expand_block_move): mode_for_size expects bits, not bytes.
authorRichard Henderson <rth@cygnus.com>
Sat, 12 Dec 1998 16:52:32 +0000 (08:52 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Sat, 12 Dec 1998 16:52:32 +0000 (08:52 -0800)
        * alpha.c (alpha_expand_block_move): mode_for_size expects
        bits, not bytes.  Infer extra alignment from addressof.

From-SVN: r24270

gcc/ChangeLog
gcc/config/alpha/alpha.c

index a3896efeb92d6b13e73f2fdbc38d6cccae6f4555..08d919c0a59442417e6f1979781b8f270656c65d 100644 (file)
@@ -1,3 +1,8 @@
+Sat Dec 12 16:49:24 1998  Richard Henderson  <rth@cygnus.com>
+
+       * alpha.c (alpha_expand_block_move): mode_for_size expects
+       bits, not bytes.  Infer extra alignment from addressof.
+
 1998-12-11  Michael Meissner  <meissner@cygnus.com>
 
        * rs6000/sysv4.h (ASM_OUTPUT_ALIGNED_LOCAL): Put small data in the
index 56aadf6d2b52d3d837aae37db15a98772ae99ffd..452b6d8d98666e92f34bb257dcfca46c5186258c 100644 (file)
@@ -1836,7 +1836,8 @@ alpha_expand_block_move (operands)
 {
   rtx bytes_rtx        = operands[2];
   rtx align_rtx = operands[3];
-  HOST_WIDE_INT bytes = INTVAL (bytes_rtx);
+  HOST_WIDE_INT orig_bytes = INTVAL (bytes_rtx);
+  HOST_WIDE_INT bytes = orig_bytes;
   HOST_WIDE_INT src_align = INTVAL (align_rtx);
   HOST_WIDE_INT dst_align = src_align;
   rtx orig_src = operands[1];
@@ -1909,7 +1910,7 @@ alpha_expand_block_move (operands)
       enum machine_mode mode;
       tmp = XEXP (XEXP (orig_src, 0), 0);
 
-      mode = mode_for_size (bytes, MODE_INT, 1);
+      mode = mode_for_size (bytes * BITS_PER_UNIT, MODE_INT, 1);
       if (mode != BLKmode
          && GET_MODE_SIZE (GET_MODE (tmp)) <= bytes)
        {
@@ -2039,7 +2040,7 @@ alpha_expand_block_move (operands)
       enum machine_mode mode;
       tmp = XEXP (XEXP (orig_dst, 0), 0);
 
-      mode = mode_for_size (bytes, MODE_INT, 1);
+      mode = mode_for_size (orig_bytes * BITS_PER_UNIT, MODE_INT, 1);
       if (GET_MODE (tmp) == mode && nregs == 1)
        {
          emit_move_insn (tmp, data_regs[0]);
@@ -2049,9 +2050,12 @@ alpha_expand_block_move (operands)
 
       /* ??? If nregs > 1, consider reconstructing the word in regs.  */
       /* ??? Optimize mode < dst_mode with strict_low_part.  */
-      /* No appropriate mode; fall back on memory.  */
+
+      /* No appropriate mode; fall back on memory.  We can speed things
+        up by recognizing extra alignment information.  */
       orig_dst = change_address (orig_dst, GET_MODE (orig_dst),
                                 copy_addr_to_reg (XEXP (orig_dst, 0)));
+      dst_align = GET_MODE_SIZE (GET_MODE (tmp));
     }
 
   /* Write out the data in whatever chunks reading the source allowed.  */