]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysdeps/s390/s390-64/memcmp.S
Update copyright dates with scripts/update-copyrights.
[thirdparty/glibc.git] / sysdeps / s390 / s390-64 / memcmp.S
CommitLineData
08f43f9b 1/* memcmp - compare two memory blocks. 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
56e7d3ad 20#include <sysdep.h>
08f43f9b
AK
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#ifdef USE_MULTIARCH
30ENTRY(memcmp_z900)
31#else
32ENTRY(memcmp)
33#endif
34 .machine "z900"
35 ltgr %r4,%r4
36 je .L_Z900_4
37 aghi %r4,-1
38 srlg %r1,%r4,8
39 ltgr %r1,%r1
40 jne .L_Z900_12
41.L_Z900_3:
42 larl %r1,.L_Z900_15
43 ex %r4,0(%r1)
44.L_Z900_4:
45 ipm %r2
46 sllg %r2,%r2,34
47 srag %r2,%r2,62
48 br %r14
49.L_Z900_12:
50 clc 0(256,%r3),0(%r2)
51 jne .L_Z900_4
52 la %r3,256(%r3)
53 la %r2,256(%r2)
54 brctg %r1,.L_Z900_12
55 j .L_Z900_3
56.L_Z900_15:
57 clc 0(1,%r3),0(%r2)
58#ifdef USE_MULTIARCH
59END(memcmp_z900)
60#else
61END(memcmp)
62libc_hidden_builtin_def (memcmp)
63weak_alias (memcmp, bcmp)
64#endif