1 /* Optimized strcpy implementation for PowerPC476.
2 Copyright (C) 2010 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/>. */
26 r3:destination and return address
28 r10:temp destination address
30 Implementation description
31 Loop by checking 2 words at a time, with dlmzb. Check if there is a null
32 in the 2 words. If there is a null jump to end checking to determine
33 where in the last 8 bytes it is. Copy the appropriate bytes of the last
34 8 according to the null position. */
36 EALIGN (BP_SYM (strcpy), 5, 0)
89 L(last_bytes_copy_loop):
92 bdnz L(last_bytes_copy_loop)
96 blt L(last_bytes_copy)
101 L(last_bytes_copy_loop2):
104 bdnz L(last_bytes_copy_loop2)
108 END (BP_SYM (strcpy))
109 libc_hidden_builtin_def (strcpy)