mempcpy.c 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* Multiple versions of mempcpy.
  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. #include <ifunc-memcpy.h>
  16. #if HAVE_MEMCPY_IFUNC
  17. # define mempcpy __redirect_mempcpy
  18. # define __mempcpy __redirect___mempcpy
  19. # define __NO_STRING_INLINES
  20. # define NO_MEMPCPY_STPCPY_REDIRECT
  21. # include <string.h>
  22. # undef mempcpy
  23. # undef __mempcpy
  24. # include <ifunc-resolve.h>
  25. # if HAVE_MEMCPY_Z900_G5
  26. extern __typeof (__redirect___mempcpy) MEMPCPY_Z900_G5 attribute_hidden;
  27. # endif
  28. # if HAVE_MEMCPY_Z10
  29. extern __typeof (__redirect___mempcpy) MEMPCPY_Z10 attribute_hidden;
  30. # endif
  31. # if HAVE_MEMCPY_Z196
  32. extern __typeof (__redirect___mempcpy) MEMPCPY_Z196 attribute_hidden;
  33. # endif
  34. s390_libc_ifunc_expr (__redirect___mempcpy, __mempcpy,
  35. ({
  36. s390_libc_ifunc_expr_stfle_init ();
  37. (HAVE_MEMCPY_Z196 && S390_IS_Z196 (stfle_bits))
  38. ? MEMPCPY_Z196
  39. : (HAVE_MEMCPY_Z10 && S390_IS_Z10 (stfle_bits))
  40. ? MEMPCPY_Z10
  41. : MEMPCPY_DEFAULT;
  42. })
  43. )
  44. weak_alias (__mempcpy, mempcpy);
  45. #endif