1 /* memcmp - compare two memory blocks. 31/64 bit S/390 version.
2 Copyright (C) 2012-2020 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
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.
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.
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/>. */
21 #include "asm-syntax.h"
22 #include <ifunc-memcmp.h>
25 %r2 = address of first memory area
26 %r3 = address of second memory area
27 %r4 = number of bytes to compare. */
31 #if HAVE_MEMCMP_Z900_G5
32 # if defined __s390x__
40 # endif /* ! defined __s390x__ */
42 # if defined __s390x__
48 # define Z900_G5_EX_D .L_Z900_G5_15-.L_Z900_G5_16
49 # endif /* ! defined __s390x__ */
53 # if defined __s390x__
55 larl %r5,.L_Z900_G5_15
56 # define Z900_G5_EX_D 0
60 # endif /* ! defined __s390x__ */
64 ex %r4,Z900_G5_EX_D(%r5)
67 # if defined __s390x__
73 # endif /* ! defined __s390x__ */
80 BRCTG %r1,.L_Z900_G5_12
88 #endif /* HAVE_MEMCMP_Z900_G5 */
93 .machinemode "zarch_nohighgprs"
94 # if !defined __s390x__
96 # endif /* !defined __s390x__ */
101 cgijlh %r1,0,.L_Z10_12
112 clc 0(256,%r3),0(%r2)
121 #endif /* HAVE_MEMCMP_Z10 */
126 .machinemode "zarch_nohighgprs"
127 # if !defined __s390x__
129 # endif /* !defined __s390x__ */
151 clc 0(256,%r3),0(%r2)
160 #endif /* HAVE_MEMCMP_Z196 */
162 #if ! HAVE_MEMCMP_IFUNC
163 /* If we don't use ifunc, define an alias for memcmp here.
164 Otherwise see sysdeps/s390/memcmp.c. */
165 strong_alias (MEMCMP_DEFAULT, memcmp)
166 weak_alias (memcmp, bcmp)
169 #if defined SHARED && IS_IN (libc)
170 /* Defines the internal symbols.
171 Compare to libc_hidden_builtin_def (memcmp) in string/memcmp.c. */
172 strong_alias (MEMCMP_DEFAULT, __GI_memcmp)