1 /* Set a block of memory to some byte value. For SUN4V Niagara-4.
2 Copyright (C) 2012-2022 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <https://www.gnu.org/licenses/>. */
21 #define ASI_BLK_INIT_QUAD_LDD_P 0xe2
25 .register %g2, #scratch
26 .register %g3, #scratch
31 ENTRY(__memset_niagara4)
48 brz,pt %g1, .Laligned8
50 1: stb %o4, [%o0 + 0x00]
55 cmp %o1, 64 + (64 - 8)
58 andcc %g1, (64 - 1), %g1
59 brz,pn %g1, .Laligned64
61 1: stx %o4, [%o0 + 0x00]
68 brnz,pn %o4, .Lnon_bzero_loop
70 1: stxa %o4, [%o0 + %g0] ASI_BLK_INIT_QUAD_LDD_P
72 stxa %o4, [%o0 + %g2] ASI_BLK_INIT_QUAD_LDD_P
78 membar #StoreStore|#StoreLoad
82 1: stx %o4, [%o0 + 0x00]
104 1: stxa %o4, [%o0 + %g0] ASI_BLK_INIT_QUAD_LDD_P
106 stxa %o4, [%o0 + %g2] ASI_BLK_INIT_QUAD_LDD_P
107 stxa %o4, [%o0 + %g3] ASI_BLK_INIT_QUAD_LDD_P
108 stxa %o4, [%o0 + %o5] ASI_BLK_INIT_QUAD_LDD_P
110 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
116 ba,a,pt %icc, .Lpostloop
117 END(__memset_niagara4)