hjl / source-git / glibc

Forked from source-git/glibc 4 years ago
Clone

Blame sysdeps/s390/multiarch/memcmp-s390x.S

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