1 /* Copy memory block and return pointer to beginning of destination block
3 This file is part of the GNU C Library.
4 Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
5 Contributed by Ulrich Drepper <drepper@cygnus.com>, 2003.
7 The GNU C Library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or (at your option) any later version.
12 The GNU C Library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
17 You should have received a copy of the GNU Lesser General Public
18 License along with the GNU C Library; if not, write to the Free
19 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
23 #include "asm-syntax.h"
27 #define PARMS LINKAGE+4 /* one spilled register */
33 # define SRC RTN+RTN_SIZE
34 # define DEST SRC+PTR_SIZE
35 # define LEN DEST+PTR_SIZE
37 # define DEST RTN+RTN_SIZE
38 # define SRC DEST+PTR_SIZE
39 # define LEN SRC+PTR_SIZE
41 # if defined PIC && !defined NOT_IN_libc
42 ENTRY_CHK (__memmove_chk)
45 jb HIDDEN_JUMPTARGET (__chk_fail)
46 END_CHK (__memmove_chk)
50 ENTRY (BP_SYM (memmove))
54 cfi_adjust_cfa_offset (4)
58 cfi_rel_offset (edi, 0)
61 cfi_register (esi, edx)
62 CHECK_BOUNDS_BOTH_WIDE (%edi, DEST(%esp), %ecx)
63 CHECK_BOUNDS_BOTH_WIDE (%esi, SRC(%esp), %ecx)
83 RETURN_BOUNDED_POINTER (DEST(%esp))
87 cfi_adjust_cfa_offset (-4)
93 cfi_adjust_cfa_offset (4)
94 cfi_rel_offset (edi, 0)
95 cfi_register (esi, edx)
97 /* Backward copying. */
99 leal -1(%edi, %ecx), %edi
100 leal -1(%esi, %ecx), %esi
116 movl DEST(%esp), %eax
117 RETURN_BOUNDED_POINTER (DEST(%esp))
122 cfi_adjust_cfa_offset (-4)
127 END (BP_SYM (memmove))
129 libc_hidden_builtin_def (memmove)