Skip to content
Navigation Menu
Toggle navigation
Sign in
In this repository
All GitHub Enterprise
↵
Jump to
↵
No suggested jump to results
In this repository
All GitHub Enterprise
↵
Jump to
↵
In this organization
All GitHub Enterprise
↵
Jump to
↵
In this repository
All GitHub Enterprise
↵
Jump to
↵
Sign in
Reseting focus
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
git-mirror
/
glibc
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
0
Security
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security
Insights
Files
f212160
argp
assert
benchtests
bits
catgets
conf
conform
crypt
csu
ctype
debug
dirent
dlfcn
elf
gmon
gnulib
grp
gshadow
hesiod
hurd
iconv
iconvdata
include
inet
intl
io
libidn
libio
locale
localedata
login
mach
malloc
manual
math
mathvec
misc
nis
nptl
nptl_db
nscd
nss
po
posix
pwd
resolv
resource
rt
scripts
setjmp
shadow
signal
socket
soft-fp
stdio-common
stdlib
streams
string
sunrpc
sysdeps
aarch64
alpha
arm
generic
gnu
hppa
i386
ia64
ieee754
init_array
m68k
mach
microblaze
mips
nacl
nios2
nptl
posix
powerpc
pthread
s390
bits
fpu
multiarch
Makefile
ifunc-impl-list.c
ifunc-resolve.h
memccpy-c.c
memccpy-vx.S
memccpy.c
memchr-vx.S
memchr.c
rawmemchr-c.c
rawmemchr-vx.S
rawmemchr.c
stpcpy-c.c
stpcpy-vx.S
stpcpy.c
stpncpy-c.c
stpncpy-vx.S
stpncpy.c
strcat-c.c
strcat-vx.S
strcat.c
strchr-c.c
strchr-vx.S
strchr.c
strchrnul-c.c
strchrnul-vx.S
strchrnul.c
strcmp-vx.S
strcmp.c
strcpy-vx.S
strcpy.c
strcspn-c.c
strcspn-vx.S
strcspn.c
strlen-c.c
strlen-vx.S
strlen.c
strncat-c.c
strncat-vx.S
strncat.c
strncmp-c.c
strncmp-vx.S
strncmp.c
strncpy-vx.S
strncpy.c
strnlen-c.c
strnlen-vx.S
strnlen.c
strpbrk-c.c
strpbrk-vx.S
strpbrk.c
strrchr-c.c
strrchr-vx.S
strrchr.c
strspn-c.c
strspn-vx.S
strspn.c
wcpcpy-c.c
wcpcpy-vx.S
wcpcpy.c
wcpncpy-c.c
wcpncpy-vx.S
wcpncpy.c
wcscat-c.c
wcscat-vx.S
wcscat.c
wcschr-c.c
wcschr-vx.S
wcschr.c
wcschrnul-c.c
wcschrnul-vx.S
wcschrnul.c
wcscmp-c.c
wcscmp-vx.S
wcscmp.c
wcscpy-c.c
wcscpy-vx.S
wcscpy.c
wcscspn-c.c
wcscspn-vx.S
wcscspn.c
wcslen-c.c
wcslen-vx.S
wcslen.c
wcsncat-c.c
wcsncat-vx.S
wcsncat.c
wcsncmp-c.c
wcsncmp-vx.S
wcsncmp.c
wcsncpy-c.c
wcsncpy-vx.S
wcsncpy.c
wcsnlen-c.c
wcsnlen-vx.S
wcsnlen.c
wcspbrk-c.c
wcspbrk-vx.S
wcspbrk.c
wcsrchr-c.c
wcsrchr-vx.S
wcsrchr.c
wcsspn-c.c
wcsspn-vx.S
wcsspn.c
wmemchr-c.c
wmemchr-vx.S
wmemchr.c
wmemcmp-c.c
wmemcmp-vx.S
wmemcmp.c
wmemset-c.c
wmemset-vx.S
wmemset.c
nptl
s390-32
s390-64
Implies
Versions
abort-instr.h
asm-syntax.h
configure
configure.ac
dl-irel.h
dl-procinfo.c
dl-procinfo.h
dl-tls.h
ffs.c
gccframe.h
gmp-mparam.h
jmpbuf-offsets.h
jmpbuf-unwind.h
ldsodefs.h
libc-tls.c
longjmp.c
machine-gmon.h
memusage.h
preconfigure
sotruss-lib.c
stackinfo.h
sh
sparc
tile
unix
wordsize-32
wordsize-64
x86
x86_64
sysvipc
termios
time
timezone
wcsmbs
wctype
.gitattributes
.gitignore
BUGS
CONFORMANCE
COPYING
COPYING.LIB
ChangeLog
ChangeLog.1
ChangeLog.10
ChangeLog.11
ChangeLog.12
ChangeLog.13
ChangeLog.14
ChangeLog.15
ChangeLog.16
ChangeLog.17
ChangeLog.2
ChangeLog.3
ChangeLog.4
ChangeLog.5
ChangeLog.6
ChangeLog.7
ChangeLog.8
ChangeLog.9
ChangeLog.old-ports
ChangeLog.old-ports-aarch64
ChangeLog.old-ports-aix
ChangeLog.old-ports-alpha
ChangeLog.old-ports-am33
ChangeLog.old-ports-arm
ChangeLog.old-ports-cris
ChangeLog.old-ports-hppa
ChangeLog.old-ports-ia64
ChangeLog.old-ports-linux-generic
ChangeLog.old-ports-m68k
ChangeLog.old-ports-microblaze
ChangeLog.old-ports-mips
ChangeLog.old-ports-powerpc
ChangeLog.old-ports-tile
INSTALL
LICENSES
Makeconfig
Makefile
Makefile.in
Makerules
NAMESPACE
NEWS
PROJECTS
README
Rules
WUR-REPORT
abi-tags
aclocal.m4
config.h.in
config.make.in
configure
configure.ac
cppflags-iterator.mk
extra-lib.mk
extra-modules.mk
gen-locales.mk
libc-abis
o-iterator.mk
shlib-versions
test-skeleton.c
version.h
Breadcrumbs
glibc
/
sysdeps
/
s390
/
multiarch
/
wmemcmp-vx.S
Blame
Blame
Latest commit
History
History
149 lines (125 loc) · 3.79 KB
Breadcrumbs
glibc
/
sysdeps
/
s390
/
multiarch
/
wmemcmp-vx.S
Top
File metadata and controls
Code
Blame
149 lines (125 loc) · 3.79 KB
Raw
/* Vector Optimized 32/64 bit S/390 version of wmemcmp. Copyright (C) 2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) # include "sysdep.h" # include "asm-syntax.h" .text /* int wmemcmp (const wchar_t *s1, const wchar_t *s2, size_t n) Compare at most n characters of two wchar_t-arrays. Register usage: -r0=tmp -r1=number of blocks -r2=s1 -r3=s2 -r4=n -r5=current_len -v16=part of s1 -v17=part of s2 -v18=index of unequal */ ENTRY(__wmemcmp_vx) .machine "z13" .machinemode "zarch_nohighgprs" # if !defined __s390x__ llgfr %r4,%r4 # endif /* !defined __s390x__ */ clgije %r4,0,.Lend_equal /* Nothing to do if n == 0. */ /* Check range of maxlen and convert to byte-count. */ # ifdef __s390x__ tmhh %r4,49152 /* Test bit 0 or 1 of maxlen. */ lghi %r1,-4 /* Max byte-count is 18446744073709551612. */ # else tmlh %r4,49152 /* Test bit 0 or 1 of maxlen. */ llilf %r1,4294967292 /* Max byte-count is 4294967292. */ # endif /* !__s390x__ */ sllg %r4,%r4,2 /* Convert character-count to byte-count. */ locgrne %r4,%r1 /* Use max byte-count, if bit 0/1 was one. */ lghi %r5,0 /* current_len = 0. */ clgijh %r4,16,.Lgt16 .Lremaining: aghi %r4,-1 /* vstl needs highest index. */ vll %v16,%r4,0(%r2) vll %v17,%r4,0(%r3) vfenef %v18,%v16,%v17 /* Compare not equal. */ vlgvb %r1,%v18,7 /* Load unequal index or 16 if not found. */ clrj %r1,%r4,12,.Lfound2 /* r1 <= r4 -> unequal within loaded bytes. */ .Lend_equal: lghi %r2,0 br %r14 .Lfound: /* vfenezf found an unequal element or zero. This instruction compares unsigned words, but wchar_t is signed. Thus we have to compare the found element again. */ vlgvb %r1,%v18,7 /* Extract not equal byte-index. */ .Lfound2: srl %r1,2 /* And convert it to character-index. */ vlgvf %r0,%v16,0(%r1) /* Load character-values. */ vlgvf %r1,%v17,0(%r1) cr %r0,%r1 je .Lend_equal lghi %r2,1 lghi %r1,-1 locgrl %r2,%r1 br %r14 .Lgt16: clgijh %r4,64,.Lpreloop64 .Lpreloop16: srlg %r1,%r4,4 /* Split into 16byte blocks */ .Lloop16: vl %v16,0(%r5,%r2) vl %v17,0(%r5,%r3) aghi %r5,16 vfenefs %v18,%v16,%v17 /* Compare not equal. */ jno .Lfound brctg %r1,.Lloop16 /* Loop until all blocks are processed. */ llgfr %r4,%r4 nilf %r4,15 /* Get remaining bytes */ locgre %r2,%r4 ber %r14 la %r2,0(%r5,%r2) la %r3,0(%r5,%r3) j .Lremaining .Lpreloop64: srlg %r1,%r4,6 /* Split into 64byte blocks */ .Lloop64: vl %v16,0(%r5,%r2) vl %v17,0(%r5,%r3) vfenefs %v18,%v16,%v17 /* Compare not equal. */ jno .Lfound vl %v16,16(%r5,%r2) vl %v17,16(%r5,%r3) vfenefs %v18,%v16,%v17 jno .Lfound vl %v16,32(%r5,%r2) vl %v17,32(%r5,%r3) vfenefs %v18,%v16,%v17 jno .Lfound vl %v16,48(%r5,%r2) vl %v17,48(%r5,%r3) aghi %r5,64 vfenefs %v18,%v16,%v17 jno .Lfound brctg %r1,.Lloop64 /* Loop until all blocks are processed. */ llgfr %r4,%r4 nilf %r4,63 /* Get remaining bytes */ locgre %r2,%r4 ber %r14 clgijh %r4,16,.Lpreloop16 la %r2,0(%r5,%r2) la %r3,0(%r5,%r3) j .Lremaining END(__wmemcmp_vx) #endif /* HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc) */
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
You can’t perform that action at this time.