mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-09 02:40:08 +00:00
5a82c74822
Also, change sources.redhat.com to sourceware.org. This patch was automatically generated by running the following shell script, which uses GNU sed, and which avoids modifying files imported from upstream: sed -ri ' s,(http|ftp)(://(.*\.)?(gnu|fsf|sourceware)\.org($|[^.]|\.[^a-z])),https\2,g s,(http|ftp)(://(.*\.)?)sources\.redhat\.com($|[^.]|\.[^a-z]),https\2sourceware.org\4,g ' \ $(find $(git ls-files) -prune -type f \ ! -name '*.po' \ ! -name 'ChangeLog*' \ ! -path COPYING ! -path COPYING.LIB \ ! -path manual/fdl-1.3.texi ! -path manual/lgpl-2.1.texi \ ! -path manual/texinfo.tex ! -path scripts/config.guess \ ! -path scripts/config.sub ! -path scripts/install-sh \ ! -path scripts/mkinstalldirs ! -path scripts/move-if-change \ ! -path INSTALL ! -path locale/programs/charmap-kw.h \ ! -path po/libc.pot ! -path sysdeps/gnu/errlist.c \ ! '(' -name configure \ -execdir test -f configure.ac -o -f configure.in ';' ')' \ ! '(' -name preconfigure \ -execdir test -f preconfigure.ac ';' ')' \ -print) and then by running 'make dist-prepare' to regenerate files built from the altered files, and then executing the following to cleanup: chmod a+x sysdeps/unix/sysv/linux/riscv/configure # Omit irrelevant whitespace and comment-only changes, # perhaps from a slightly-different Autoconf version. git checkout -f \ sysdeps/csky/configure \ sysdeps/hppa/configure \ sysdeps/riscv/configure \ sysdeps/unix/sysv/linux/csky/configure # Omit changes that caused a pre-commit check to fail like this: # remote: *** error: sysdeps/powerpc/powerpc64/ppc-mcount.S: trailing lines git checkout -f \ sysdeps/powerpc/powerpc64/ppc-mcount.S \ sysdeps/unix/sysv/linux/s390/s390-64/syscall.S # Omit change that caused a pre-commit check to fail like this: # remote: *** error: sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S: last line does not end in newline git checkout -f sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S
125 lines
3.1 KiB
ArmAsm
125 lines
3.1 KiB
ArmAsm
/* Set a block of memory to some byte value. For SUN4V Niagara-4.
|
|
Copyright (C) 2012-2019 Free Software Foundation, Inc.
|
|
This file is part of the GNU C Library.
|
|
Contributed by David S. Miller (davem@davemloft.net)
|
|
|
|
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
|
|
<https://www.gnu.org/licenses/>. */
|
|
|
|
#include <sysdep.h>
|
|
|
|
#define ASI_BLK_INIT_QUAD_LDD_P 0xe2
|
|
|
|
#if IS_IN (libc)
|
|
|
|
.register %g2, #scratch
|
|
.register %g3, #scratch
|
|
|
|
.text
|
|
.align 32
|
|
|
|
ENTRY(__memset_niagara4)
|
|
andcc %o1, 0xff, %o4
|
|
be,pt %icc, 1f
|
|
mov %o2, %o1
|
|
sllx %o4, 8, %g1
|
|
or %g1, %o4, %o2
|
|
sllx %o2, 16, %g1
|
|
or %g1, %o2, %o2
|
|
sllx %o2, 32, %g1
|
|
ba,pt %icc, 1f
|
|
or %g1, %o2, %o4
|
|
END(__memset_niagara4)
|
|
|
|
.align 32
|
|
ENTRY(__bzero_niagara4)
|
|
clr %o4
|
|
1: cmp %o1, 16
|
|
ble %icc, .Ltiny
|
|
mov %o0, %o3
|
|
sub %g0, %o0, %g1
|
|
and %g1, 0x7, %g1
|
|
brz,pt %g1, .Laligned8
|
|
sub %o1, %g1, %o1
|
|
1: stb %o4, [%o0 + 0x00]
|
|
subcc %g1, 1, %g1
|
|
bne,pt %icc, 1b
|
|
add %o0, 1, %o0
|
|
.Laligned8:
|
|
cmp %o1, 64 + (64 - 8)
|
|
ble .Lmedium
|
|
sub %g0, %o0, %g1
|
|
andcc %g1, (64 - 1), %g1
|
|
brz,pn %g1, .Laligned64
|
|
sub %o1, %g1, %o1
|
|
1: stx %o4, [%o0 + 0x00]
|
|
subcc %g1, 8, %g1
|
|
bne,pt %icc, 1b
|
|
add %o0, 0x8, %o0
|
|
.Laligned64:
|
|
andn %o1, 64 - 1, %g1
|
|
sub %o1, %g1, %o1
|
|
brnz,pn %o4, .Lnon_bzero_loop
|
|
mov 0x20, %g2
|
|
1: stxa %o4, [%o0 + %g0] ASI_BLK_INIT_QUAD_LDD_P
|
|
subcc %g1, 0x40, %g1
|
|
stxa %o4, [%o0 + %g2] ASI_BLK_INIT_QUAD_LDD_P
|
|
bne,pt %icc, 1b
|
|
add %o0, 0x40, %o0
|
|
.Lpostloop:
|
|
cmp %o1, 8
|
|
bl,pn %icc, .Ltiny
|
|
membar #StoreStore|#StoreLoad
|
|
.Lmedium:
|
|
andn %o1, 0x7, %g1
|
|
sub %o1, %g1, %o1
|
|
1: stx %o4, [%o0 + 0x00]
|
|
subcc %g1, 0x8, %g1
|
|
bne,pt %icc, 1b
|
|
add %o0, 0x08, %o0
|
|
andcc %o1, 0x4, %g1
|
|
be,pt %icc, .Ltiny
|
|
sub %o1, %g1, %o1
|
|
stw %o4, [%o0 + 0x00]
|
|
add %o0, 0x4, %o0
|
|
.Ltiny:
|
|
cmp %o1, 0
|
|
be,pn %icc, .Lexit
|
|
1: subcc %o1, 1, %o1
|
|
stb %o4, [%o0 + 0x00]
|
|
bne,pt %icc, 1b
|
|
add %o0, 1, %o0
|
|
.Lexit:
|
|
retl
|
|
mov %o3, %o0
|
|
.Lnon_bzero_loop:
|
|
mov 0x08, %g3
|
|
mov 0x28, %o5
|
|
1: stxa %o4, [%o0 + %g0] ASI_BLK_INIT_QUAD_LDD_P
|
|
subcc %g1, 0x40, %g1
|
|
stxa %o4, [%o0 + %g2] ASI_BLK_INIT_QUAD_LDD_P
|
|
stxa %o4, [%o0 + %g3] ASI_BLK_INIT_QUAD_LDD_P
|
|
stxa %o4, [%o0 + %o5] ASI_BLK_INIT_QUAD_LDD_P
|
|
add %o0, 0x10, %o0
|
|
stxa %o4, [%o0 + %g0] ASI_BLK_INIT_QUAD_LDD_P
|
|
stxa %o4, [%o0 + %g2] ASI_BLK_INIT_QUAD_LDD_P
|
|
stxa %o4, [%o0 + %g3] ASI_BLK_INIT_QUAD_LDD_P
|
|
stxa %o4, [%o0 + %o5] ASI_BLK_INIT_QUAD_LDD_P
|
|
bne,pt %icc, 1b
|
|
add %o0, 0x30, %o0
|
|
ba,a,pt %icc, .Lpostloop
|
|
END(__bzero_niagara4)
|
|
|
|
#endif
|