[Bug 207422] sys/amd64/amd64/support.S mempcy does not return dest

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Mon Feb 22 20:48:54 UTC 2016


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=207422

            Bug ID: 207422
           Summary: sys/amd64/amd64/support.S mempcy does not return dest
           Product: Base System
           Version: 11.0-CURRENT
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: kern
          Assignee: freebsd-bugs at FreeBSD.org
          Reporter: novice at techie.com
                CC: freebsd-amd64 at FreeBSD.org
                CC: freebsd-amd64 at FreeBSD.org

I've checked the i386 and arm paths, and they appear to return dest in memcpy.
This is consistent with libc version of memcpy. For some reason, the amd64
version does not. Shouldn't we do something like:

ENTRY(memcpy)
        PUSH_FRAME_POINTER
        movq    %rdi,%rax                       /* return dst pointer */
        movq    %rdx,%rcx
        shrq    $3,%rcx                         /* copy by 64-bit words */
        cld                                     /* copy forwards */
        rep
        movsq
        movq    %rdx,%rcx
        andq    $7,%rcx                         /* any bytes left? */
        rep
        movsb
        POP_FRAME_POINTER
        ret
END(memcpy)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the freebsd-amd64 mailing list