2012-07-12 11:04:55 +00:00
|
|
|
/* CPU specific memcmp implementations. 64 bit S/390 version.
|
2018-01-01 00:32:25 +00:00
|
|
|
Copyright (C) 2012-2018 Free Software Foundation, Inc.
|
2012-07-12 11:04:55 +00:00
|
|
|
This file is part of the GNU C Library.
|
|
|
|
|
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2.1 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
The GNU C Library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Lesser General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
|
|
License along with the GNU C Library; if not, see
|
|
|
|
<http://www.gnu.org/licenses/>. */
|
|
|
|
|
|
|
|
|
|
|
|
#include "sysdep.h"
|
|
|
|
#include "asm-syntax.h"
|
|
|
|
|
|
|
|
/* INPUT PARAMETERS
|
|
|
|
%r2 = address of first memory area
|
|
|
|
%r3 = address of second memory area
|
|
|
|
%r4 = number of bytes to compare. */
|
|
|
|
|
|
|
|
.text
|
|
|
|
|
2014-11-24 09:33:45 +00:00
|
|
|
#if IS_IN (libc)
|
2012-07-12 11:04:55 +00:00
|
|
|
|
2015-01-16 08:17:32 +00:00
|
|
|
ENTRY(__memcmp_z196)
|
2012-07-12 11:04:55 +00:00
|
|
|
.machine "z196"
|
2015-08-26 08:26:18 +00:00
|
|
|
ltgr %r4,%r4
|
|
|
|
je .L_Z196_4
|
|
|
|
aghi %r4,-1
|
|
|
|
srlg %r1,%r4,8
|
|
|
|
ltgr %r1,%r1
|
|
|
|
jne .L_Z196_2
|
2012-07-12 11:04:55 +00:00
|
|
|
.L_Z196_3:
|
2015-08-26 08:26:18 +00:00
|
|
|
exrl %r4,.L_Z196_14
|
2012-07-12 11:04:55 +00:00
|
|
|
.L_Z196_4:
|
2015-08-26 08:26:18 +00:00
|
|
|
ipm %r2
|
|
|
|
sllg %r2,%r2,34
|
|
|
|
srag %r2,%r2,62
|
|
|
|
br %r14
|
2012-07-12 11:04:55 +00:00
|
|
|
.L_Z196_17:
|
2015-08-26 08:26:18 +00:00
|
|
|
la %r3,256(%r3)
|
|
|
|
la %r2,256(%r2)
|
|
|
|
aghi %r1,-1
|
|
|
|
je .L_Z196_3
|
2012-07-12 11:04:55 +00:00
|
|
|
.L_Z196_2:
|
2015-08-26 08:26:18 +00:00
|
|
|
pfd 1,512(%r3)
|
|
|
|
pfd 1,512(%r2)
|
|
|
|
clc 0(256,%r3),0(%r2)
|
|
|
|
je .L_Z196_17
|
|
|
|
ipm %r2
|
|
|
|
sllg %r2,%r2,34
|
|
|
|
srag %r2,%r2,62
|
|
|
|
br %r14
|
2012-07-12 11:04:55 +00:00
|
|
|
.L_Z196_14:
|
2015-08-26 08:26:18 +00:00
|
|
|
clc 0(1,%r3),0(%r2)
|
2015-01-16 08:17:32 +00:00
|
|
|
END(__memcmp_z196)
|
2012-07-12 11:04:55 +00:00
|
|
|
|
2015-01-16 08:17:32 +00:00
|
|
|
ENTRY(__memcmp_z10)
|
2012-07-12 11:04:55 +00:00
|
|
|
.machine "z10"
|
2015-08-26 08:26:18 +00:00
|
|
|
ltgr %r4,%r4
|
|
|
|
je .L_Z10_4
|
|
|
|
aghi %r4,-1
|
|
|
|
srlg %r1,%r4,8
|
|
|
|
cgijlh %r1,0,.L_Z10_12
|
2012-07-12 11:04:55 +00:00
|
|
|
.L_Z10_3:
|
2015-08-26 08:26:18 +00:00
|
|
|
exrl %r4,.L_Z10_15
|
2012-07-12 11:04:55 +00:00
|
|
|
.L_Z10_4:
|
2015-08-26 08:26:18 +00:00
|
|
|
ipm %r2
|
|
|
|
sllg %r2,%r2,34
|
|
|
|
srag %r2,%r2,62
|
|
|
|
br %r14
|
2012-07-12 11:04:55 +00:00
|
|
|
.L_Z10_12:
|
2015-08-26 08:26:18 +00:00
|
|
|
pfd 1,512(%r3)
|
|
|
|
pfd 1,512(%r2)
|
|
|
|
clc 0(256,%r3),0(%r2)
|
|
|
|
jne .L_Z10_4
|
|
|
|
la %r3,256(%r3)
|
|
|
|
la %r2,256(%r2)
|
|
|
|
brctg %r1,.L_Z10_12
|
|
|
|
j .L_Z10_3
|
2012-07-12 11:04:55 +00:00
|
|
|
.L_Z10_15:
|
2015-08-26 08:26:18 +00:00
|
|
|
clc 0(1,%r3),0(%r2)
|
2015-01-16 08:17:32 +00:00
|
|
|
END(__memcmp_z10)
|
2012-07-12 11:04:55 +00:00
|
|
|
|
2015-08-26 08:26:18 +00:00
|
|
|
#endif /* IS_IN (libc) */
|
2012-07-12 11:04:55 +00:00
|
|
|
|
|
|
|
#include "../memcmp.S"
|
|
|
|
|
2014-11-24 09:33:45 +00:00
|
|
|
#if !IS_IN (libc)
|
2012-07-12 11:04:55 +00:00
|
|
|
.globl memcmp
|
2015-08-26 08:26:18 +00:00
|
|
|
.set memcmp,__memcmp_default
|
2012-07-12 11:04:55 +00:00
|
|
|
.weak bcmp
|
2015-08-26 08:26:18 +00:00
|
|
|
.set bcmp,__memcmp_default
|
2016-05-24 08:39:13 +00:00
|
|
|
#elif defined SHARED && IS_IN (libc)
|
|
|
|
.globl __GI_memcmp
|
|
|
|
.set __GI_memcmp,__memcmp_default
|
2012-07-12 11:04:55 +00:00
|
|
|
#endif
|