Update copyright notices with scripts/update-copyrights
[glibc.git] / sysdeps / s390 / s390-32 / memset.S
blob63481a264c9aec10d7cb8a76921c2a10c36cad67
1 /* Set a block of memory to some byte value.  For IBM S390
2    Copyright (C) 2012-2014 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/>.  */
20 #include "sysdep.h"
21 #include "asm-syntax.h"
23 /* INPUT PARAMETERS
24      %r2 = address to memory area
25      %r3 = byte to fill memory with
26      %r4 = number of bytes to fill.  */
28        .text
30 #ifdef USE_MULTIARCH
31 ENTRY(memset_g5)
32 #else
33 ENTRY(memset)
34 #endif
35         .machine "g5"
36         basr    %r5,0
37 .L_G5_19:
38         ltr     %r4,%r4
39         je      .L_G5_4
40         stc     %r3,0(%r2)
41         chi     %r4,1
42         lr      %r1,%r2
43         je      .L_G5_4
44         ahi     %r4,-2
45         lr      %r3,%r4
46         srl     %r3,8
47         ltr     %r3,%r3
48         jne     .L_G5_14
49         ex      %r4,.L_G5_20-.L_G5_19(%r5)
50 .L_G5_4:
51         br      %r14
52 .L_G5_14:
53         mvc     1(256,%r1),0(%r1)
54         la      %r1,256(%r1)
55         brct    %r3,.L_G5_14
56         ex      %r4,.L_G5_20-.L_G5_19(%r5)
57         j       .L_G5_4
58 .L_G5_20:
59         mvc     1(1,%r1),0(%r1)
60 #ifdef USE_MULTIARCH
61 END(memset_g5)
62 #else
63 END(memset)
64 libc_hidden_builtin_def (memset)
65 #endif