glibc/sysdeps/x86_64/memcpy.S
Ulrich Drepper 3dbfd8117c Update.
2004-05-27  Jakub Jelinek  <jakub@redhat.com>

	* sysdeps/i386/fpu/bits/mathinline.h (__expm1_code): Define using
	__builtin_expm1l for GCC 3.5+.
	(__expl): Define using __builtin_expl for GCC 3.4+.
	(exp, expf, expl): Don't define for GCC 3.4+.
	(tan, tanf, tanl): Don't define for GCC 3.5+.
	(__atan2l): Define using __builtin_atan2l for GCC 3.4+.
	(atan2, atan2f, atan2l): Don't define for GCC 3.4+ or !__FAST_MATH__.
	(fmod, fmodf, fmodl): Don't define for GCC 3.5+ or !__FAST_MATH__.
	(fabsf, fabsl): Only provide if __USE_MISC or __USE_ISOC99.
	(sin, sinf, sinl, cos, cosf, cosl, log, logf, logl): Don't define
	for GCC 3.4+.
	(log10, log10f, log10l, asin, asinf, asinl, acos, acosf, acosl):
	Don't define for GCC 3.5+.
	(atan, atanf, atanl): Don't define for GCC 3.4+ or !__FAST_MATH__.
	(log1p, log1pf, log1pl, logb, logbf, logbl, log2, log2f, log2l): Don't
	define for GCC 3.5+.
	(drem, dremf, dreml): Don't define for GCC 3.5+ or !__FAST_MATH__.
	* sysdeps/sparc/fpu/bits/mathinline.h (sqrt, sqrtf, sqrtl): Don't
	define for GCC 3.2+.

2004-05-27  Jakub Jelinek  <jakub@redhat.com>

	* string/bits/string2.h (__bzero): Define even for GCC 3.0+.
	* sysdeps/alpha/stpcpy.S (stpcpy): Add libc_hidden_builtin_def.
	* sysdeps/alpha/alphaev67/stpcpy.S (stpcpy): Likewise.
	* sysdeps/powerpc/powerpc32/stpcpy.S (stpcpy): Likewise.
	* sysdeps/powerpc/powerpc64/stpcpy.S (stpcpy): Likewise.
	* sysdeps/sparc/sparc32/stpcpy.S (stpcpy): Likewise.
	* sysdeps/sparc/sparc64/stpcpy.S (stpcpy): Likewise.
	* sysdeps/i386/stpcpy.S (stpcpy): Likewise.
	* sysdeps/i386/i586/stpcpy.S (stpcpy): Likewise.
	* sysdeps/generic/stpcpy.c (stpcpy): Likewise.
	* sysdeps/x86_64/stpcpy.S (stpcpy): Likewise.
	* sysdeps/i386/i586/memcpy.S (memcpy): Remove
	libc_hidden_builtin_def if MEMPCPY_P.
	* sysdeps/x86_64/memcpy.S (memcpy): Likewise.
	* sysdeps/i386/i686/mempcpy.S (mempcpy): Add libc_hidden_builtin_def.
	* sysdeps/i386/i586/mempcpy.S (mempcpy): Likewise.
	* sysdeps/generic/mempcpy.c (mempcpy): Likewise.
	* sysdeps/x86_64/mempcpy.S (mempcpy): Likewise.
2004-05-28 06:56:51 +00:00

96 lines
2.3 KiB
ArmAsm

/* Highly optimized version for x86-64.
Copyright (C) 1997, 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Based on i586 version contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
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, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <sysdep.h>
#include "asm-syntax.h"
#include "bp-sym.h"
#include "bp-asm.h"
/* BEWARE: `#ifdef memcpy' means that memcpy is redefined as `mempcpy',
and the return value is the byte after the last one copied in
the destination. */
#define MEMPCPY_P (defined memcpy)
.text
ENTRY (BP_SYM (memcpy))
/* Cutoff for the big loop is a size of 32 bytes since otherwise
the loop will never be entered. */
cmpq $32, %rdx
movq %rdx, %rcx
#if !MEMPCPY_P
movq %rdi, %r10 /* Save value. */
#endif
/* We need this in any case. */
cld
jbe 1f
/* Align destination. */
movq %rdi, %rax
negq %rax
andq $7, %rax
subq %rax, %rcx
xchgq %rax, %rcx
rep; movsb
movq %rax, %rcx
subq $32, %rcx
js 2f
.p2align 4
3:
/* Now correct the loop counter. Please note that in the following
code the flags are not changed anymore. */
subq $32, %rcx
movq (%rsi), %rax
movq 8(%rsi), %rdx
movq 16(%rsi), %r8
movq 24(%rsi), %r9
movq %rax, (%rdi)
movq %rdx, 8(%rdi)
movq %r8, 16(%rdi)
movq %r9, 24(%rdi)
leaq 32(%rsi), %rsi
leaq 32(%rdi), %rdi
jns 3b
/* Correct extra loop counter modification. */
2: addq $32, %rcx
1: rep; movsb
#if MEMPCPY_P
movq %rdi, %rax /* Set return value. */
#else
movq %r10, %rax /* Set return value. */
#endif
ret
END (BP_SYM (memcpy))
#if !MEMPCPY_P
libc_hidden_builtin_def (memcpy)
#endif