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 */
29 #define DEST RTN+RTN_SIZE
30 #define SRC DEST+PTR_SIZE
31 #define LEN SRC+PTR_SIZE
34 #if defined PIC && !defined NOT_IN_libc
38 jb HIDDEN_JUMPTARGET (__chk_fail)
41 ENTRY (BP_SYM (memmove))
45 cfi_adjust_cfa_offset (4)
49 cfi_rel_offset (edi, 0)
52 cfi_register (esi, edx)
53 CHECK_BOUNDS_BOTH_WIDE (%edi, DEST(%esp), %ecx)
54 CHECK_BOUNDS_BOTH_WIDE (%esi, SRC(%esp), %ecx)
73 RETURN_BOUNDED_POINTER (DEST(%esp))
76 cfi_adjust_cfa_offset (-4)
82 cfi_adjust_cfa_offset (4)
83 cfi_rel_offset (edi, 0)
84 cfi_register (esi, edx)
86 /* Backward copying. */
88 leal -1(%edi, %ecx), %edi
89 leal -1(%esi, %ecx), %esi
104 movl DEST(%esp), %eax
105 RETURN_BOUNDED_POINTER (DEST(%esp))
109 cfi_adjust_cfa_offset (-4)
114 END (BP_SYM (memmove))
115 libc_hidden_builtin_def (memmove)