1 /* Optimized strcpy implementation for PowerPC476.
2 Copyright (C) 2010-2015 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library. If not, see
17 <http://www.gnu.org/licenses/>. */
24 r3:destination and return address
26 r10:temp destination address
28 Implementation description
29 Loop by checking 2 words at a time, with dlmzb. Check if there is a null
30 in the 2 words. If there is a null jump to end checking to determine
31 where in the last 8 bytes it is. Copy the appropriate bytes of the last
32 8 according to the null position. */
87 L(last_bytes_copy_loop):
90 bdnz L(last_bytes_copy_loop)
94 blt L(last_bytes_copy)
99 L(last_bytes_copy_loop2):
102 bdnz L(last_bytes_copy_loop2)
107 libc_hidden_builtin_def (strcpy)