if (!issetmem)
srcreg = ix86_copy_addr_to_reg (XEXP (src, 0));
+ bool aligned_dstmem = false;
+ unsigned int nunits = issetmem ? STORE_MAX_PIECES : MOVE_MAX;
+ bool single_insn_p = count && count <= nunits;
+ if (single_insn_p)
+ {
+ /* If it can be done with a single instruction, use vector
+ instruction and don't align destination. */
+ alg = vector_loop;
+ noalign = true;
+ dynamic_check = -1;
+ }
+
unroll_factor = 1;
move_mode = word_mode;
- int nunits;
switch (alg)
{
case libcall:
need_zero_guard = true;
unroll_factor = 4;
/* Get the vector mode to move STORE_MAX_PIECES/MOVE_MAX bytes. */
- nunits = issetmem ? STORE_MAX_PIECES : MOVE_MAX;
nunits /= GET_MODE_SIZE (word_mode);
if (nunits > 1)
{
}
gcc_assert (desired_align >= 1 && align >= 1);
- /* Misaligned move sequences handle both prologue and epilogue at once.
- Default code generation results in a smaller code for large alignments
- and also avoids redundant job when sizes are known precisely. */
- misaligned_prologue_used
- = (TARGET_MISALIGNED_MOVE_STRING_PRO_EPILOGUES
- && MAX (desired_align, epilogue_size_needed) <= 32
- && desired_align <= epilogue_size_needed
- && ((desired_align > align && !align_bytes)
- || (!count && epilogue_size_needed > 1)));
-
- /* Destination is aligned after the misaligned prologue. */
- bool aligned_dstmem = misaligned_prologue_used;
-
- if (noalign && !misaligned_prologue_used)
- {
- /* Also use misaligned prologue if alignment isn't needed and
- destination isn't aligned. Since alignment isn't needed,
- the destination after prologue won't be aligned. */
- aligned_dstmem = (GET_MODE_ALIGNMENT (move_mode)
- <= MEM_ALIGN (dst));
- if (!aligned_dstmem)
- misaligned_prologue_used = true;
+ if (!single_insn_p)
+ {
+ /* Misaligned move sequences handle both prologue and epilogue
+ at once. Default code generation results in a smaller code
+ for large alignments and also avoids redundant job when sizes
+ are known precisely. */
+ misaligned_prologue_used
+ = (TARGET_MISALIGNED_MOVE_STRING_PRO_EPILOGUES
+ && MAX (desired_align, epilogue_size_needed) <= 32
+ && desired_align <= epilogue_size_needed
+ && ((desired_align > align && !align_bytes)
+ || (!count && epilogue_size_needed > 1)));
+
+ /* Destination is aligned after the misaligned prologue. */
+ aligned_dstmem = misaligned_prologue_used;
+
+ if (noalign && !misaligned_prologue_used)
+ {
+ /* Also use misaligned prologue if alignment isn't needed and
+ destination isn't aligned. Since alignment isn't needed,
+ the destination after prologue won't be aligned. */
+ aligned_dstmem = (GET_MODE_ALIGNMENT (move_mode)
+ <= MEM_ALIGN (dst));
+ if (!aligned_dstmem)
+ misaligned_prologue_used = true;
+ }
}
/* Do the cheap promotion to allow better CSE across the