]> git.ipfire.org Git - thirdparty/glibc.git/blob - sysdeps/s390/s390-32/multiarch/memcmp.S
Update copyright dates with scripts/update-copyrights.
[thirdparty/glibc.git] / sysdeps / s390 / s390-32 / multiarch / memcmp.S
1 /* CPU specific memcmp implementations. 32 bit S/390 version.
2 Copyright (C) 2012-2015 Free Software Foundation, Inc.
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 = address of first memory area
25 %r3 = address of second memory area
26 %r4 = number of bytes to compare. */
27
28 .text
29
30 #if IS_IN (libc)
31
32 ENTRY(memcmp_z196)
33 .machine "z196"
34 .machinemode "zarch_nohighgprs"
35 ltr %r4,%r4
36 je .L_Z196_4
37 ahi %r4,-1
38 srlk %r1,%r4,8
39 ltr %r1,%r1
40 jne .L_Z196_2
41 .L_Z196_3:
42 exrl %r4,.L_Z196_14
43 .L_Z196_4:
44 ipm %r2
45 sll %r2,2
46 sra %r2,30
47 br %r14
48 .L_Z196_17:
49 la %r3,256(%r3)
50 la %r2,256(%r2)
51 ahi %r1,-1
52 je .L_Z196_3
53 .L_Z196_2:
54 pfd 1,512(%r3)
55 pfd 1,512(%r2)
56 clc 0(256,%r3),0(%r2)
57 je .L_Z196_17
58 ipm %r2
59 sll %r2,2
60 sra %r2,30
61 br %r14
62 .L_Z196_14:
63 clc 0(1,%r3),0(%r2)
64 END(memcmp_z196)
65
66 ENTRY(memcmp_z10)
67 .machine "z10"
68 .machinemode "zarch_nohighgprs"
69 ltr %r4,%r4
70 je .L_Z10_4
71 ahi %r4,-1
72 lr %r1,%r4
73 srl %r1,8
74 cijlh %r1,0,.L_Z10_12
75 .L_Z10_3:
76 exrl %r4,.L_Z10_15
77 .L_Z10_4:
78 ipm %r2
79 sll %r2,2
80 sra %r2,30
81 br %r14
82 .L_Z10_12:
83 pfd 1,512(%r3)
84 pfd 1,512(%r2)
85 clc 0(256,%r3),0(%r2)
86 jne .L_Z10_4
87 la %r3,256(%r3)
88 la %r2,256(%r2)
89 brct %r1,.L_Z10_12
90 j .L_Z10_3
91 .L_Z10_15:
92 clc 0(1,%r3),0(%r2)
93 END(memcmp_z10)
94
95 #endif
96
97 #include "../memcmp.S"
98
99 #if !IS_IN (libc)
100 .globl memcmp
101 .set memcmp,memcmp_g5
102 .weak bcmp
103 .set bcmp,memcmp_g5
104 #endif