data.to_addr = copy_addr_to_reg (to_addr);
}
- if (! SLOW_UNALIGNED_ACCESS (word_mode, align)
- || align > MOVE_MAX * BITS_PER_UNIT || align >= BIGGEST_ALIGNMENT)
- align = MOVE_MAX * BITS_PER_UNIT;
+ tmode = mode_for_size (MOVE_MAX_PIECES * BITS_PER_UNIT, MODE_INT, 1);
+ if (align >= GET_MODE_ALIGNMENT (tmode))
+ align = GET_MODE_ALIGNMENT (tmode);
+ else
+ {
+ enum machine_mode xmode;
+
+ for (tmode = GET_CLASS_NARROWEST_MODE (MODE_INT), xmode = tmode;
+ tmode != VOIDmode;
+ xmode = tmode, tmode = GET_MODE_WIDER_MODE (tmode))
+ if (GET_MODE_SIZE (tmode) > MOVE_MAX_PIECES
+ || SLOW_UNALIGNED_ACCESS (tmode, align))
+ break;
+
+ align = MAX (align, GET_MODE_ALIGNMENT (xmode));
+ }
/* First move what we can in the largest integer mode, then go to
successively smaller modes. */
unsigned int max_size)
{
unsigned HOST_WIDE_INT n_insns = 0;
+ enum machine_mode tmode;
- if (! SLOW_UNALIGNED_ACCESS (word_mode, align)
- || align > MOVE_MAX * BITS_PER_UNIT || align >= BIGGEST_ALIGNMENT)
- align = MOVE_MAX * BITS_PER_UNIT;
+ tmode = mode_for_size (MOVE_MAX_PIECES * BITS_PER_UNIT, MODE_INT, 1);
+ if (align >= GET_MODE_ALIGNMENT (tmode))
+ align = GET_MODE_ALIGNMENT (tmode);
+ else
+ {
+ enum machine_mode tmode, xmode;
+
+ for (tmode = GET_CLASS_NARROWEST_MODE (MODE_INT), xmode = tmode;
+ tmode != VOIDmode;
+ xmode = tmode, tmode = GET_MODE_WIDER_MODE (tmode))
+ if (GET_MODE_SIZE (tmode) > MOVE_MAX_PIECES
+ || SLOW_UNALIGNED_ACCESS (tmode, align))
+ break;
+
+ align = MAX (align, GET_MODE_ALIGNMENT (xmode));
+ }
while (max_size > 1)
{
- enum machine_mode mode = VOIDmode, tmode;
+ enum machine_mode mode = VOIDmode;
enum insn_code icode;
for (tmode = GET_CLASS_NARROWEST_MODE (MODE_INT);
if (! STORE_BY_PIECES_P (len, align))
return 0;
- if (! SLOW_UNALIGNED_ACCESS (word_mode, align)
- || align > MOVE_MAX * BITS_PER_UNIT || align >= BIGGEST_ALIGNMENT)
- align = MOVE_MAX * BITS_PER_UNIT;
+ tmode = mode_for_size (STORE_MAX_PIECES * BITS_PER_UNIT, MODE_INT, 1);
+ if (align >= GET_MODE_ALIGNMENT (tmode))
+ align = GET_MODE_ALIGNMENT (tmode);
+ else
+ {
+ enum machine_mode xmode;
+
+ for (tmode = GET_CLASS_NARROWEST_MODE (MODE_INT), xmode = tmode;
+ tmode != VOIDmode;
+ xmode = tmode, tmode = GET_MODE_WIDER_MODE (tmode))
+ if (GET_MODE_SIZE (tmode) > STORE_MAX_PIECES
+ || SLOW_UNALIGNED_ACCESS (tmode, align))
+ break;
+
+ align = MAX (align, GET_MODE_ALIGNMENT (xmode));
+ }
/* We would first store what we can in the largest integer mode, then go to
successively smaller modes. */
data->to_addr = copy_addr_to_reg (to_addr);
}
- if (! SLOW_UNALIGNED_ACCESS (word_mode, align)
- || align > MOVE_MAX * BITS_PER_UNIT || align >= BIGGEST_ALIGNMENT)
- align = MOVE_MAX * BITS_PER_UNIT;
+ tmode = mode_for_size (STORE_MAX_PIECES * BITS_PER_UNIT, MODE_INT, 1);
+ if (align >= GET_MODE_ALIGNMENT (tmode))
+ align = GET_MODE_ALIGNMENT (tmode);
+ else
+ {
+ enum machine_mode xmode;
+
+ for (tmode = GET_CLASS_NARROWEST_MODE (MODE_INT), xmode = tmode;
+ tmode != VOIDmode;
+ xmode = tmode, tmode = GET_MODE_WIDER_MODE (tmode))
+ if (GET_MODE_SIZE (tmode) > STORE_MAX_PIECES
+ || SLOW_UNALIGNED_ACCESS (tmode, align))
+ break;
+
+ align = MAX (align, GET_MODE_ALIGNMENT (xmode));
+ }
/* First store what we can in the largest integer mode, then go to
successively smaller modes. */