Update copyright dates with scripts/update-copyrights.
[glibc.git] / sysdeps / s390 / s390-64 / memcmp.S
blob327d7fab38a6b4ec90a8f581078ee437390cab6b
1 /* memcmp - compare two memory blocks.  64 bit S/390 version.
2    Copyright (C) 2012-2015 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 of first memory area
25      %r3 = address of second memory area
26      %r4 = number of bytes to compare.  */
28        .text
29 #ifdef USE_MULTIARCH
30 ENTRY(memcmp_z900)
31 #else
32 ENTRY(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
59 END(memcmp_z900)
60 #else
61 END(memcmp)
62 libc_hidden_builtin_def (memcmp)
63 weak_alias (memcmp, bcmp)
64 #endif