1 /* Set a block of memory to some byte value.
3 Copyright (C) 1996-2013 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, see
20 <http://www.gnu.org/licenses/>. */
30 #define SET_BLOCKS(base, offset, source) \
31 stx source, [base - offset - 0x18]; \
32 stx source, [base - offset - 0x10]; \
33 stx source, [base - offset - 0x08]; \
34 stx source, [base - offset - 0x00];
36 /* Well, memset is a lot easier to get right than bcopy... */
108 18: wr %g0, ASI_BLK_P, %asi
109 membar #StoreStore | #LoadStore
123 stda %f0, [%o0 + 0x00] %asi
126 stda %f0, [%o0 + 0x40] %asi
127 stda %f0, [%o0 + 0x80] %asi
130 10: stda %f0, [%o0 + 0x00] %asi
131 stda %f0, [%o0 + 0x40] %asi
132 stda %f0, [%o0 + 0x80] %asi
133 stda %f0, [%o0 + 0xc0] %asi
134 11: subcc %o3, 256, %o3
137 12: wr %g0, FPRS_FEF, %fprs
138 membar #StoreLoad | #StoreStore
139 9: andcc %o2, 0x78, %g5
145 jmpl %o4 + (13f - 14b), %g0
147 12: SET_BLOCKS (%o0, 0x68, %o1)
148 SET_BLOCKS (%o0, 0x48, %o1)
149 SET_BLOCKS (%o0, 0x28, %o1)
150 SET_BLOCKS (%o0, 0x08, %o1)
174 andncc %o2, 0x3f, %o3
180 libc_hidden_builtin_def (memset)
182 #define ZERO_BLOCKS(base, offset, source) \
183 stx source, [base - offset - 0x38]; \
184 stx source, [base - offset - 0x30]; \
185 stx source, [base - offset - 0x28]; \
186 stx source, [base - offset - 0x20]; \
187 stx source, [base - offset - 0x18]; \
188 stx source, [base - offset - 0x10]; \
189 stx source, [base - offset - 0x08]; \
190 stx source, [base - offset - 0x00];
206 stb %g0, [%o0 + 0x00]
209 stb %g0, [%o0 + 0x01]
210 stb %g0, [%o0 + 0x02]
229 1: andcc %o4, 16, %g0
235 1: andcc %o4, 32, %g0
237 andncc %o1, 0x3f, %o3
243 6: andncc %o1, 0x3f, %o3
245 wr %g0, ASI_BLK_P, %asi
246 membar #StoreLoad | #StoreStore | #LoadStore
261 stda %f0, [%o0 + 0x00] %asi
264 stda %f0, [%o0 + 0x40] %asi
265 stda %f0, [%o0 + 0x80] %asi
268 10: stda %f0, [%o0 + 0x00] %asi
269 stda %f0, [%o0 + 0x40] %asi
270 stda %f0, [%o0 + 0x80] %asi
271 stda %f0, [%o0 + 0xc0] %asi
272 11: subcc %o3, 256, %o3
275 12: wr %g0, FPRS_FEF, %fprs
276 membar #StoreLoad | #StoreStore
277 9: andcc %o1, 0xf8, %o2
283 jmpl %o4 + (13f - 14b), %g0
285 12: ZERO_BLOCKS (%o0, 0xc8, %g0)
286 ZERO_BLOCKS (%o0, 0x88, %g0)
287 ZERO_BLOCKS (%o0, 0x48, %g0)
288 ZERO_BLOCKS (%o0, 0x08, %g0)
314 weak_alias (__bzero, bzero)