Update copyright notices with scripts/update-copyrights
[glibc.git] / sysdeps / s390 / s390-64 / multiarch / memcmp.S
blobc31d7c446c679c1e720cbb022430c8b2a973bc10
1 /* CPU specific memcmp implementations.  64 bit S/390 version.
2    Copyright (C) 2012-2014 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
30 #ifndef NOT_IN_libc
32 ENTRY(memcmp_z196)
33         .machine "z196"
34         ltgr    %r4,%r4
35         je      .L_Z196_4
36         aghi    %r4,-1
37         srlg    %r1,%r4,8
38         ltgr    %r1,%r1
39         jne     .L_Z196_2
40 .L_Z196_3:
41         exrl    %r4,.L_Z196_14
42 .L_Z196_4:
43         ipm     %r2
44         sllg    %r2,%r2,34
45         srag    %r2,%r2,62
46         br      %r14
47 .L_Z196_17:
48         la      %r3,256(%r3)
49         la      %r2,256(%r2)
50         aghi    %r1,-1
51         je      .L_Z196_3
52 .L_Z196_2:
53         pfd     1,512(%r3)
54         pfd     1,512(%r2)
55         clc     0(256,%r3),0(%r2)
56         je      .L_Z196_17
57         ipm     %r2
58         sllg    %r2,%r2,34
59         srag    %r2,%r2,62
60         br      %r14
61 .L_Z196_14:
62         clc     0(1,%r3),0(%r2)
63 END(memcmp_z196)
65 ENTRY(memcmp_z10)
66         .machine "z10"
67         ltgr    %r4,%r4
68         je      .L_Z10_4
69         aghi    %r4,-1
70         srlg    %r1,%r4,8
71         cgijlh  %r1,0,.L_Z10_12
72 .L_Z10_3:
73         exrl    %r4,.L_Z10_15
74 .L_Z10_4:
75         ipm     %r2
76         sllg    %r2,%r2,34
77         srag    %r2,%r2,62
78         br      %r14
79 .L_Z10_12:
80         pfd     1,512(%r3)
81         pfd     1,512(%r2)
82         clc     0(256,%r3),0(%r2)
83         jne     .L_Z10_4
84         la      %r3,256(%r3)
85         la      %r2,256(%r2)
86         brctg   %r1,.L_Z10_12
87         j       .L_Z10_3
88 .L_Z10_15:
89         clc     0(1,%r3),0(%r2)
90 END(memcmp_z10)
92 #endif
94 #include "../memcmp.S"
96 #ifdef NOT_IN_libc
97 .globl   memcmp
98 .set     memcmp,memcmp_z900
99 .weak    bcmp
100 .set     bcmp,memcmp_z900
101 #endif