memmove.S 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /* Optimized memmove for x86-64.
  2. Copyright (C) 2016-2026 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, see
  14. <https://www.gnu.org/licenses/>. */
  15. #ifdef USE_MULTIARCH
  16. # if !IS_IN (libc)
  17. # define MEMCPY_SYMBOL(p,s) memcpy
  18. # endif
  19. #else
  20. # if defined SHARED && IS_IN (libc)
  21. # define MEMCPY_SYMBOL(p,s) __memcpy
  22. # else
  23. # define MEMCPY_SYMBOL(p,s) memcpy
  24. # endif
  25. #endif
  26. #if !defined USE_MULTIARCH || !IS_IN (libc)
  27. # define MEMPCPY_SYMBOL(p,s) __mempcpy
  28. #endif
  29. #define MEMMOVE_CHK_SYMBOL(p,s) p
  30. #define MEMMOVE_SYMBOL(p,s) memmove
  31. #define DEFAULT_IMPL_V1 "multiarch/memmove-sse2-unaligned-erms.S"
  32. #define DEFAULT_IMPL_V3 "multiarch/memmove-avx-unaligned-erms.S"
  33. #define DEFAULT_IMPL_V4 "multiarch/memmove-evex-unaligned-erms.S"
  34. #include "isa-default-impl.h"
  35. weak_alias (__mempcpy, mempcpy)
  36. #ifndef USE_MULTIARCH
  37. libc_hidden_builtin_def (memmove)
  38. libc_hidden_builtin_def (__memmove_chk)
  39. libc_hidden_builtin_def (__memcpy_chk)
  40. libc_hidden_builtin_def (__mempcpy_chk)
  41. # if defined SHARED && IS_IN (libc)
  42. strong_alias (memmove, __memcpy)
  43. libc_hidden_ver (memmove, memcpy)
  44. # endif
  45. libc_hidden_def (__mempcpy)
  46. weak_alias (__mempcpy, mempcpy)
  47. libc_hidden_builtin_def (mempcpy)
  48. # if defined SHARED && IS_IN (libc)
  49. # undef memcpy
  50. # include <shlib-compat.h>
  51. versioned_symbol (libc, __memcpy, memcpy, GLIBC_2_14);
  52. # endif
  53. #endif