|
Packit Service |
cc974e |
/* memcmp - compare two memory blocks. 31/64 bit S/390 version.
|
|
Packit |
6c4009 |
Copyright (C) 2012-2018 Free Software Foundation, Inc.
|
|
Packit |
6c4009 |
This file is part of the GNU C Library.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
The GNU C Library is free software; you can redistribute it and/or
|
|
Packit |
6c4009 |
modify it under the terms of the GNU Lesser General Public
|
|
Packit |
6c4009 |
License as published by the Free Software Foundation; either
|
|
Packit |
6c4009 |
version 2.1 of the License, or (at your option) any later version.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
The GNU C Library is distributed in the hope that it will be useful,
|
|
Packit |
6c4009 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
6c4009 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
6c4009 |
Lesser General Public License for more details.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
You should have received a copy of the GNU Lesser General Public
|
|
Packit |
6c4009 |
License along with the GNU C Library; if not, see
|
|
Packit |
6c4009 |
<http://www.gnu.org/licenses/>. */
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
|
|
Packit Service |
cc974e |
#include <sysdep.h>
|
|
Packit |
6c4009 |
#include "asm-syntax.h"
|
|
Packit Service |
cc974e |
#include <ifunc-memcmp.h>
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* INPUT PARAMETERS
|
|
Packit |
6c4009 |
%r2 = address of first memory area
|
|
Packit |
6c4009 |
%r3 = address of second memory area
|
|
Packit |
6c4009 |
%r4 = number of bytes to compare. */
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
.text
|
|
Packit |
6c4009 |
|
|
Packit Service |
cc974e |
#if HAVE_MEMCMP_Z900_G5
|
|
Packit Service |
cc974e |
# if defined __s390x__
|
|
Packit Service |
cc974e |
# define LTGR ltgr
|
|
Packit Service |
cc974e |
# define AGHI aghi
|
|
Packit Service |
cc974e |
# define BRCTG brctg
|
|
Packit Service |
cc974e |
# else
|
|
Packit Service |
cc974e |
# define LTGR ltr
|
|
Packit Service |
cc974e |
# define AGHI ahi
|
|
Packit Service |
cc974e |
# define BRCTG brct
|
|
Packit Service |
cc974e |
# endif /* ! defined __s390x__ */
|
|
Packit Service |
cc974e |
ENTRY(MEMCMP_Z900_G5)
|
|
Packit Service |
cc974e |
# if defined __s390x__
|
|
Packit Service |
cc974e |
.machine "z900"
|
|
Packit Service |
cc974e |
# else
|
|
Packit Service |
cc974e |
.machine "g5"
|
|
Packit Service |
cc974e |
basr %r5,0
|
|
Packit Service |
cc974e |
.L_Z900_G5_16:
|
|
Packit Service |
cc974e |
# define Z900_G5_EX_D .L_Z900_G5_15-.L_Z900_G5_16
|
|
Packit Service |
cc974e |
# endif /* ! defined __s390x__ */
|
|
Packit Service |
cc974e |
LTGR %r4,%r4
|
|
Packit Service |
cc974e |
je .L_Z900_G5_4
|
|
Packit Service |
cc974e |
AGHI %r4,-1
|
|
Packit Service |
cc974e |
# if defined __s390x__
|
|
Packit |
6c4009 |
srlg %r1,%r4,8
|
|
Packit Service |
cc974e |
larl %r5,.L_Z900_G5_15
|
|
Packit Service |
cc974e |
# define Z900_G5_EX_D 0
|
|
Packit Service |
cc974e |
# else
|
|
Packit Service |
cc974e |
lr %r1,%r4
|
|
Packit Service |
cc974e |
srl %r1,8
|
|
Packit Service |
cc974e |
# endif /* ! defined __s390x__ */
|
|
Packit Service |
cc974e |
LTGR %r1,%r1
|
|
Packit Service |
cc974e |
jne .L_Z900_G5_12
|
|
Packit Service |
cc974e |
.L_Z900_G5_3:
|
|
Packit Service |
cc974e |
ex %r4,Z900_G5_EX_D(%r5)
|
|
Packit Service |
cc974e |
.L_Z900_G5_4:
|
|
Packit |
6c4009 |
ipm %r2
|
|
Packit Service |
cc974e |
# if defined __s390x__
|
|
Packit |
6c4009 |
sllg %r2,%r2,34
|
|
Packit |
6c4009 |
srag %r2,%r2,62
|
|
Packit Service |
cc974e |
# else
|
|
Packit Service |
cc974e |
sll %r2,2
|
|
Packit Service |
cc974e |
sra %r2,30
|
|
Packit Service |
cc974e |
# endif /* ! defined __s390x__ */
|
|
Packit |
6c4009 |
br %r14
|
|
Packit Service |
cc974e |
.L_Z900_G5_12:
|
|
Packit Service |
cc974e |
clc 0(256,%r3),0(%r2)
|
|
Packit Service |
cc974e |
jne .L_Z900_G5_4
|
|
Packit |
6c4009 |
la %r3,256(%r3)
|
|
Packit |
6c4009 |
la %r2,256(%r2)
|
|
Packit Service |
cc974e |
BRCTG %r1,.L_Z900_G5_12
|
|
Packit Service |
cc974e |
j .L_Z900_G5_3
|
|
Packit Service |
cc974e |
.L_Z900_G5_15:
|
|
Packit |
6c4009 |
clc 0(1,%r3),0(%r2)
|
|
Packit Service |
cc974e |
END(MEMCMP_Z900_G5)
|
|
Packit Service |
cc974e |
# undef LTGR
|
|
Packit Service |
cc974e |
# undef AGHI
|
|
Packit Service |
cc974e |
# undef BRCTG
|
|
Packit Service |
cc974e |
#endif /* HAVE_MEMCMP_Z900_G5 */
|
|
Packit |
6c4009 |
|
|
Packit Service |
cc974e |
#if HAVE_MEMCMP_Z10
|
|
Packit Service |
cc974e |
ENTRY(MEMCMP_Z10)
|
|
Packit |
6c4009 |
.machine "z10"
|
|
Packit Service |
bae8d0 |
.machinemode "zarch_nohighgprs"
|
|
Packit Service |
bae8d0 |
# if !defined __s390x__
|
|
Packit Service |
bae8d0 |
llgfr %r4,%r4
|
|
Packit Service |
bae8d0 |
# endif /* !defined __s390x__ */
|
|
Packit |
6c4009 |
ltgr %r4,%r4
|
|
Packit |
6c4009 |
je .L_Z10_4
|
|
Packit |
6c4009 |
aghi %r4,-1
|
|
Packit |
6c4009 |
srlg %r1,%r4,8
|
|
Packit |
6c4009 |
cgijlh %r1,0,.L_Z10_12
|
|
Packit |
6c4009 |
.L_Z10_3:
|
|
Packit |
6c4009 |
exrl %r4,.L_Z10_15
|
|
Packit |
6c4009 |
.L_Z10_4:
|
|
Packit |
6c4009 |
ipm %r2
|
|
Packit |
6c4009 |
sllg %r2,%r2,34
|
|
Packit |
6c4009 |
srag %r2,%r2,62
|
|
Packit |
6c4009 |
br %r14
|
|
Packit |
6c4009 |
.L_Z10_12:
|
|
Packit |
6c4009 |
pfd 1,512(%r3)
|
|
Packit |
6c4009 |
pfd 1,512(%r2)
|
|
Packit |
6c4009 |
clc 0(256,%r3),0(%r2)
|
|
Packit |
6c4009 |
jne .L_Z10_4
|
|
Packit |
6c4009 |
la %r3,256(%r3)
|
|
Packit |
6c4009 |
la %r2,256(%r2)
|
|
Packit |
6c4009 |
brctg %r1,.L_Z10_12
|
|
Packit |
6c4009 |
j .L_Z10_3
|
|
Packit |
6c4009 |
.L_Z10_15:
|
|
Packit |
6c4009 |
clc 0(1,%r3),0(%r2)
|
|
Packit Service |
cc974e |
END(MEMCMP_Z10)
|
|
Packit Service |
cc974e |
#endif /* HAVE_MEMCMP_Z10 */
|
|
Packit |
6c4009 |
|
|
Packit Service |
cc974e |
#if HAVE_MEMCMP_Z196
|
|
Packit Service |
cc974e |
ENTRY(MEMCMP_Z196)
|
|
Packit Service |
cc974e |
.machine "z196"
|
|
Packit Service |
cc974e |
.machinemode "zarch_nohighgprs"
|
|
Packit Service |
cc974e |
# if !defined __s390x__
|
|
Packit Service |
cc974e |
llgfr %r4,%r4
|
|
Packit Service |
cc974e |
# endif /* !defined __s390x__ */
|
|
Packit Service |
cc974e |
ltgr %r4,%r4
|
|
Packit Service |
cc974e |
je .L_Z196_4
|
|
Packit Service |
cc974e |
aghi %r4,-1
|
|
Packit Service |
cc974e |
srlg %r1,%r4,8
|
|
Packit Service |
cc974e |
ltgr %r1,%r1
|
|
Packit Service |
cc974e |
jne .L_Z196_2
|
|
Packit Service |
cc974e |
.L_Z196_3:
|
|
Packit Service |
cc974e |
exrl %r4,.L_Z196_14
|
|
Packit Service |
cc974e |
.L_Z196_4:
|
|
Packit Service |
cc974e |
ipm %r2
|
|
Packit Service |
cc974e |
sllg %r2,%r2,34
|
|
Packit Service |
cc974e |
srag %r2,%r2,62
|
|
Packit Service |
cc974e |
br %r14
|
|
Packit Service |
cc974e |
.L_Z196_17:
|
|
Packit Service |
cc974e |
la %r3,256(%r3)
|
|
Packit Service |
cc974e |
la %r2,256(%r2)
|
|
Packit Service |
cc974e |
aghi %r1,-1
|
|
Packit Service |
cc974e |
je .L_Z196_3
|
|
Packit Service |
cc974e |
.L_Z196_2:
|
|
Packit Service |
cc974e |
pfd 1,512(%r3)
|
|
Packit Service |
cc974e |
pfd 1,512(%r2)
|
|
Packit Service |
cc974e |
clc 0(256,%r3),0(%r2)
|
|
Packit Service |
cc974e |
je .L_Z196_17
|
|
Packit Service |
cc974e |
ipm %r2
|
|
Packit Service |
cc974e |
sllg %r2,%r2,34
|
|
Packit Service |
cc974e |
srag %r2,%r2,62
|
|
Packit Service |
cc974e |
br %r14
|
|
Packit Service |
cc974e |
.L_Z196_14:
|
|
Packit Service |
cc974e |
clc 0(1,%r3),0(%r2)
|
|
Packit Service |
cc974e |
END(MEMCMP_Z196)
|
|
Packit Service |
cc974e |
#endif /* HAVE_MEMCMP_Z196 */
|
|
Packit |
6c4009 |
|
|
Packit Service |
cc974e |
#if ! HAVE_MEMCMP_IFUNC
|
|
Packit Service |
cc974e |
/* If we don't use ifunc, define an alias for memcmp here.
|
|
Packit Service |
cc974e |
Otherwise see sysdeps/s390/memcmp.c. */
|
|
Packit Service |
cc974e |
strong_alias (MEMCMP_DEFAULT, memcmp)
|
|
Packit Service |
cc974e |
weak_alias (memcmp, bcmp)
|
|
Packit Service |
cc974e |
#endif
|
|
Packit |
6c4009 |
|
|
Packit Service |
cc974e |
#if defined SHARED && IS_IN (libc)
|
|
Packit Service |
cc974e |
/* Defines the internal symbols.
|
|
Packit Service |
cc974e |
Compare to libc_hidden_builtin_def (memcmp) in string/memcmp.c. */
|
|
Packit Service |
cc974e |
strong_alias (MEMCMP_DEFAULT, __GI_memcmp)
|
|
Packit |
6c4009 |
#endif
|