]>
Commit | Line | Data |
---|---|---|
08f43f9b | 1 | /* memcmp - compare two memory blocks. 32 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 = 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 | |
30 | ENTRY(memcmp_g5) | |
31 | #else | |
32 | ENTRY(memcmp) | |
33 | #endif | |
34 | .machine "g5" | |
35 | basr %r5,0 | |
36 | .L_G5_16: | |
37 | ltr %r4,%r4 | |
38 | je .L_G5_4 | |
39 | ahi %r4,-1 | |
40 | lr %r1,%r4 | |
41 | srl %r1,8 | |
42 | ltr %r1,%r1 | |
43 | jne .L_G5_12 | |
44 | ex %r4,.L_G5_17-.L_G5_16(%r5) | |
45 | .L_G5_4: | |
46 | ipm %r2 | |
47 | sll %r2,2 | |
48 | sra %r2,30 | |
49 | br %r14 | |
50 | .L_G5_12: | |
51 | clc 0(256,%r3),0(%r2) | |
52 | jne .L_G5_4 | |
53 | la %r3,256(%r3) | |
54 | la %r2,256(%r2) | |
55 | brct %r1,.L_G5_12 | |
56 | ex %r4,.L_G5_17-.L_G5_16(%r5) | |
57 | j .L_G5_4 | |
58 | .L_G5_17: | |
59 | clc 0(1,%r3),0(%r2) | |
60 | #ifdef USE_MULTIARCH | |
61 | END(memcmp_g5) | |
62 | #else | |
63 | END(memcmp) | |
64 | libc_hidden_builtin_def (memcmp) | |
65 | weak_alias(memcmp, bcmp) | |
66 | #endif |