diff options
Diffstat (limited to 'sysdeps/i386/i686')
-rw-r--r-- | sysdeps/i386/i686/Dist | 1 | ||||
-rw-r--r-- | sysdeps/i386/i686/add_n.S | 10 | ||||
-rw-r--r-- | sysdeps/i386/i686/dl-hash.h | 6 | ||||
-rw-r--r-- | sysdeps/i386/i686/ffs.c | 4 | ||||
-rw-r--r-- | sysdeps/i386/i686/hp-timing.h | 24 | ||||
-rw-r--r-- | sysdeps/i386/i686/memcmp.S | 37 | ||||
-rw-r--r-- | sysdeps/i386/i686/memcpy_chk.S | 2 | ||||
-rw-r--r-- | sysdeps/i386/i686/memmove.S | 15 | ||||
-rw-r--r-- | sysdeps/i386/i686/mempcpy.S | 6 | ||||
-rw-r--r-- | sysdeps/i386/i686/memset.S | 24 | ||||
-rw-r--r-- | sysdeps/i386/i686/memset_chk.S | 4 | ||||
-rw-r--r-- | sysdeps/i386/i686/memusage.h | 22 | ||||
-rw-r--r-- | sysdeps/i386/i686/strtok.S | 16 |
13 files changed, 39 insertions, 132 deletions
diff --git a/sysdeps/i386/i686/Dist b/sysdeps/i386/i686/Dist new file mode 100644 index 0000000000..dbf11d5009 --- /dev/null +++ b/sysdeps/i386/i686/Dist @@ -0,0 +1 @@ +hp-timing.c diff --git a/sysdeps/i386/i686/add_n.S b/sysdeps/i386/i686/add_n.S index 3cce33acfe..e36b0d0a5d 100644 --- a/sysdeps/i386/i686/add_n.S +++ b/sysdeps/i386/i686/add_n.S @@ -1,6 +1,6 @@ /* Add two limb vectors of the same length > 0 and store sum in a third limb vector. - Copyright (C) 1992,94,95,97,98,2000,2005 Free Software Foundation, Inc. + Copyright (C) 1992, 94, 95, 97, 98, 2000 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 @@ -38,14 +38,10 @@ ENTRY (BP_SYM (__mpn_add_n)) ENTER pushl %edi - cfi_adjust_cfa_offset (4) pushl %esi - cfi_adjust_cfa_offset (4) movl RES(%esp),%edi - cfi_rel_offset (edi, 4) movl S1(%esp),%esi - cfi_rel_offset (esi, 0) movl S2(%esp),%edx movl SIZE(%esp),%ecx #if __BOUNDED_POINTERS__ @@ -111,11 +107,7 @@ L(oop): movl (%esi),%eax negl %eax popl %esi - cfi_adjust_cfa_offset (-4) - cfi_restore (esi) popl %edi - cfi_adjust_cfa_offset (-4) - cfi_restore (edi) LEAVE ret diff --git a/sysdeps/i386/i686/dl-hash.h b/sysdeps/i386/i686/dl-hash.h index 4bdd998aa8..61183d80da 100644 --- a/sysdeps/i386/i686/dl-hash.h +++ b/sysdeps/i386/i686/dl-hash.h @@ -1,5 +1,5 @@ /* Compute hash alue for given string according to ELF standard. - Copyright (C) 1998, 2003, 2005 Free Software Foundation, Inc. + Copyright (C) 1998, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998. @@ -27,7 +27,7 @@ would be much slower than the generic C implementation. So don't use it. */ static unsigned int -_dl_elf_hash (const char *name) +_dl_elf_hash (const unsigned char *name) { unsigned int result; unsigned int temp0; @@ -71,7 +71,7 @@ _dl_elf_hash (const char *name) "jnz 2b\n" "1:\t" : "=&r" (result), "=r" (name), "=&c" (temp0), "=&r" (temp1) - : "0" (0), "1" ((const unsigned char *) name)); + : "0" (0), "1" (name)); return result; } diff --git a/sysdeps/i386/i686/ffs.c b/sysdeps/i386/i686/ffs.c index 684ae21827..fd7ef1a3d6 100644 --- a/sysdeps/i386/i686/ffs.c +++ b/sysdeps/i386/i686/ffs.c @@ -1,7 +1,7 @@ /* ffs -- find first set bit in a word, counted from least significant end. For Intel 80x86, x>=6. This file is part of the GNU C Library. - Copyright (C) 1991, 92, 93, 94, 97, 98, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 1991, 92, 93, 94, 97, 98, 2004 Free Software Foundation, Inc. Contributed by Ulrich Drepper <drepper@cygnus.com>. The GNU C Library is free software; you can redistribute it and/or @@ -45,5 +45,5 @@ libc_hidden_builtin_def (ffs) weak_alias (__ffs, ffsl) #else -#include <string/ffs.c> +#include <sysdeps/generic/ffs.c> #endif diff --git a/sysdeps/i386/i686/hp-timing.h b/sysdeps/i386/i686/hp-timing.h index b924869649..a5906835f7 100644 --- a/sysdeps/i386/i686/hp-timing.h +++ b/sysdeps/i386/i686/hp-timing.h @@ -1,5 +1,5 @@ /* High precision, low overhead timing functions. i686 version. - Copyright (C) 1998, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 1998, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998. @@ -119,24 +119,26 @@ typedef unsigned long long int hp_timing_t; /* We have to jump through hoops to get this correctly implemented. */ #define HP_TIMING_ACCUM(Sum, Diff) \ do { \ - int __not_done; \ + char __not_done; \ hp_timing_t __oldval = (Sum); \ hp_timing_t __diff = (Diff) - GLRO(dl_hp_timing_overhead); \ do \ { \ hp_timing_t __newval = __oldval + __diff; \ int __temp0, __temp1; \ - __asm__ __volatile__ ("xchgl %0, %%ebx\n\t" \ + __asm__ __volatile__ ("xchgl %4, %%ebx\n\t" \ "lock; cmpxchg8b %1\n\t" \ - "sete %%bl\n\t" \ - "xchgl %0, %%ebx" \ - : "=SD" (__not_done), "=m" (Sum), \ - "=A" (__oldval), "=c" (__temp0) \ - : "m" (Sum), "2" (__oldval), \ - "3" ((unsigned int) (__newval >> 32)), \ - "0" ((unsigned int) __newval)); \ + "sete %0\n\t" \ + "movl %4, %%ebx" \ + : "=q" (__not_done), "=m" (Sum), \ + "=A" (__oldval), "=c" (__temp0), \ + "=SD" (__temp1) \ + : "1" (Sum), "2" (__oldval), \ + "3" (__newval >> 32), \ + "4" (__newval & 0xffffffff) \ + : "memory"); \ } \ - while ((unsigned char) __not_done); \ + while (__not_done); \ } while (0) /* No threads, no extra work. */ diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S index 4bd5394bec..ef57acdee8 100644 --- a/sysdeps/i386/i686/memcmp.S +++ b/sysdeps/i386/i686/memcmp.S @@ -1,5 +1,5 @@ /* Compare two memory blocks for differences in the first COUNT bytes. - Copyright (C) 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2004 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 @@ -26,11 +26,8 @@ #define BLK1 PARMS #define BLK2 BLK1+PTR_SIZE #define LEN BLK2+PTR_SIZE -#define ENTRANCE pushl %ebx; cfi_adjust_cfa_offset (4); \ - cfi_rel_offset (ebx, 0); ENTER -#define RETURN popl %ebx; cfi_adjust_cfa_offset (-4); \ - cfi_restore (ebx); LEAVE; ret; \ - cfi_adjust_cfa_offset (4); cfi_rel_offset (ebx, 0); +#define ENTRANCE pushl %ebx; ENTER +#define RETURN popl %ebx; LEAVE; ret /* Load an entry in a jump table into EBX. TABLE is a jump table with relative offsets. INDEX is a register contains the index @@ -80,15 +77,11 @@ L(neq): sbbl $-1, %eax RETURN - cfi_adjust_cfa_offset (4) - cfi_rel_offset (ebx, 0) L(not_1): jl L(bye) /* LEN == 0 */ pushl %esi - cfi_adjust_cfa_offset (4) movl %eax, %esi - cfi_rel_offset (esi, 0) cmpl $32, %ecx; jge L(32bytesormore) /* LEN => 32 */ @@ -135,14 +128,9 @@ L(4bytes): jne L(find_diff) L(0bytes): popl %esi - cfi_adjust_cfa_offset (-4) - cfi_restore (esi) xorl %eax, %eax RETURN - cfi_adjust_cfa_offset (8) - cfi_rel_offset (esi, 0) - cfi_rel_offset (ebx, 4) L(29bytes): movl -29(%esi), %eax movl -29(%edx), %ecx @@ -183,14 +171,9 @@ L(1bytes): cmpb -1(%edx), %al jne L(set) popl %esi - cfi_adjust_cfa_offset (-4) - cfi_restore (esi) xorl %eax, %eax RETURN - cfi_adjust_cfa_offset (8) - cfi_rel_offset (esi, 0) - cfi_rel_offset (ebx, 4) L(30bytes): movl -30(%esi), %eax movl -30(%edx), %ecx @@ -234,14 +217,9 @@ L(2bytes): cmpl %ecx, %eax jne L(set) popl %esi - cfi_adjust_cfa_offset (-4) - cfi_restore (esi) xorl %eax, %eax RETURN - cfi_adjust_cfa_offset (8) - cfi_rel_offset (esi, 0) - cfi_rel_offset (ebx, 4) L(31bytes): movl -31(%esi), %eax movl -31(%edx), %ecx @@ -288,14 +266,9 @@ L(3bytes): cmpb -1(%edx), %al jne L(set) popl %esi - cfi_adjust_cfa_offset (-4) - cfi_restore (esi) xorl %eax, %eax RETURN - cfi_adjust_cfa_offset (8) - cfi_rel_offset (esi, 0) - cfi_rel_offset (ebx, 4) ALIGN (4) /* ECX >= 32. */ L(32bytesormore): @@ -376,10 +349,7 @@ L(set): sbbl %eax, %eax sbbl $-1, %eax popl %esi - cfi_adjust_cfa_offset (-4) - cfi_restore (esi) RETURN -END (BP_SYM (memcmp)) .section .rodata ALIGN (2) @@ -417,6 +387,7 @@ L(table_32bytes) : .long L(30bytes) - . + 0x78 .long L(31bytes) - . + 0x7c +END (BP_SYM (memcmp)) #undef bcmp weak_alias (BP_SYM (memcmp), BP_SYM (bcmp)) diff --git a/sysdeps/i386/i686/memcpy_chk.S b/sysdeps/i386/i686/memcpy_chk.S index 2893911cd2..561263f9bf 100644 --- a/sysdeps/i386/i686/memcpy_chk.S +++ b/sysdeps/i386/i686/memcpy_chk.S @@ -1,4 +1,4 @@ -/* Checking memcpy for i686. +/* Checking memcpy for x86-64. Copyright (C) 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/sysdeps/i386/i686/memmove.S b/sysdeps/i386/i686/memmove.S index b93b5c729f..951e139ad4 100644 --- a/sysdeps/i386/i686/memmove.S +++ b/sysdeps/i386/i686/memmove.S @@ -1,7 +1,7 @@ /* Copy memory block and return pointer to beginning of destination block For Intel 80x86, x>=6. This file is part of the GNU C Library. - Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2003, 2004 Free Software Foundation, Inc. Contributed by Ulrich Drepper <drepper@cygnus.com>, 2003. The GNU C Library is free software; you can redistribute it and/or @@ -42,14 +42,11 @@ ENTRY (BP_SYM (memmove)) ENTER pushl %edi - cfi_adjust_cfa_offset (4) movl LEN(%esp), %ecx movl DEST(%esp), %edi - cfi_rel_offset (edi, 0) movl %esi, %edx movl SRC(%esp), %esi - cfi_register (esi, edx) CHECK_BOUNDS_BOTH_WIDE (%edi, DEST(%esp), %ecx) CHECK_BOUNDS_BOTH_WIDE (%esi, SRC(%esp), %ecx) @@ -68,21 +65,14 @@ ENTRY (BP_SYM (memmove)) 2: rep movsl movl %edx, %esi - cfi_restore (esi) movl DEST(%esp), %eax RETURN_BOUNDED_POINTER (DEST(%esp)) popl %edi - cfi_adjust_cfa_offset (-4) - cfi_restore (edi) LEAVE RET_PTR - cfi_adjust_cfa_offset (4) - cfi_rel_offset (edi, 0) - cfi_register (esi, edx) - /* Backward copying. */ 3: std leal -1(%edi, %ecx), %edi @@ -100,14 +90,11 @@ ENTRY (BP_SYM (memmove)) rep movsl movl %edx, %esi - cfi_restore (esi) movl DEST(%esp), %eax RETURN_BOUNDED_POINTER (DEST(%esp)) cld popl %edi - cfi_adjust_cfa_offset (-4) - cfi_restore (edi) LEAVE RET_PTR diff --git a/sysdeps/i386/i686/mempcpy.S b/sysdeps/i386/i686/mempcpy.S index 6437e4a5d4..843a35823a 100644 --- a/sysdeps/i386/i686/mempcpy.S +++ b/sysdeps/i386/i686/mempcpy.S @@ -1,7 +1,7 @@ /* Copy memory block and return pointer to following byte. For Intel 80x86, x>=6. This file is part of the GNU C Library. - Copyright (C) 1998,1999,2000,2002,2004,2005 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000, 2002, 2004 Free Software Foundation, Inc. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998. The GNU C Library is free software; you can redistribute it and/or @@ -43,11 +43,9 @@ ENTRY (BP_SYM (__mempcpy)) movl LEN(%esp), %ecx movl %edi, %eax - cfi_register (edi, eax) movl DEST(%esp), %edi CHECK_BOUNDS_BOTH_WIDE (%edi, DEST(%esp), %ecx) movl %esi, %edx - cfi_register (esi, edx) movl SRC(%esp), %esi CHECK_BOUNDS_BOTH_WIDE (%esi, SRC(%esp), %ecx) cld @@ -60,9 +58,7 @@ ENTRY (BP_SYM (__mempcpy)) 2: rep movsl xchgl %edi, %eax - cfi_restore (edi) movl %edx, %esi - cfi_restore (esi) RETURN_BOUNDED_POINTER (DEST(%esp)) LEAVE diff --git a/sysdeps/i386/i686/memset.S b/sysdeps/i386/i686/memset.S index dfa1aa7019..561188ffec 100644 --- a/sysdeps/i386/i686/memset.S +++ b/sysdeps/i386/i686/memset.S @@ -1,6 +1,6 @@ /* memset/bzero -- set memory area to CH/0 Highly optimized version for ix86, x>=6. - Copyright (C) 1999,2000,2003,2005,2006 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1999. @@ -51,7 +51,6 @@ ENTRY (BP_SYM (memset)) cld pushl %edi - cfi_adjust_cfa_offset (4) movl DEST(%esp), %edx movl LEN(%esp), %ecx CHECK_BOUNDS_BOTH_WIDE (%edx, DEST(%esp), %ecx) @@ -62,19 +61,18 @@ ENTRY (BP_SYM (memset)) #endif jecxz 1f movl %edx, %edi - cfi_rel_offset (edi, 0) andl $3, %edx - jz 2f /* aligned */ - jp 3f /* misaligned at 3, store just one byte below */ - stosb /* misaligned at 1 or 2, store two bytes */ + jz 2f + jnp 3f + stosb decl %ecx jz 1f 3: stosb decl %ecx jz 1f - xorl $1, %edx - jnz 2f /* was misaligned at 2 or 3, now aligned */ - stosb /* was misaligned at 1, store third byte */ + xorl $3, %edx + jz 2f + stosb decl %ecx 2: movl %ecx, %edx shrl $2, %ecx @@ -94,8 +92,6 @@ ENTRY (BP_SYM (memset)) RETURN_BOUNDED_POINTER (DEST(%esp)) #endif popl %edi - cfi_adjust_cfa_offset (-4) - cfi_restore (edi) LEAVE #if BZERO_P @@ -105,9 +101,3 @@ ENTRY (BP_SYM (memset)) #endif END (BP_SYM (memset)) libc_hidden_builtin_def (memset) - -#if defined PIC && !defined NOT_IN_libc && !BZERO_P -strong_alias (__memset_chk, __memset_zero_constant_len_parameter) - .section .gnu.warning.__memset_zero_constant_len_parameter - .string "memset used with constant zero length parameter; this could be due to transposed parameters" -#endif diff --git a/sysdeps/i386/i686/memset_chk.S b/sysdeps/i386/i686/memset_chk.S index cd93d5ee10..d178654994 100644 --- a/sysdeps/i386/i686/memset_chk.S +++ b/sysdeps/i386/i686/memset_chk.S @@ -1,5 +1,5 @@ -/* Checking memset for i686. - Copyright (C) 2004, 2005 Free Software Foundation, Inc. +/* Checking memset for x86-64. + Copyright (C) 2004 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 diff --git a/sysdeps/i386/i686/memusage.h b/sysdeps/i386/i686/memusage.h deleted file mode 100644 index 235c3fc725..0000000000 --- a/sysdeps/i386/i686/memusage.h +++ /dev/null @@ -1,22 +0,0 @@ -/* Copyright (C) 2000, 2005 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. */ - -#define GETSP() ({ register uintptr_t stack_ptr asm ("esp"); stack_ptr; }) -#define GETTIME(low,high) asm ("rdtsc" : "=a" (low), "=d" (high)) - -#include <sysdeps/generic/memusage.h> diff --git a/sysdeps/i386/i686/strtok.S b/sysdeps/i386/i686/strtok.S index fe225e5485..3d81fb6d42 100644 --- a/sysdeps/i386/i686/strtok.S +++ b/sysdeps/i386/i686/strtok.S @@ -1,6 +1,6 @@ /* strtok (str, delim) -- Return next DELIM separated token from STR. For Intel 80686. - Copyright (C) 1998, 2000, 2001, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 1998, 2000, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998. @@ -86,8 +86,6 @@ ENTRY (BP_SYM (FUNCTION)) #if !defined USE_AS_STRTOK_R && defined PIC pushl %ebx /* Save PIC register. */ - cfi_adjust_cfa_offset (4) - cfi_rel_offset (ebx, 0) call 0b addl $_GLOBAL_OFFSET_TABLE_, %ebx #endif @@ -99,7 +97,6 @@ ENTRY (BP_SYM (FUNCTION)) table. */ movl %edi, %edx subl $256, %esp - cfi_adjust_cfa_offset (256) movl $64, %ecx movl %esp, %edi xorl %eax, %eax @@ -250,9 +247,9 @@ L(8): cmpl %eax, %edx cmovne %ecx, %edx /* Store the pointer to the next character. */ -#ifdef USE_AS_STRTOK_R +# ifdef USE_AS_STRTOK_R movl SAVE(%esp), %ecx -#endif +# endif movl %edx, SAVE_PTR CHECK_BOUNDS_HIGH (%edx, SAVE_PTR, jb) RETURN_BOUNDED_POINTER (SAVE_PTR) @@ -260,21 +257,14 @@ L(8): cmpl %eax, %edx L(epilogue): /* Remove the stopset table. */ addl $256, %esp - cfi_adjust_cfa_offset (-256) #if !defined USE_AS_STRTOK_R && defined PIC popl %ebx - cfi_adjust_cfa_offset (-4) - cfi_restore (ebx) #endif LEAVE RET_PTR L(returnNULL): xorl %eax, %eax -#ifdef USE_AS_STRTOK_R - movl SAVE(%esp), %ecx -#endif - movl %edx, SAVE_PTR RETURN_NULL_BOUNDED_POINTER jmp L(epilogue) |