1 ;------------------------------------------------------------------------------
3 ; CopyMem() worker for ARM
5 ; This file started out as C code that did 64 bit moves if the buffer was
6 ; 32-bit aligned, else it does a byte copy. It also does a byte copy for
7 ; any trailing bytes. Update using VSTM/SLDM to do 128 byte copies.
9 ; Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
10 ; This program and the accompanying materials
11 ; are licensed and made available under the terms and conditions of the BSD License
12 ; which accompanies this distribution. The full text of the license may be found at
13 ; http://opensource.org/licenses/bsd-license.php
15 ; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
16 ; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 ;------------------------------------------------------------------------------
21 Copy Length bytes from Source to Destination. Overlap is OK.
25 @param Destination Target of copy
26 @param Source Place to copy from
27 @param Length Number of bytes to copy
35 OUT VOID *DestinationBuffer,
36 IN CONST VOID *SourceBuffer,
40 \s\sEXPORT InternalMemCopyMem
42 \s\sAREA AsmMemStuff, CODE, READONLY
45 \s\sstmfd\s\ssp!, {r4, r9, lr}
58 \s\sandhi\s\sr0, r3, #1
74 \s\sldrd\s\sr2, [lr, #-8]!
77 \s\sstrd\s\sr2, [r9, #-8]!
84 \s\sldrb\s\sr3, [r3, #0]\s\s
89 \s\sstrb\s\sr3, [r2, #0]
93 \s\sldrb\s\sr3, [lr], #1\s\s
95 \s\sstrb\s\sr3, [r9], #1
102 \s\ssub\s\sip, ip, #128 // 32
103 \s\scmp\s\sip, #127 // 31
104 \s\svldm lr!, {d0-d15}
107 \s\svstm r9!, {d0-d15}
112 \s\sldmfd\s\ssp!, {r4, r9, pc}