]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysdeps/s390/s390-32/multiarch/memcpy.S
Update copyright dates with scripts/update-copyrights.
[thirdparty/glibc.git] / sysdeps / s390 / s390-32 / multiarch / memcpy.S
CommitLineData
08f43f9b 1/* CPU specific memcpy implementations. 32 bit S/390 version.
b168057a 2 Copyright (C) 2012-2015 Free Software Foundation, Inc.
08f43f9b
AK
3 This file is part of the GNU C Library.
4
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.
9
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.
14
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/>. */
18
19
20#include "sysdep.h"
21#include "asm-syntax.h"
22
23/* INPUT PARAMETERS
24 %r2 = target operands address
25 %r3 = source operands address
26 %r4 = number of bytes to copy. */
27
28 .text
29
4f41c682 30#if defined SHARED && IS_IN (libc)
08f43f9b
AK
31
32ENTRY(memcpy_z196)
33 .machine "z196"
14c996c8 34 .machinemode "zarch_nohighgprs"
08f43f9b
AK
35 llgfr %r4,%r4
36 ltgr %r4,%r4
37 je .L_Z196_4
38 aghi %r4,-1
39 lr %r1,%r2
40 srlg %r5,%r4,8
41 ltgr %r5,%r5
42 jne .L_Z196_5
43.L_Z196_3:
44 exrl %r4,.L_Z196_14
45.L_Z196_4:
46 br %r14
47.L_Z196_5:
48 cgfi %r5,262144 # Switch to mvcle for copies >64MB
49 jh memcpy_mvcle
50.L_Z196_2:
51 pfd 1,768(%r3)
52 pfd 2,768(%r1)
53 mvc 0(256,%r1),0(%r3)
54 aghi %r5,-1
55 la %r1,256(%r1)
56 la %r3,256(%r3)
57 jne .L_Z196_2
58 j .L_Z196_3
59.L_Z196_14:
60 mvc 0(1,%r1),0(%r3)
61END(memcpy_z196)
62
63ENTRY(memcpy_z10)
64 .machine "z10"
14c996c8 65 .machinemode "zarch_nohighgprs"
08f43f9b
AK
66 llgfr %r4,%r4
67 cgije %r4,0,.L_Z10_4
68 aghi %r4,-1
69 lr %r1,%r2
70 srlg %r5,%r4,8
71 cgijlh %r5,0,.L_Z10_13
72.L_Z10_3:
73 exrl %r4,.L_Z10_15
74.L_Z10_4:
75 br %r14
76.L_Z10_13:
77 cgfi %r5,65535 # Switch to mvcle for copies >16MB
78 jh memcpy_mvcle
79.L_Z10_12:
80 pfd 1,768(%r3)
81 pfd 2,768(%r1)
82 mvc 0(256,%r1),0(%r3)
83 la %r1,256(%r1)
84 la %r3,256(%r3)
85 brctg %r5,.L_Z10_12
86 j .L_Z10_3
87.L_Z10_15:
88 mvc 0(1,%r1),0(%r3)
89END(memcpy_z10)
90
91#endif
92
93#include "../memcpy.S"
94
4f41c682 95#if !defined SHARED || !IS_IN (libc)
08f43f9b
AK
96.globl memcpy
97.set memcpy,memcpy_g5
98#endif