]>
Commit | Line | Data |
---|---|---|
08f43f9b | 1 | /* CPU specific memcpy implementations. 64 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 | |
32 | ENTRY(memcpy_z196) | |
33 | .machine "z196" | |
34 | ltgr %r4,%r4 | |
35 | je .L_Z196_4 | |
36 | aghi %r4,-1 | |
37 | lgr %r1,%r2 | |
38 | srlg %r5,%r4,8 | |
39 | ltgr %r5,%r5 | |
40 | jne .L_Z196_5 | |
41 | .L_Z196_3: | |
42 | exrl %r4,.L_Z196_14 | |
43 | .L_Z196_4: | |
44 | br %r14 | |
45 | .L_Z196_5: | |
46 | cgfi %r5,262144 # Switch to mvcle for copies >64MB | |
47 | jh memcpy_mvcle | |
48 | .L_Z196_2: | |
49 | pfd 1,768(%r3) | |
50 | pfd 2,768(%r1) | |
51 | mvc 0(256,%r1),0(%r3) | |
52 | aghi %r5,-1 | |
53 | la %r1,256(%r1) | |
54 | la %r3,256(%r3) | |
55 | jne .L_Z196_2 | |
56 | j .L_Z196_3 | |
57 | .L_Z196_14: | |
58 | mvc 0(1,%r1),0(%r3) | |
59 | END(memcpy_z196) | |
60 | ||
61 | ENTRY(memcpy_z10) | |
62 | .machine "z10" | |
63 | cgije %r4,0,.L_Z10_4 | |
64 | aghi %r4,-1 | |
65 | lgr %r1,%r2 | |
66 | srlg %r5,%r4,8 | |
67 | cgijlh %r5,0,.L_Z10_13 | |
68 | .L_Z10_3: | |
69 | exrl %r4,.L_Z10_15 | |
70 | .L_Z10_4: | |
71 | br %r14 | |
72 | .L_Z10_13: | |
73 | cgfi %r5,65535 # Switch to mvcle for copies >16MB | |
74 | jh memcpy_mvcle | |
75 | .L_Z10_12: | |
76 | pfd 1,768(%r3) | |
77 | pfd 2,768(%r1) | |
78 | mvc 0(256,%r1),0(%r3) | |
79 | la %r1,256(%r1) | |
80 | la %r3,256(%r3) | |
81 | brctg %r5,.L_Z10_12 | |
82 | j .L_Z10_3 | |
83 | .L_Z10_15: | |
84 | mvc 0(1,%r1),0(%r3) | |
85 | END(memcpy_z10) | |
86 | ||
87 | #endif | |
88 | ||
89 | #include "../memcpy.S" | |
90 | ||
4f41c682 | 91 | #if !defined SHARED || !IS_IN (libc) |
08f43f9b AK |
92 | .globl memcpy |
93 | .set memcpy,memcpy_z900 | |
94 | #endif |