-/* Copyright (C) 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2021 Free Software Foundation, Inc.
Contributed by Richard Henderson (rth@tamu.edu)
+ This file is part of the GNU C Library.
-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 free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
-published by the Free Software Foundation; either version 2 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.
-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
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ 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/>. */
/* Fill a block of memory with a character. Optimized for the Alpha
architecture:
.set noreorder
.text
+ .type memset, @function
+ .globl memset
+ .usepv memset, USEPV_PROF
-/* There is a problem with either gdb (as of 4.16) or gas (as of 2.7) that
- doesn't like putting the entry point for a procedure somewhere in the
- middle of the procedure descriptor. Work around this by putting the main
- loop in its own procedure descriptor. */
+ cfi_startproc
/* On entry to this basic block:
t3 == loop counter
a0 == possibly misaligned destination pointer
a1 == replicated source character */
- .ent memset_loop
.align 3
memset_loop:
- .frame sp, 0, ra, 0
- .prologue 0
-
beq t3, $tail
blbc t3, 0f # skip single store if count even
stq_u t0, 0(a0) # e0 :
ret # .. e1 :
- .end memset_loop
-
-ENTRY(memset)
- .prologue 0
+memset:
+#ifdef PROF
+ ldgp gp, 0(pv)
+ lda AT, _mcount
+ jsr AT, (AT), _mcount
+#endif
- zapnot a1, 1, a1 # e0 : zero extend input character
+ and a1, 0xff, a1 # e0 : zero extend input character
mov a0, v0 # .. e1 : move return value in place
sll a1, 8, t0 # e0 : begin replicating the char
beq a2, $done # .. e1 : early exit for zero-length store
$done: ret
- END(memset)
+ cfi_endproc
+libc_hidden_builtin_def (memset)