[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r8291 - in /fsf/trunk/libc: ./ elf/ sysdeps/powerpc/powerpc32/elf/ sysdeps/powerpc/powerpc64/elf/ sysdeps/sh/ sysdeps/sh/bit...



Author: eglibc
Date: Wed Apr 15 00:05:07 2009
New Revision: 8291

Log:
Import glibc-mainline for 2009-04-15

Added:
    fsf/trunk/libc/sysdeps/sh/libc-tls.c
    fsf/trunk/libc/sysdeps/x86_64/add_n.S
    fsf/trunk/libc/sysdeps/x86_64/addmul_1.S
    fsf/trunk/libc/sysdeps/x86_64/lshift.S
    fsf/trunk/libc/sysdeps/x86_64/mp_clz_tab.c
    fsf/trunk/libc/sysdeps/x86_64/mul_1.S
    fsf/trunk/libc/sysdeps/x86_64/rshift.S
    fsf/trunk/libc/sysdeps/x86_64/sub_n.S
    fsf/trunk/libc/sysdeps/x86_64/submul_1.S
Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/elf/elf.h
    fsf/trunk/libc/sysdeps/powerpc/powerpc32/elf/start.S
    fsf/trunk/libc/sysdeps/powerpc/powerpc64/elf/start.S
    fsf/trunk/libc/sysdeps/sh/bits/setjmp.h
    fsf/trunk/libc/sysdeps/sparc/sparc32/elf/start.S
    fsf/trunk/libc/sysdeps/sparc/sparc64/elf/start.S
    fsf/trunk/libc/sysdeps/unix/sysv/linux/fallocate.c
    fsf/trunk/libc/sysdeps/unix/sysv/linux/fallocate64.c
    fsf/trunk/libc/sysdeps/unix/sysv/linux/kernel-features.h

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Wed Apr 15 00:05:07 2009
@@ -1,3 +1,46 @@
+2009-04-14  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* sysdeps/x86_64/mp_clz_tab.c: New file.
+
+2009-03-17  Ryan S. Arnold  <rsa@xxxxxxxxxx>
+            Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/fallocate.c: Handle old kernel headers.
+	* sysdeps/unix/sysv/linux/fallocate64.c: Likewise.
+
+2009-03-25  Andrew Stubbs  <ams@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/sh/libc-tls.c: New file.
+
+	* sysdeps/sh/bits/setjmp.h (__jmp_buf): Give name to structure type.
+
+2009-04-14  Roland McGrath  <roland@xxxxxxxxxx>
+
+	* elf/elf.h: Add various missing ARM constants, to match binutils.
+
+2009-04-14  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	Optimizations from GMP.
+	* sysdeps/x86_64/add_n.S: New file.
+	* sysdeps/x86_64/addmul_1.S: New file.
+	* sysdeps/x86_64/lshift.S: New file.
+	* sysdeps/x86_64/mul_1.S: New file.
+	* sysdeps/x86_64/rshift.S: New file.
+	* sysdeps/x86_64/sub_n.S: New file.
+	* sysdeps/x86_64/submul_1.S: New file.
+
+2009-04-14  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	* sysdeps/powerpc/powerpc32/elf/start.S: Ensure .data is non-empty.
+	* sysdeps/powerpc/powerpc64/elf/start.S: Likewise.
+	* sysdeps/sparc/sparc32/elf/start.S: Likewise.
+	* sysdeps/sparc/sparc64/elf/start.S: Likewise.
+
+2009-04-14  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/kernel-features.h: SH also has
+	preadv/pwritev.
+
 2009-04-13  Ulrich Drepper  <drepper@xxxxxxxxxx>
 
 	* sysdeps/x86-64/strrchr.S: New file.

Modified: fsf/trunk/libc/elf/elf.h
==============================================================================
--- fsf/trunk/libc/elf/elf.h (original)
+++ fsf/trunk/libc/elf/elf.h Wed Apr 15 00:05:07 2009
@@ -2205,42 +2205,62 @@
 /* ARM specific declarations */
 
 /* Processor specific flags for the ELF header e_flags field.  */
-#define EF_ARM_RELEXEC     0x01
-#define EF_ARM_HASENTRY    0x02
-#define EF_ARM_INTERWORK   0x04
-#define EF_ARM_APCS_26     0x08
-#define EF_ARM_APCS_FLOAT  0x10
-#define EF_ARM_PIC         0x20
-#define EF_ARM_ALIGN8      0x40		/* 8-bit structure alignment is in use */
-#define EF_ARM_NEW_ABI     0x80
-#define EF_ARM_OLD_ABI     0x100
+#define EF_ARM_RELEXEC		0x01
+#define EF_ARM_HASENTRY		0x02
+#define EF_ARM_INTERWORK	0x04
+#define EF_ARM_APCS_26		0x08
+#define EF_ARM_APCS_FLOAT	0x10
+#define EF_ARM_PIC		0x20
+#define EF_ARM_ALIGN8		0x40 /* 8-bit structure alignment is in use */
+#define EF_ARM_NEW_ABI		0x80
+#define EF_ARM_OLD_ABI		0x100
+#define EF_ARM_SOFT_FLOAT	0x200
+#define EF_ARM_VFP_FLOAT	0x400
+#define EF_ARM_MAVERICK_FLOAT	0x800
+
 
 /* Other constants defined in the ARM ELF spec. version B-01.  */
 /* NB. These conflict with values defined above.  */
 #define EF_ARM_SYMSARESORTED	0x04
-#define EF_ARM_DYNSYMSUSESEGIDX 0x08
+#define EF_ARM_DYNSYMSUSESEGIDX	0x08
 #define EF_ARM_MAPSYMSFIRST	0x10
 #define EF_ARM_EABIMASK		0XFF000000
 
-#define EF_ARM_EABI_VERSION(flags) ((flags) & EF_ARM_EABIMASK)
-#define EF_ARM_EABI_UNKNOWN  0x00000000
-#define EF_ARM_EABI_VER1     0x01000000
-#define EF_ARM_EABI_VER2     0x02000000
-
-/* Additional symbol types for Thumb */
-#define STT_ARM_TFUNC      0xd
+/* Constants defined in AAELF.  */
+#define EF_ARM_BE8	    0x00800000
+#define EF_ARM_LE8	    0x00400000
+
+#define EF_ARM_EABI_VERSION(flags)	((flags) & EF_ARM_EABIMASK)
+#define EF_ARM_EABI_UNKNOWN	0x00000000
+#define EF_ARM_EABI_VER1	0x01000000
+#define EF_ARM_EABI_VER2	0x02000000
+#define EF_ARM_EABI_VER3	0x03000000
+#define EF_ARM_EABI_VER4	0x04000000
+#define EF_ARM_EABI_VER5	0x05000000
+
+/* Additional symbol types for Thumb.  */
+#define STT_ARM_TFUNC		STT_LOPROC /* A Thumb function.  */
+#define STT_ARM_16BIT		STT_HIPROC /* A Thumb label.  */
 
 /* ARM-specific values for sh_flags */
-#define SHF_ARM_ENTRYSECT  0x10000000   /* Section contains an entry point */
-#define SHF_ARM_COMDEF     0x80000000   /* Section may be multiply defined
-					   in the input to a link step */
+#define SHF_ARM_ENTRYSECT	0x10000000 /* Section contains an entry point */
+#define SHF_ARM_COMDEF		0x80000000 /* Section may be multiply defined
+					      in the input to a link step.  */
 
 /* ARM-specific program header flags */
-#define PF_ARM_SB          0x10000000   /* Segment contains the location
-					   addressed by the static base */
+#define PF_ARM_SB		0x10000000 /* Segment contains the location
+					      addressed by the static base. */
+#define PF_ARM_PI		0x20000000 /* Position-independent segment.  */
+#define PF_ARM_ABS		0x40000000 /* Absolute segment.  */
 
 /* Processor specific values for the Phdr p_type field.  */
-#define PT_ARM_EXIDX	0x70000001	/* .ARM.exidx segment */
+#define PT_ARM_EXIDX		(PT_LOPROC + 1)	/* ARM unwind segment.  */
+
+/* Processor specific values for the Shdr sh_type field.  */
+#define SHT_ARM_EXIDX		(SHT_LOPROC + 1) /* ARM unwind section.  */
+#define SHT_ARM_PREEMPTMAP	(SHT_LOPROC + 2) /* Preemption details.  */
+#define SHT_ARM_ATTRIBUTES	(SHT_LOPROC + 3) /* ARM attributes section.  */
+
 
 /* ARM relocs.  */
 

Modified: fsf/trunk/libc/sysdeps/powerpc/powerpc32/elf/start.S
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/powerpc32/elf/start.S (original)
+++ fsf/trunk/libc/sysdeps/powerpc/powerpc32/elf/start.S Wed Apr 15 00:05:07 2009
@@ -1,5 +1,6 @@
 /* Startup code for programs linked with GNU libc.
-   Copyright (C) 1998,1999,2000,2001,2002,2003 Free Software Foundation, Inc.
+   Copyright (C) 1998,1999,2000,2001,2002,2003,2009
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -98,4 +99,5 @@
 	.section ".data"
 	.globl	__data_start
 __data_start:
+	.long	0
 weak_alias (__data_start, data_start)

Modified: fsf/trunk/libc/sysdeps/powerpc/powerpc64/elf/start.S
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/powerpc64/elf/start.S (original)
+++ fsf/trunk/libc/sysdeps/powerpc/powerpc64/elf/start.S Wed Apr 15 00:05:07 2009
@@ -1,5 +1,6 @@
 /* Startup code for programs linked with GNU libc.  PowerPC64 version.
-   Copyright (C) 1998,1999,2000,2001,2002,2003 Free Software Foundation, Inc.
+   Copyright (C) 1998,1999,2000,2001,2002,2003,2009
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -83,4 +84,5 @@
 	.section ".data"
 	.globl	__data_start
 __data_start:
+	.long	0
 weak_alias (__data_start, data_start)

Modified: fsf/trunk/libc/sysdeps/sh/bits/setjmp.h
==============================================================================
--- fsf/trunk/libc/sysdeps/sh/bits/setjmp.h (original)
+++ fsf/trunk/libc/sysdeps/sh/bits/setjmp.h Wed Apr 15 00:05:07 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999,2000,2003,2005,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1999,2000,2003,2005,2006,2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -25,7 +25,7 @@
 #endif
 
 #ifndef _ASM
-typedef struct
+typedef struct __jmp_buf_internal_tag
   {
     /* Callee-saved registers r8 through r15.  */
     int __regs[8];

Added: fsf/trunk/libc/sysdeps/sh/libc-tls.c
==============================================================================
--- fsf/trunk/libc/sysdeps/sh/libc-tls.c (added)
+++ fsf/trunk/libc/sysdeps/sh/libc-tls.c Wed Apr 15 00:05:07 2009
@@ -1,0 +1,33 @@
+/* Thread-local storage handling in the ELF dynamic linker.  SH version.
+   Copyright (C) 2009 Free Software Foundation, Inc.
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <csu/libc-tls.c>
+#include <dl-tls.h>
+
+/* On SH, linker optimizations are not required, so __tls_get_addr
+   can be called even in statically linked binaries.  In this case module
+   must be always 1 and PT_TLS segment exist in the binary, otherwise it
+   would not link.  */
+
+void *
+__tls_get_addr (tls_index *ti)
+{
+  dtv_t *dtv = THREAD_DTV ();
+  return (char *) dtv[1].pointer.val + ti->ti_offset;
+}

Modified: fsf/trunk/libc/sysdeps/sparc/sparc32/elf/start.S
==============================================================================
--- fsf/trunk/libc/sysdeps/sparc/sparc32/elf/start.S (original)
+++ fsf/trunk/libc/sysdeps/sparc/sparc32/elf/start.S Wed Apr 15 00:05:07 2009
@@ -1,5 +1,6 @@
 /* Startup code for elf32-sparc
-   Copyright (C) 1997, 1998, 2002, 2004, 2007 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998, 2002, 2004, 2007, 2009
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson <richard@xxxxxxxxxxxxxx>, 1997.
 
@@ -96,4 +97,5 @@
 	.data
 	.globl	__data_start
 __data_start:
+	.long	0
 weak_alias (__data_start, data_start)

Modified: fsf/trunk/libc/sysdeps/sparc/sparc64/elf/start.S
==============================================================================
--- fsf/trunk/libc/sysdeps/sparc/sparc64/elf/start.S (original)
+++ fsf/trunk/libc/sysdeps/sparc/sparc64/elf/start.S Wed Apr 15 00:05:07 2009
@@ -1,5 +1,6 @@
 /* Startup code for elf64-sparc
-   Copyright (C) 1997, 1998, 2002, 2004, 2007 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998, 2002, 2004, 2007, 2009
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson <richard@xxxxxxxxxxxxxx>, 1997.
 
@@ -97,4 +98,5 @@
 	.data
 	.globl	__data_start
 __data_start:
+	.long	0
 weak_alias (__data_start, data_start)

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/fallocate.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/fallocate.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/fallocate.c Wed Apr 15 00:05:07 2009
@@ -25,7 +25,12 @@
 int
 fallocate (int fd, int mode, __off_t offset, __off_t len)
 {
+#ifndef __NR_fallocate
   return INLINE_SYSCALL (fallocate, 6, fd, mode,
 			 __LONG_LONG_PAIR (offset >> 31, offset),
 			 __LONG_LONG_PAIR (len >> 31, len));
+#else
+  __set_errno (ENOSYS);
+  return -1;
+#endif
 }

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/fallocate64.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/fallocate64.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/fallocate64.c Wed Apr 15 00:05:07 2009
@@ -25,9 +25,14 @@
 int
 __fallocate64_l64 (int fd, int mode, __off64_t offset, __off64_t len)
 {
+#ifndef __NR_fallocate
   return INLINE_SYSCALL (fallocate, 6, fd, mode,
 			 __LONG_LONG_PAIR ((long int) (offset >> 32),
 					   (long int) offset),
 			 __LONG_LONG_PAIR ((long int) (len >> 32),
 					   (long int) len));
+#else
+  __set_errno (ENOSYS);
+  return -1;
+#endif
 }

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/kernel-features.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/kernel-features.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/kernel-features.h Wed Apr 15 00:05:07 2009
@@ -533,7 +533,7 @@
 /* Support for preadv and pwritev was added in 2.6.30.  */
 #if __LINUX_KERNEL_VERSION >= 0x02061e \
     && (defined __i386__ || defined __x86_64__ || defined __powerpc__ \
-	|| defined __ia64__ || defined __sparc__)
+	|| defined __ia64__ || defined __sparc__ && defined __sh__)
 # define __ASSUME_PREADV	1
 # define __ASSUME_PWRITEV	1
 #endif

Added: fsf/trunk/libc/sysdeps/x86_64/add_n.S
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/add_n.S (added)
+++ fsf/trunk/libc/sysdeps/x86_64/add_n.S Wed Apr 15 00:05:07 2009
@@ -1,0 +1,42 @@
+/* Add two limb vectors of the same length > 0 and store sum in a third
+   limb vector.
+   Copyright (C) 2004 Free Software Foundation, Inc.
+   This file is part of the GNU MP Library.
+
+   The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB.  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"
+
+	.text
+ENTRY (__mpn_add_n)
+	leaq	(%rsi,%rcx,8), %rsi
+	leaq	(%rdi,%rcx,8), %rdi
+	leaq	(%rdx,%rcx,8), %rdx
+	negq	%rcx
+	xorl	%eax, %eax			# clear cy
+	.p2align 2
+L(loop):
+	movq	(%rsi,%rcx,8), %rax
+	movq	(%rdx,%rcx,8), %r10
+	adcq	%r10, %rax
+	movq	%rax, (%rdi,%rcx,8)
+	incq	%rcx
+	jne	L(loop)
+	movq	%rcx, %rax			# zero %rax
+	adcq	%rax, %rax
+	ret
+END (__mpn_add_n)

Added: fsf/trunk/libc/sysdeps/x86_64/addmul_1.S
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/addmul_1.S (added)
+++ fsf/trunk/libc/sysdeps/x86_64/addmul_1.S Wed Apr 15 00:05:07 2009
@@ -1,0 +1,46 @@
+/* AMD64 __mpn_addmul_1 -- Multiply a limb vector with a limb and add
+   the result to a second limb vector.
+   Copyright (C) 2004 Free Software Foundation, Inc.
+   This file is part of the GNU MP Library.
+
+   The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB.  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"
+
+	.text
+ENTRY (__mpn_addmul_1)
+	movq	%rdx, %r11
+	leaq	(%rsi,%rdx,8), %rsi
+	leaq	(%rdi,%rdx,8), %rdi
+	negq	%r11
+	xorl	%r8d, %r8d
+	xorl	%r10d, %r10d
+	.p2align 2
+L(loop):
+	movq	(%rsi,%r11,8), %rax
+	mulq	%rcx
+	addq	(%rdi,%r11,8), %rax
+	adcq	%r10, %rdx
+	addq	%r8, %rax
+	movq	%r10, %r8
+	movq	%rax, (%rdi,%r11,8)
+	adcq	%rdx, %r8
+	incq	%r11
+	jne	L(loop)
+	movq	%r8, %rax
+	ret
+END (__mpn_addmul_1)

Added: fsf/trunk/libc/sysdeps/x86_64/lshift.S
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/lshift.S (added)
+++ fsf/trunk/libc/sysdeps/x86_64/lshift.S Wed Apr 15 00:05:07 2009
@@ -1,0 +1,60 @@
+/* AMD64 __mpn_lshift --
+   Copyright 2004, 2006 Free Software Foundation, Inc.
+   This file is part of the GNU MP Library.
+
+   The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB.  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"
+
+
+	.text
+ENTRY (__mpn_lshift)
+	movq	-8(%rsi,%rdx,8), %mm7
+	movd	%ecx, %mm1
+	movl	$64, %eax
+	subl	%ecx, %eax
+	movd	%eax, %mm0
+	movq	%mm7, %mm3
+	psrlq	%mm0, %mm7
+	movd	%mm7, %rax
+	subq	$2, %rdx
+	jl	L(endo)
+	.p2align 2
+L(loop):
+	movq	(%rsi,%rdx,8), %mm6
+	movq	%mm6, %mm2
+	psrlq	%mm0, %mm6
+	psllq	%mm1, %mm3
+	por	%mm6, %mm3
+	movq	%mm3, 8(%rdi,%rdx,8)
+	je	L(ende)
+	movq	-8(%rsi,%rdx,8), %mm7
+	movq	%mm7, %mm3
+	psrlq	%mm0, %mm7
+	psllq	%mm1, %mm2
+	por	%mm7, %mm2
+	movq	%mm2, (%rdi,%rdx,8)
+	subq	$2, %rdx
+	jge	L(loop)
+L(endo):
+	movq	%mm3, %mm2
+L(ende):
+	psllq	%mm1, %mm2
+	movq	%mm2, (%rdi)
+	emms
+	ret
+END (__mpn_lshift)

Added: fsf/trunk/libc/sysdeps/x86_64/mp_clz_tab.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/mp_clz_tab.c (added)
+++ fsf/trunk/libc/sysdeps/x86_64/mp_clz_tab.c Wed Apr 15 00:05:07 2009
@@ -1,0 +1,1 @@
+/* __clz_tab not needed on x86-64.  */

Added: fsf/trunk/libc/sysdeps/x86_64/mul_1.S
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/mul_1.S (added)
+++ fsf/trunk/libc/sysdeps/x86_64/mul_1.S Wed Apr 15 00:05:07 2009
@@ -1,0 +1,42 @@
+/* AMD64 __mpn_mul_1 -- Multiply a limb vector with a limb and store
+   the result in a second limb vector.
+   Copyright (C) 2004 Free Software Foundation, Inc.
+   This file is part of the GNU MP Library.
+
+   The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB.  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"
+
+	.text
+ENTRY (__mpn_mul_1)
+	movq	%rdx, %r11
+	leaq	(%rsi,%rdx,8), %rsi
+	leaq	(%rdi,%rdx,8), %rdi
+	negq	%r11
+	xorl	%r8d, %r8d
+L(loop):
+	movq	(%rsi,%r11,8), %rax
+	mulq	%rcx
+	addq	%r8, %rax
+	movl	$0, %r8d
+	adcq	%rdx, %r8
+	movq	%rax, (%rdi,%r11,8)
+	incq	%r11
+	jne	L(loop)
+	movq	%r8, %rax
+	ret
+END (__mpn_mul_1)

Added: fsf/trunk/libc/sysdeps/x86_64/rshift.S
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/rshift.S (added)
+++ fsf/trunk/libc/sysdeps/x86_64/rshift.S Wed Apr 15 00:05:07 2009
@@ -1,0 +1,62 @@
+/* AMD64 __mpn_rshift --
+   Copyright (C) 2004, 2006 Free Software Foundation, Inc.
+   This file is part of the GNU MP Library.
+
+   The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB.  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"
+
+	.text
+ENTRY (__mpn_rshift)
+	movq	(%rsi), %mm7
+	movd	%ecx, %mm1
+	movl	$64, %eax
+	subl	%ecx, %eax
+	movd	%eax, %mm0
+	movq	%mm7, %mm3
+	psllq	%mm0, %mm7
+	movd	%mm7, %rax
+	leaq	(%rsi,%rdx,8), %rsi
+	leaq	(%rdi,%rdx,8), %rdi
+	negq	%rdx
+	addq	$2, %rdx
+	jg	L(endo)
+	.p2align 2
+L(loop):
+	movq	-8(%rsi,%rdx,8), %mm6
+	movq	%mm6, %mm2
+	psllq	%mm0, %mm6
+	psrlq	%mm1, %mm3
+	por	%mm6, %mm3
+	movq	%mm3, -16(%rdi,%rdx,8)
+	je	L(ende)
+	movq	(%rsi,%rdx,8), %mm7
+	movq	%mm7, %mm3
+	psllq	%mm0, %mm7
+	psrlq	%mm1, %mm2
+	por	%mm7, %mm2
+	movq	%mm2, -8(%rdi,%rdx,8)
+	addq	$2, %rdx
+	jle	L(loop)
+L(endo):
+	movq	%mm3, %mm2
+L(ende):
+	psrlq	%mm1, %mm2
+	movq	%mm2, -8(%rdi)
+	emms
+	ret
+END (__mpn_rshift)

Added: fsf/trunk/libc/sysdeps/x86_64/sub_n.S
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/sub_n.S (added)
+++ fsf/trunk/libc/sysdeps/x86_64/sub_n.S Wed Apr 15 00:05:07 2009
@@ -1,0 +1,42 @@
+/* AMD64 __mpn_sub_n -- Add two limb vectors of the same length > 0 and store
+   sum in a third limb vector.
+   Copyright (C) 2004 Free Software Foundation, Inc.
+   This file is part of the GNU MP Library.
+
+   The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB.  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"
+
+	.text
+ENTRY (__mpn_sub_n)
+	leaq	(%rsi,%rcx,8), %rsi
+	leaq	(%rdi,%rcx,8), %rdi
+	leaq	(%rdx,%rcx,8), %rdx
+	negq	%rcx
+	xorl	%eax, %eax		# clear cy
+	.p2align 2
+L(loop):
+	movq	(%rsi,%rcx,8), %rax
+	movq	(%rdx,%rcx,8), %r10
+	sbbq	%r10, %rax
+	movq	%rax, (%rdi,%rcx,8)
+	incq	%rcx
+	jne	L(loop)
+	movq	%rcx, %rax		# zero %rax
+	adcq	%rax, %rax
+	ret
+END (__mpn_sub_n)

Added: fsf/trunk/libc/sysdeps/x86_64/submul_1.S
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/submul_1.S (added)
+++ fsf/trunk/libc/sysdeps/x86_64/submul_1.S Wed Apr 15 00:05:07 2009
@@ -1,0 +1,46 @@
+/* AMD64 __mpn_submul_1 -- Multiply a limb vector with a limb and subtract
+   the result from a second limb vector.
+   Copyright (C) 2004 Free Software Foundation, Inc.
+   This file is part of the GNU MP Library.
+
+   The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB.  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"
+
+	.text
+ENTRY (__mpn_submul_1)
+	movq	%rdx, %r11
+	leaq	(%rsi,%r11,8), %rsi
+	leaq	(%rdi,%r11,8), %rdi
+	negq	%r11
+	xorl	%r8d, %r8d
+	.p2align 3
+L(loop):
+	movq	(%rsi,%r11,8), %rax
+	movq	(%rdi,%r11,8), %r10
+	mulq	%rcx
+	subq	%r8, %r10
+	movl	$0, %r8d
+	adcl	%r8d, %r8d
+	subq	%rax, %r10
+	adcq	%rdx, %r8
+	movq	%r10, (%rdi,%r11,8)
+	incq	%r11
+	jne	L(loop)
+	movq	%r8, %rax
+	ret
+END (__mpn_submul_1)