1 /* Set a block of memory to some byte value.
3 Copyright (C) 1996, 97, 98, 99, 2003 Free Software Foundation, Inc.
4 This file is part of the GNU C Library.
5 Contributed by David S. Miller (davem@caip.rutgers.edu) and
6 Jakub Jelinek (jj@ultra.linux.cz).
8 The GNU C Library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2.1 of the License, or (at your option) any later version.
13 The GNU C Library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
18 You should have received a copy of the GNU Lesser General Public
19 License along with the GNU C Library; if not, write to the Free
20 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
31 #define SET_BLOCKS(base, offset, source) \
32 stx source, [base - offset - 0x18]; \
33 stx source, [base - offset - 0x10]; \
34 stx source, [base - offset - 0x08]; \
35 stx source, [base - offset - 0x00];
37 /* Well, memset is a lot easier to get right than bcopy... */
109 18: wr %g0, ASI_BLK_P, %asi
110 membar #StoreStore | #LoadStore
124 stda %f0, [%o0 + 0x00] %asi
127 stda %f0, [%o0 + 0x40] %asi
128 stda %f0, [%o0 + 0x80] %asi
131 10: stda %f0, [%o0 + 0x00] %asi
132 stda %f0, [%o0 + 0x40] %asi
133 stda %f0, [%o0 + 0x80] %asi
134 stda %f0, [%o0 + 0xc0] %asi
135 11: subcc %o3, 256, %o3
138 12: wr %g0, FPRS_FEF, %fprs
139 membar #StoreLoad | #StoreStore
140 9: andcc %o2, 0x78, %g5
146 jmpl %o4 + (13f - 14b), %g0
148 12: SET_BLOCKS (%o0, 0x68, %o1)
149 SET_BLOCKS (%o0, 0x48, %o1)
150 SET_BLOCKS (%o0, 0x28, %o1)
151 SET_BLOCKS (%o0, 0x08, %o1)
175 andncc %o2, 0x3f, %o3
181 libc_hidden_builtin_def (memset)
183 #define ZERO_BLOCKS(base, offset, source) \
184 stx source, [base - offset - 0x38]; \
185 stx source, [base - offset - 0x30]; \
186 stx source, [base - offset - 0x28]; \
187 stx source, [base - offset - 0x20]; \
188 stx source, [base - offset - 0x18]; \
189 stx source, [base - offset - 0x10]; \
190 stx source, [base - offset - 0x08]; \
191 stx source, [base - offset - 0x00];
207 stb %g0, [%o0 + 0x00]
210 stb %g0, [%o0 + 0x01]
211 stb %g0, [%o0 + 0x02]
230 1: andcc %o4, 16, %g0
236 1: andcc %o4, 32, %g0
238 andncc %o1, 0x3f, %o3
244 6: andncc %o1, 0x3f, %o3
246 wr %g0, ASI_BLK_P, %asi
247 membar #StoreLoad | #StoreStore | #LoadStore
262 stda %f0, [%o0 + 0x00] %asi
265 stda %f0, [%o0 + 0x40] %asi
266 stda %f0, [%o0 + 0x80] %asi
269 10: stda %f0, [%o0 + 0x00] %asi
270 stda %f0, [%o0 + 0x40] %asi
271 stda %f0, [%o0 + 0x80] %asi
272 stda %f0, [%o0 + 0xc0] %asi
273 11: subcc %o3, 256, %o3
276 12: wr %g0, FPRS_FEF, %fprs
277 membar #StoreLoad | #StoreStore
278 9: andcc %o1, 0xf8, %o2
284 jmpl %o4 + (13f - 14b), %g0
286 12: ZERO_BLOCKS (%o0, 0xc8, %g0)
287 ZERO_BLOCKS (%o0, 0x88, %g0)
288 ZERO_BLOCKS (%o0, 0x48, %g0)
289 ZERO_BLOCKS (%o0, 0x08, %g0)
315 weak_alias (__bzero, bzero)