1 #------------------------------------------------------------------------------
3 # Copyright (c) 2006, Intel Corporation
4 # All rights reserved. This program and the accompanying materials
5 # are licensed and made available under the terms and conditions of the BSD License
6 # which accompanies this distribution. The full text of the license may be found at
7 # http://opensource.org/licenses/bsd-license.php
9 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
22 #------------------------------------------------------------------------------
29 #------------------------------------------------------------------------------
32 # IN VOID *Destination,
36 #------------------------------------------------------------------------------
37 .global _InternalMemCopyMem
41 movl 16(%esp), %esi # esi <- Source
42 movl 12(%esp), %edi # edi <- Destination
43 movl 20(%esp), %edx # edx <- Count
44 leal -1(%edi,%edx,), %eax # eax <- End of Destination
47 cmpl %esi, %eax # Overlapped?
48 jae @CopyBackward # Copy backward if overlapped
52 andl $7, %ecx # ecx + esi aligns on 8-byte boundary
56 subl %ecx, %edx # edx <- remaining bytes to copy
62 shrl $3, %ecx # ecx <- # of Qwords to copy
66 movq %mm0, (%esp) # save mm0
74 movq (%esp), %mm0 # restore mm0
75 popl %ecx # stack cleanup
76 popl %ecx # stack cleanup
79 movl %eax, %edi # edi <- Last byte in Destination
80 leal -1(%esi,%edx,), %esi # esi <- Last byte in Source