<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - poor codegen for unaligned fixed-size memcpy/memmove"
   href="http://llvm.org/bugs/show_bug.cgi?id=21541">21541</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>poor codegen for unaligned fixed-size memcpy/memmove
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Backend: X86
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>chisophugis@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>void copy32byte(void *pDst, const void *pSrc) {                                 
  __builtin_memmove(pDst, pSrc, 32);
}


clang++ -O3 -march=btver2 -c testcopy.cpp -o test.o

generates:

__Z10copy32bytePvPKv:
0000000000000000        pushq   %rbp
0000000000000001        movq    %rsp, %rbp
0000000000000004        movq    (%rsi), %rax
0000000000000007        movq    0x8(%rsi), %rcx
000000000000000b        movq    0x10(%rsi), %rdx
000000000000000f        movq    0x18(%rsi), %rsi
0000000000000013        movq    %rsi, 0x18(%rdi)
0000000000000017        movq    %rdx, 0x10(%rdi)
000000000000001b        movq    %rcx, 0x8(%rdi)
000000000000001f        movq    %rax, (%rdi)
0000000000000022        popq    %rbp
0000000000000023        retq</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>