[LLVMbugs] [Bug 21541] New: poor codegen for unaligned fixed-size memcpy/memmove

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Nov 11 21:56:14 PST 2014


http://llvm.org/bugs/show_bug.cgi?id=21541

            Bug ID: 21541
           Summary: poor codegen for unaligned fixed-size memcpy/memmove
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: chisophugis at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

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

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20141112/4ac22529/attachment.html>


More information about the llvm-bugs mailing list