1 /* Set a block of memory to some byte value. For SUN4V Niagara-4.
2 Copyright (C) 2012-2015 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4 Contributed by David S. Miller (davem@davemloft.net)
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library; if not, see
18 <http://www.gnu.org/licenses/>. */
22 #define ASI_BLK_INIT_QUAD_LDD_P 0xe2
26 .register %g2, #scratch
27 .register %g3, #scratch
32 ENTRY(__memset_niagara4)
43 END(__memset_niagara4)
46 ENTRY(__bzero_niagara4)
53 brz,pt %g1, .Laligned8
55 1: stb %o4, [%o0 + 0x00]
60 cmp %o1, 64 + (64 - 8)
63 andcc %g1, (64 - 1), %g1
64 brz,pn %g1, .Laligned64
66 1: stx %o4, [%o0 + 0x00]
73 brnz,pn %o4, .Lnon_bzero_loop
75 1: stxa %o4, [%o0 + %g0] ASI_BLK_INIT_QUAD_LDD_P
77 stxa %o4, [%o0 + %g2] ASI_BLK_INIT_QUAD_LDD_P
83 membar #StoreStore|#StoreLoad
87 1: stx %o4, [%o0 + 0x00]
100 stb %o4, [%o0 + 0x00]
109 1: stxa %o4, [%o0 + %g0] ASI_BLK_INIT_QUAD_LDD_P
111 stxa %o4, [%o0 + %g2] ASI_BLK_INIT_QUAD_LDD_P
112 stxa %o4, [%o0 + %g3] ASI_BLK_INIT_QUAD_LDD_P
113 stxa %o4, [%o0 + %o5] ASI_BLK_INIT_QUAD_LDD_P
115 stxa %o4, [%o0 + %g0] ASI_BLK_INIT_QUAD_LDD_P
116 stxa %o4, [%o0 + %g2] ASI_BLK_INIT_QUAD_LDD_P
117 stxa %o4, [%o0 + %g3] ASI_BLK_INIT_QUAD_LDD_P
118 stxa %o4, [%o0 + %o5] ASI_BLK_INIT_QUAD_LDD_P
121 ba,a,pt %icc, .Lpostloop
122 END(__bzero_niagara4)