1/* Optimized memmove for x86-64.
2 Copyright (C) 2016-2024 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
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.
9
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.
14
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 <https://www.gnu.org/licenses/>. */
18
19
20#ifdef USE_MULTIARCH
21# if !IS_IN (libc)
22# define MEMCPY_SYMBOL(p,s) memcpy
23# endif
24#else
25# if defined SHARED && IS_IN (libc)
26# define MEMCPY_SYMBOL(p,s) __memcpy
27# else
28# define MEMCPY_SYMBOL(p,s) memcpy
29# endif
30#endif
31#if !defined USE_MULTIARCH || !IS_IN (libc)
32# define MEMPCPY_SYMBOL(p,s) __mempcpy
33#endif
34
35#define MEMMOVE_CHK_SYMBOL(p,s) p
36#define MEMMOVE_SYMBOL(p,s) memmove
37
38
39#define DEFAULT_IMPL_V1 "multiarch/memmove-sse2-unaligned-erms.S"
40#define DEFAULT_IMPL_V3 "multiarch/memmove-avx-unaligned-erms.S"
41#define DEFAULT_IMPL_V4 "multiarch/memmove-evex-unaligned-erms.S"
42
43#include "isa-default-impl.h"
44
45weak_alias (__mempcpy, mempcpy)
46
47#ifndef USE_MULTIARCH
48libc_hidden_builtin_def (memmove)
49libc_hidden_builtin_def (__memmove_chk)
50libc_hidden_builtin_def (__memcpy_chk)
51libc_hidden_builtin_def (__mempcpy_chk)
52# if defined SHARED && IS_IN (libc)
53strong_alias (memmove, __memcpy)
54libc_hidden_ver (memmove, memcpy)
55# endif
56libc_hidden_def (__mempcpy)
57weak_alias (__mempcpy, mempcpy)
58libc_hidden_builtin_def (mempcpy)
59
60
61# if defined SHARED && IS_IN (libc)
62# undef memcpy
63# include <shlib-compat.h>
64versioned_symbol (libc, __memcpy, memcpy, GLIBC_2_14);
65# endif
66#endif
67

source code of glibc/sysdeps/x86_64/memmove.S