1 /* Set a block of memory to some byte value. 32 bit S/390 version.
2 Copyright (C) 2012-2017 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 <http://www.gnu.org/licenses/>. */
21 #include "asm-syntax.h"
24 %r2 = address of memory area
25 %r3 = byte to fill memory with
26 %r4 = number of bytes to fill. */
34 .machinemode "zarch_nohighgprs"
52 jh __memset_mvcle # Switch to mvcle for >256MB
66 .machinemode "zarch_nohighgprs"
74 cgijlh %r5,0,.L_Z10_15
80 cgfi %r5,163840 # Switch to mvcle for >40MB
93 ahi %r4,2 # take back the change done by the caller
94 lr %r0,%r2 # save source address
95 lr %r1,%r3 # move pad byte to R1
97 sr %r4,%r4 # no source for MVCLE, only a pad byte
99 .L0: mvcle %r2,%r4,0(%r1) # thats it, MVCLE is your friend
101 lr %r2,%r0 # return value is source address
106 #endif /* IS_IN (libc) */
108 #include "../memset.S"
112 .set memset,__memset_default
113 #elif defined SHARED && IS_IN (libc)
115 .set __GI_memset,__memset_default