1/* memcpy variant information on S/390 version.
2 Copyright (C) 2018-2022 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#if defined SHARED && defined USE_MULTIARCH && IS_IN (libc) \
20 && ! defined HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT
21# define HAVE_MEMCPY_IFUNC 1
22#else
23# define HAVE_MEMCPY_IFUNC 0
24#endif
25
26#if defined HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT
27# define MEMCPY_DEFAULT MEMCPY_Z196
28# define MEMPCPY_DEFAULT MEMPCPY_Z196
29# define HAVE_MEMCPY_Z900_G5 0
30# define HAVE_MEMCPY_Z10 0
31# define HAVE_MEMCPY_Z196 1
32#elif defined HAVE_S390_MIN_Z10_ZARCH_ASM_SUPPORT
33# define MEMCPY_DEFAULT MEMCPY_Z10
34# define MEMPCPY_DEFAULT MEMPCPY_Z10
35# define HAVE_MEMCPY_Z900_G5 0
36# define HAVE_MEMCPY_Z10 1
37# define HAVE_MEMCPY_Z196 HAVE_MEMCPY_IFUNC
38#else
39# define MEMCPY_DEFAULT MEMCPY_Z900_G5
40# define MEMPCPY_DEFAULT MEMPCPY_Z900_G5
41# define HAVE_MEMCPY_Z900_G5 1
42# define HAVE_MEMCPY_Z10 HAVE_MEMCPY_IFUNC
43# define HAVE_MEMCPY_Z196 HAVE_MEMCPY_IFUNC
44#endif
45
46#if defined SHARED && defined USE_MULTIARCH && IS_IN (libc) \
47 && ! defined HAVE_S390_MIN_ARCH13_ZARCH_ASM_SUPPORT
48# define HAVE_MEMMOVE_IFUNC 1
49#else
50# define HAVE_MEMMOVE_IFUNC 0
51#endif
52
53#ifdef HAVE_S390_VX_ASM_SUPPORT
54# define HAVE_MEMMOVE_IFUNC_AND_VX_SUPPORT HAVE_MEMMOVE_IFUNC
55#else
56# define HAVE_MEMMOVE_IFUNC_AND_VX_SUPPORT 0
57#endif
58
59#ifdef HAVE_S390_ARCH13_ASM_SUPPORT
60# define HAVE_MEMMOVE_IFUNC_AND_ARCH13_SUPPORT HAVE_MEMMOVE_IFUNC
61#else
62# define HAVE_MEMMOVE_IFUNC_AND_ARCH13_SUPPORT 0
63#endif
64
65#if defined HAVE_S390_MIN_ARCH13_ZARCH_ASM_SUPPORT
66# define MEMMOVE_DEFAULT MEMMOVE_ARCH13
67# define HAVE_MEMMOVE_C 0
68# define HAVE_MEMMOVE_Z13 0
69# define HAVE_MEMMOVE_ARCH13 1
70#elif defined HAVE_S390_MIN_Z13_ZARCH_ASM_SUPPORT
71# define MEMMOVE_DEFAULT MEMMOVE_Z13
72# define HAVE_MEMMOVE_C 0
73# define HAVE_MEMMOVE_Z13 1
74# define HAVE_MEMMOVE_ARCH13 HAVE_MEMMOVE_IFUNC_AND_ARCH13_SUPPORT
75#else
76# define MEMMOVE_DEFAULT MEMMOVE_C
77# define HAVE_MEMMOVE_C 1
78# define HAVE_MEMMOVE_Z13 HAVE_MEMMOVE_IFUNC_AND_VX_SUPPORT
79# define HAVE_MEMMOVE_ARCH13 HAVE_MEMMOVE_IFUNC_AND_ARCH13_SUPPORT
80#endif
81
82#if HAVE_MEMCPY_Z900_G5
83# define MEMCPY_Z900_G5 __memcpy_default
84# define MEMPCPY_Z900_G5 __mempcpy_default
85#else
86# define MEMCPY_Z900_G5 NULL
87# define MEMPCPY_Z900_G5 NULL
88#endif
89
90#if HAVE_MEMCPY_Z10
91# define MEMCPY_Z10 __memcpy_z10
92# define MEMPCPY_Z10 __mempcpy_z10
93#else
94# define MEMCPY_Z10 NULL
95# define MEMPCPY_Z10 NULL
96#endif
97
98#if HAVE_MEMCPY_Z196
99# define MEMCPY_Z196 __memcpy_z196
100# define MEMPCPY_Z196 __mempcpy_z196
101#else
102# define MEMCPY_Z196 NULL
103# define MEMPCPY_Z196 NULL
104#endif
105
106#if HAVE_MEMMOVE_C
107# define MEMMOVE_C __memmove_c
108#else
109# define MEMMOVE_C NULL
110#endif
111
112#if HAVE_MEMMOVE_Z13
113# define MEMMOVE_Z13 __memmove_z13
114#else
115# define MEMMOVE_Z13 NULL
116#endif
117
118#if HAVE_MEMMOVE_ARCH13
119# define MEMMOVE_ARCH13 __memmove_arch13
120#else
121# define MEMMOVE_ARCH13 NULL
122#endif
123

source code of glibc/sysdeps/s390/ifunc-memcpy.h