Blame sysdeps/s390/memmove.c

Packit Service c4ca6d
/* Multiple versions of memmove.
Packit Service c4ca6d
   Copyright (C) 2016-2018 Free Software Foundation, Inc.
Packit Service c4ca6d
   This file is part of the GNU C Library.
Packit Service c4ca6d
Packit Service c4ca6d
   The GNU C Library is free software; you can redistribute it and/or
Packit Service c4ca6d
   modify it under the terms of the GNU Lesser General Public
Packit Service c4ca6d
   License as published by the Free Software Foundation; either
Packit Service c4ca6d
   version 2.1 of the License, or (at your option) any later version.
Packit Service c4ca6d
Packit Service c4ca6d
   The GNU C Library is distributed in the hope that it will be useful,
Packit Service c4ca6d
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service c4ca6d
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service c4ca6d
   Lesser General Public License for more details.
Packit Service c4ca6d
Packit Service c4ca6d
   You should have received a copy of the GNU Lesser General Public
Packit Service c4ca6d
   License along with the GNU C Library; if not, see
Packit Service c4ca6d
   <http://www.gnu.org/licenses/>.  */
Packit Service c4ca6d
Packit Service c4ca6d
#include <ifunc-memcpy.h>
Packit Service c4ca6d
Packit Service c4ca6d
#if HAVE_MEMMOVE_IFUNC
Packit Service c4ca6d
/* If we don't use ifunc, an alias is defined for memmove
Packit Service c4ca6d
   in sysdeps/s390/memmove-c.c or sysdeps/s390/memcpy.S
Packit Service c4ca6d
   depending on the used default implementation.  */
Packit Service c4ca6d
# undef memmove
Packit Service c4ca6d
# define memmove __redirect_memmove
Packit Service c4ca6d
# include <string.h>
Packit Service c4ca6d
# include <ifunc-resolve.h>
Packit Service c4ca6d
# undef memmove
Packit Service c4ca6d
Packit Service c4ca6d
# if HAVE_MEMMOVE_C
Packit Service c4ca6d
extern __typeof (__redirect_memmove) MEMMOVE_C attribute_hidden;
Packit Service c4ca6d
# endif
Packit Service c4ca6d
Packit Service c4ca6d
# if HAVE_MEMMOVE_Z13
Packit Service c4ca6d
extern __typeof (__redirect_memmove) MEMMOVE_Z13 attribute_hidden;
Packit Service c4ca6d
# endif
Packit Service c4ca6d
Packit Service a4db06
# if HAVE_MEMMOVE_ARCH13
Packit Service a4db06
extern __typeof (__redirect_memmove) MEMMOVE_ARCH13 attribute_hidden;
Packit Service a4db06
# endif
Packit Service a4db06
Packit Service c4ca6d
s390_libc_ifunc_expr (__redirect_memmove, memmove,
Packit Service a4db06
		      ({
Packit Service a4db06
			s390_libc_ifunc_expr_stfle_init ();
Packit Service a4db06
			(HAVE_MEMMOVE_ARCH13
Packit Service a4db06
			 && S390_IS_ARCH13_MIE3 (stfle_bits))
Packit Service a4db06
			  ? MEMMOVE_ARCH13
Packit Service a4db06
			  : (HAVE_MEMMOVE_Z13 && (hwcap & HWCAP_S390_VX))
Packit Service a4db06
			  ? MEMMOVE_Z13
Packit Service a4db06
			  : MEMMOVE_DEFAULT;
Packit Service a4db06
		      })
Packit Service c4ca6d
		      )
Packit Service c4ca6d
#endif