From 5929563ff20245bbaa1b3ca2f4bfcee623ac6fb5 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 31 Mar 1997 22:56:24 +0000 Subject: Update. 1997-04-01 00:37 Ulrich Drepper * math/Makefile: Prevent inlining for test-{float,double,longdouble}. * math/libm-test.c (initialize): Make strings unique and force values to memory. * posix/regex.c: Debug debugging code. * sysdeps/i386/asm-syntax.h: Define `L' macro to emit correct syntax for local label. * sysdeps/i386/add_n.S: Use correct local label syntax for the binary format. * sysdeps/i386/addmul_1.S: Likewise. * sysdeps/i386/lshift.S: Likewise. * sysdeps/i386/memchr.S: Likewise. * sysdeps/i386/memset.S: Likewise. * sysdeps/i386/mul_1.S: Likewise. * sysdeps/i386/rshift.S: Likewise. * sysdeps/i386/stpcpy.S: Likewise. * sysdeps/i386/stpncpy.S: Likewise. * sysdeps/i386/strchr.S: Likewise. * sysdeps/i386/strcspn.S: Likewise. * sysdeps/i386/strlen.S: Likewise. * sysdeps/i386/strpbrk.S: Likewise. * sysdeps/i386/strrchr.S: Likewise. * sysdeps/i386/strspn.S: Likewise. * sysdeps/i386/strtok.S: Likewise. * sysdeps/i386/sub_n.S: Likewise. * sysdeps/i386/submul_1.S: Likewise. * sysdeps/i386/i486/strcat.S: Likewise. * sysdeps/i386/i486/strlen.S: Likewise. * sysdeps/i386/i586/add_n.S: Likewise. * sysdeps/i386/i586/addmul_1.S: Likewise. * sysdeps/i386/i586/lshift.S: Likewise. * sysdeps/i386/i586/memset.S: Likewise. * sysdeps/i386/i586/mul_1.S: Likewise. * sysdeps/i386/i586/rshift.S: Likewise. * sysdeps/i386/i586/strchr.S: Likewise. * sysdeps/i386/i586/strlen.S: Likewise. * sysdeps/i386/i586/sub_n.S: Likewise. * sysdeps/i386/i586/submul_1.S: Likewise. * sysdeps/stub/s_log2l.c: Correct function name. * time/africa: Updated from ADO tzdata1997e. * time/aantarctica: Likewise. * time/asia: Likewise. * time/australia: Likewise. * time/europe: Likewise. * time/northamerica: Likewise. * time/southamerica: Likewise. * time/private.h: Updated from ADO tzcode1997d. * time/scheck.c: Likewise. 1997-03-31 12:42 Ulrich Drepper * sysdeps/unix/sysv/linux/powerpc/Dist: Add kernel_*.h files. 1997-03-23 01:41 Geoff Keating * sysdeps/powerpc/strlen.s: Rewrote for more speed. * string/tst-strlen.c: Also test various string alignments. 1997-03-19 06:11 Geoff Keating * sysdeps/unix/sysv/linux/powerpc/statbuf.h: Removed. * sysdeps/unix/sysv/linux/powerpc/kernel_stat.h: Added. * sysdeps/powerpc/dl-machine.h (ELF_PREFERRED_ADDRESS): Assume program base address is 0x01800000 if we can't otherwise tell what it is. (elf_machine_rela): Replace `assertion failed' with real error messages. * sysdeps/powerpc/dl-machine.h: More comments, more GNU indenting. Put in extra parentheses to make explicit the relative precedence of + and >>. * sysdeps/powerpc/bsd-setjmp.S: Add `__setjmp' symbol so the tests pass. * sysdeps/powerpc/clone.S: Rewrite. Probably still doesn't work. * sysdeps/unix/sysv/linux/powerpc/sys/sysdep.h: Use .section "text" instead of .text. 1997-03-31 02:28 Ulrich Drepper * misc/tst-tsearch.c: Don't write to stderr, write to stdout instead. * inet/inet_ntoa.c (inet_ntoa): Complete rewrite. Now uses thread-specific memory in multi-threaded programs. * sysdeps/stub/s_exp2.c: New file. Stub version for exp2 function. * sysdeps/stub/s_exp2f.c: New file. * sysdeps/stub/s_exp2l.c: New file. Reported by a sun . * sysdeps/unix/sysv/linux/netatalk/atalk.h: Rename to... * sysdeps/unix/sysv/linux/netatalk/at.h: ...this. Suggested by a sun . 1997-03-30 14:53 Ulrich Drepper * sysdeps/unix/sysv/linux/netinet/ip_icmp.h: Add former contents of . Patch by a sun . * sysdeps/powerpc/strlen.S: Added. --- ChangeLog | 111 +++++++++++- PROJECTS | 10 +- inet/inet_ntoa.c | 146 +++++++++------ math/Makefile | 3 + math/libm-test.c | 10 +- misc/tst-tsearch.c | 26 +-- posix/regex.c | 67 +++++-- string/tst-strlen.c | 37 ++-- sysdeps/i386/add_n.S | 48 +++-- sysdeps/i386/addmul_1.S | 34 ++-- sysdeps/i386/asm-syntax.h | 15 ++ sysdeps/i386/i486/strcat.S | 104 +++++------ sysdeps/i386/i486/strlen.S | 86 ++++----- sysdeps/i386/i586/add_n.S | 54 +++--- sysdeps/i386/i586/addmul_1.S | 34 ++-- sysdeps/i386/i586/lshift.S | 54 +++--- sysdeps/i386/i586/memset.S | 47 ++--- sysdeps/i386/i586/mul_1.S | 34 ++-- sysdeps/i386/i586/rshift.S | 82 +++++---- sysdeps/i386/i586/strchr.S | 89 ++++----- sysdeps/i386/i586/strlen.S | 45 ++--- sysdeps/i386/i586/sub_n.S | 54 +++--- sysdeps/i386/i586/submul_1.S | 34 ++-- sysdeps/i386/lshift.S | 44 +++-- sysdeps/i386/memchr.S | 96 +++++----- sysdeps/i386/memcmp.S | 35 ++-- sysdeps/i386/memset.c | 34 ++-- sysdeps/i386/mul_1.S | 34 ++-- sysdeps/i386/rshift.S | 44 +++-- sysdeps/i386/stpcpy.S | 21 +-- sysdeps/i386/stpncpy.S | 54 +++--- sysdeps/i386/strchr.S | 82 ++++----- sysdeps/i386/strcspn.S | 30 +-- sysdeps/i386/strlen.c | 29 ++- sysdeps/i386/strpbrk.S | 72 ++++---- sysdeps/i386/strrchr.S | 124 ++++++------- sysdeps/i386/strspn.S | 30 +-- sysdeps/i386/strtok.S | 102 ++++++----- sysdeps/i386/sub_n.S | 44 +++-- sysdeps/i386/submul_1.S | 34 ++-- sysdeps/libm-ieee754/s_cexp.c | 32 +++- sysdeps/powerpc/bsd-setjmp.S | 7 +- sysdeps/powerpc/dl-machine.h | 201 ++++++++++++++------- sysdeps/powerpc/elf/start.c | 1 + sysdeps/powerpc/strlen.S | 52 ------ sysdeps/stub/s_exp2.c | 12 ++ sysdeps/stub/s_exp2f.c | 12 ++ sysdeps/stub/s_exp2l.c | 12 ++ sysdeps/stub/s_log2l.c | 3 +- sysdeps/unix/sysv/linux/netatalk/at.h | 27 +++ sysdeps/unix/sysv/linux/netatalk/atalk.h | 27 --- sysdeps/unix/sysv/linux/netinet/ip_icmp.h | 105 +++++++++-- sysdeps/unix/sysv/linux/powerpc/Dist | 3 + sysdeps/unix/sysv/linux/powerpc/clone.S | 48 +++-- sysdeps/unix/sysv/linux/powerpc/kernel_stat.h | 45 +++++ sysdeps/unix/sysv/linux/powerpc/statbuf.h | 79 -------- .../unix/sysv/linux/powerpc/sys/kernel_termios.h | 43 +++++ sysdeps/unix/sysv/linux/powerpc/sysdep.h | 3 +- time/africa | 18 +- time/antarctica | 26 ++- time/asia | 91 ++++------ time/australasia | 21 ++- time/europe | 18 +- time/northamerica | 8 +- time/private.h | 15 +- time/scheck.c | 2 +- time/southamerica | 9 +- 67 files changed, 1729 insertions(+), 1324 deletions(-) delete mode 100644 sysdeps/powerpc/strlen.S create mode 100644 sysdeps/stub/s_exp2.c create mode 100644 sysdeps/stub/s_exp2f.c create mode 100644 sysdeps/stub/s_exp2l.c create mode 100644 sysdeps/unix/sysv/linux/netatalk/at.h delete mode 100644 sysdeps/unix/sysv/linux/netatalk/atalk.h create mode 100644 sysdeps/unix/sysv/linux/powerpc/kernel_stat.h delete mode 100644 sysdeps/unix/sysv/linux/powerpc/statbuf.h create mode 100644 sysdeps/unix/sysv/linux/powerpc/sys/kernel_termios.h diff --git a/ChangeLog b/ChangeLog index 05c48391f3..bd661db53e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,111 @@ +1997-04-01 00:37 Ulrich Drepper + + * math/Makefile: Prevent inlining for test-{float,double,longdouble}. + * math/libm-test.c (initialize): Make strings unique and force + values to memory. + + * posix/regex.c: Debug debugging code. + + * sysdeps/i386/asm-syntax.h: Define `L' macro to emit correct + syntax for local label. + * sysdeps/i386/add_n.S: Use correct local label syntax for the + binary format. + * sysdeps/i386/addmul_1.S: Likewise. + * sysdeps/i386/lshift.S: Likewise. + * sysdeps/i386/memchr.S: Likewise. + * sysdeps/i386/memset.S: Likewise. + * sysdeps/i386/mul_1.S: Likewise. + * sysdeps/i386/rshift.S: Likewise. + * sysdeps/i386/stpcpy.S: Likewise. + * sysdeps/i386/stpncpy.S: Likewise. + * sysdeps/i386/strchr.S: Likewise. + * sysdeps/i386/strcspn.S: Likewise. + * sysdeps/i386/strlen.S: Likewise. + * sysdeps/i386/strpbrk.S: Likewise. + * sysdeps/i386/strrchr.S: Likewise. + * sysdeps/i386/strspn.S: Likewise. + * sysdeps/i386/strtok.S: Likewise. + * sysdeps/i386/sub_n.S: Likewise. + * sysdeps/i386/submul_1.S: Likewise. + * sysdeps/i386/i486/strcat.S: Likewise. + * sysdeps/i386/i486/strlen.S: Likewise. + * sysdeps/i386/i586/add_n.S: Likewise. + * sysdeps/i386/i586/addmul_1.S: Likewise. + * sysdeps/i386/i586/lshift.S: Likewise. + * sysdeps/i386/i586/memset.S: Likewise. + * sysdeps/i386/i586/mul_1.S: Likewise. + * sysdeps/i386/i586/rshift.S: Likewise. + * sysdeps/i386/i586/strchr.S: Likewise. + * sysdeps/i386/i586/strlen.S: Likewise. + * sysdeps/i386/i586/sub_n.S: Likewise. + * sysdeps/i386/i586/submul_1.S: Likewise. + + * sysdeps/stub/s_log2l.c: Correct function name. + + * time/africa: Updated from ADO tzdata1997e. + * time/aantarctica: Likewise. + * time/asia: Likewise. + * time/australia: Likewise. + * time/europe: Likewise. + * time/northamerica: Likewise. + * time/southamerica: Likewise. + * time/private.h: Updated from ADO tzcode1997d. + * time/scheck.c: Likewise. + +1997-03-31 12:42 Ulrich Drepper + + * sysdeps/unix/sysv/linux/powerpc/Dist: Add kernel_*.h files. + +1997-03-23 01:41 Geoff Keating + + * sysdeps/powerpc/strlen.s: Rewrote for more speed. + * string/tst-strlen.c: Also test various string alignments. + +1997-03-19 06:11 Geoff Keating + + * sysdeps/unix/sysv/linux/powerpc/statbuf.h: Removed. + * sysdeps/unix/sysv/linux/powerpc/kernel_stat.h: Added. + + * sysdeps/powerpc/dl-machine.h (ELF_PREFERRED_ADDRESS): Assume + program base address is 0x01800000 if we can't otherwise tell what + it is. + (elf_machine_rela): Replace `assertion failed' with real error + messages. + + * sysdeps/powerpc/dl-machine.h: More comments, more GNU indenting. + Put in extra parentheses to make explicit the relative precedence + of + and >>. + + * sysdeps/powerpc/bsd-setjmp.S: Add `__setjmp' symbol so the tests + pass. + * sysdeps/powerpc/clone.S: Rewrite. Probably still doesn't work. + + * sysdeps/unix/sysv/linux/powerpc/sys/sysdep.h: Use .section "text" + instead of .text. + +1997-03-31 02:28 Ulrich Drepper + + * misc/tst-tsearch.c: Don't write to stderr, write to stdout + instead. + + * inet/inet_ntoa.c (inet_ntoa): Complete rewrite. Now uses + thread-specific memory in multi-threaded programs. + + * sysdeps/stub/s_exp2.c: New file. Stub version for exp2 function. + * sysdeps/stub/s_exp2f.c: New file. + * sysdeps/stub/s_exp2l.c: New file. + Reported by a sun . + + * sysdeps/unix/sysv/linux/netatalk/atalk.h: Rename to... + * sysdeps/unix/sysv/linux/netatalk/at.h: ...this. + Suggested by a sun . + +1997-03-30 14:53 Ulrich Drepper + + * sysdeps/unix/sysv/linux/netinet/ip_icmp.h: Add former contents + of . + Patch by a sun . + 1997-03-30 03:42 Ulrich Drepper * math/libm-test.c: Add definition of ctanh_test, clog_test, and @@ -1418,7 +1526,7 @@ * sysdeps/powerpc/fpu_control.h: Added. * sysdeps/powerpc/jmp_buf.h: Added. * sysdeps/powerpc/setjmp.S: Added. - * sysdeps/powerpc/strlen.s: Added. + * sysdeps/powerpc/strlen.S: Added. * sysdeps/powerpc/elf/start.c: Added. * sysdeps/powerpc/fpu_control.h: Added. * sysdeps/powerpc/jmp_buf.h: Added. @@ -1437,7 +1545,6 @@ * sysdeps/unix/sysv/linux/powerpc/sysdep.c: Added. * sysdeps/unix/sysv/linux/powerpc/sysdep.h: Added. * sysdeps/unix/sysv/linux/powerpc/termbits.h: Added. - * sysdeps/unix/sysv/linux/powerpc/sys/syscall.h: Added. 1997-03-05 05:24 Geoff Keating diff --git a/PROJECTS b/PROJECTS index 394b18efdf..6b381f7ceb 100644 --- a/PROJECTS +++ b/PROJECTS @@ -58,6 +58,13 @@ contact - exp2 - log2 + - nearbyint + - ceil + - round + - rinttol + - rinttoll + - roundtol + - roundtoll each with float, double, and long double arguments. Writing these functions should be possible when following the implementation of @@ -68,7 +75,6 @@ contact implementation should be possible today. I mention here the names and the way to write them (argument is z = x + iy): - - cexp(z) = e^x (cos y + i sin y) - sin(z) = 1/(2i) (e^(iz) - e^-(iz)) = sin(x) cosh(y) + i cos(x) sinh(y) - cos(z) = 1/2 (e^(iz) + e^-(iz)) = cos(x) cosh(y) - i sin(x) sinh(y) - tan(z) = 1/i (e^(iz) - e^-(iz))/(e^(iz) + e^-(iz)) @@ -77,8 +83,6 @@ contact - acos(z) = -i ln(z + sqrt(z^2-1)) - atan(z) = 1/(2i) ln((1+iz)/(1-iz)) - acot(z) = -1/(2i) ln((iz+1)/(iz-1)) - - sinh(z) = 1/2 (e^z - e^-z) - - cosh(z) = 1/2 (e^z + e^-z) - tanh(z) = (e^z - e^-z)/(e^z + e^-z) - coth(z) = (e^z + e^-z)/(e^z - e^-z) diff --git a/inet/inet_ntoa.c b/inet/inet_ntoa.c index a37b1dbeef..b6087a982f 100644 --- a/inet/inet_ntoa.c +++ b/inet/inet_ntoa.c @@ -1,59 +1,97 @@ -/* - * Copyright (c) 1983, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)inet_ntoa.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ - -/* - * Convert network-format internet address - * to base 256 d.d.d.d representation. - */ -#include -#include -#include +/* Convert Inet number to ASCII representation. + Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C 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 +#include +#include +#include + +/* The interface of this function is completely stupid, it requires a + static buffer. We relax this a bit in that we allow at least one + buffer for each thread. */ +__libc_lock_define_initialized (static, lock); + +/* This is the key for the thread specific memory. */ +static __libc_key_t key; + +/* Destructor for the thread-specific data. */ +static void free_key_mem (void *mem); + char * -inet_ntoa(in) - struct in_addr in; +inet_ntoa (struct in_addr in) { - static char b[18]; - register char *p; - - p = (char *)∈ -#define UC(b) (((int)b)&0xff) - (void)snprintf(b, sizeof(b), - "%d.%d.%d.%d", UC(p[0]), UC(p[1]), UC(p[2]), UC(p[3])); - return (b); + static char static_buf[18]; + static int initialized = 0; + char *buffer = NULL; + unsigned char *bytes; + + /* If we have not yet initialized the buffer do it now. */ + if (!initialized) + { + /* Make sure there is only one process doing the initialization. */ + __libc_lock_lock (lock); + + if (!initialized) + { + if (__libc_key_create (&key, free_key_mem)) + /* Creating the key failed. This either means we run + have only a single-threaded application or something + really went wrong. In any case use a static buffer + which is better than nothing. */ + buffer = static_buf; + } + + __libc_lock_unlock (lock); + } + + if (buffer == NULL) + { + /* We don't use the static buffer and so we have a key. Use it + to get the thread-specific buffer. */ + buffer = __libc_getspecific (key); + if (buffer == NULL) + { + /* No buffer allocated so far. */ + buffer = malloc (18); + if (buffer == NULL) + /* No more memory available. We use the static buffer. */ + buffer = static_buf; + else + __libc_setspecific (key, buffer); + } + } + + bytes = (unsigned char *) ∈ + snprintf (buffer, 18, "%d.%d.%d.%d", bytes[0], bytes[1], bytes[2], bytes[3]); + + return buffer; +} + + +static void +free_key_mem (void *mem) +{ + free (mem); + + /* And we must set the data to NULL so that the destructor is not + called again. */ + __libc_setspecific (key, NULL); } diff --git a/math/Makefile b/math/Makefile index 12967ffac5..0bf27c8065 100644 --- a/math/Makefile +++ b/math/Makefile @@ -73,6 +73,9 @@ tests = test-float test-double $(test-longdouble-$(long-double-fcts)) # XXX This test is disabled for now since the functions are too buggy. #test-longdouble-yes = test-longdouble +CFLAGS-test-float.c = -fno-inline +CFLAGS-test-double.c = -fno-inline +CFLAGS-test-longdouble.c = -fno-inline LDLIBS-test-float = libm LDLIBS-test-double = libm LDLIBS-test-longdouble = libm diff --git a/math/libm-test.c b/math/libm-test.c index a555d0b423..1271177236 100644 --- a/math/libm-test.c +++ b/math/libm-test.c @@ -2947,7 +2947,7 @@ basic_tests (void) static void initialize (void) { - fpstack_test ("*init*"); + fpstack_test ("start *init*"); plus_zero = 0.0; nan_value = plus_zero / plus_zero; /* Suppress GCC warning */ @@ -2955,8 +2955,14 @@ initialize (void) plus_infty = CHOOSE (HUGE_VALL, HUGE_VAL, HUGE_VALF); minus_infty = -CHOOSE (HUGE_VALL, HUGE_VAL, HUGE_VALF); + (void) &plus_zero; + (void) &nan_value; + (void) &minus_zero; + (void) &plus_infty; + (void) &minus_infty; + /* Test to make sure we start correctly. */ - fpstack_test ("*init*"); + fpstack_test ("end *init*"); } diff --git a/misc/tst-tsearch.c b/misc/tst-tsearch.c index eca11cbb95..d7551ff3eb 100644 --- a/misc/tst-tsearch.c +++ b/misc/tst-tsearch.c @@ -112,7 +112,7 @@ walk_action (const void *nodep, const VISIT which, const int depth) if (depths[key] != depth) { fputs ("Depth for one element is not constant during tree walk.\n", - stderr); + stdout); } } } @@ -129,7 +129,7 @@ walk_tree (void *root, int expected_count) for (i = 0; i < expected_count; ++i) if (z[i] != 1) { - fputs ("Node was not visited.\n", stderr); + fputs ("Node was not visited.\n", stdout); error = 1; } @@ -139,7 +139,7 @@ walk_tree (void *root, int expected_count) if (max_depth > expected_count) #endif { - fputs ("Depth too large during tree walk.\n", stderr); + fputs ("Depth too large during tree walk.\n", stdout); error = 1; } } @@ -196,7 +196,7 @@ mangle_tree (enum order how, enum action what, void **root, int lag) { if (tfind (x + j, (const void **) root, cmp_fn) != NULL) { - fputs ("Found element which is not in tree yet.\n", stderr); + fputs ("Found element which is not in tree yet.\n", stdout); error = 1; } elem = tsearch (x + j, root, cmp_fn); @@ -204,7 +204,7 @@ mangle_tree (enum order how, enum action what, void **root, int lag) || tfind (x + j, (const void **) root, cmp_fn) == NULL) { fputs ("Couldn't find element after it was added.\n", - stderr); + stdout); error = 1; } } @@ -219,7 +219,7 @@ mangle_tree (enum order how, enum action what, void **root, int lag) elem = tfind (x + j, (const void **) root, cmp_fn); if (elem == NULL || tdelete (x + j, root, cmp_fn) == NULL) { - fputs ("Error deleting element.\n", stderr); + fputs ("Error deleting element.\n", stdout); error = 1; } break; @@ -227,7 +227,7 @@ mangle_tree (enum order how, enum action what, void **root, int lag) case find: if (tfind (x + j, (const void **) root, cmp_fn) == NULL) { - fputs ("Couldn't find element after it was added.\n", stderr); + fputs ("Couldn't find element after it was added.\n", stdout); error = 1; } break; @@ -252,10 +252,10 @@ main (int argc, char **argv) /* Do this loop several times to get different permutations for the random case. */ - fputs ("Series I\n", stderr); + fputs ("Series I\n", stdout); for (i = 0; i < PASSES; ++i) { - fprintf (stderr, "Pass %d... ", i + 1); + fprintf (stdout, "Pass %d... ", i + 1); fflush (stdout); error = 0; @@ -301,14 +301,14 @@ main (int argc, char **argv) mangle_tree (randomorder, build_and_del, &root, j); } - fputs (error ? " failed!\n" : " ok.\n", stderr); + fputs (error ? " failed!\n" : " ok.\n", stdout); total_error |= error; } - fputs ("Series II\n", stderr); + fputs ("Series II\n", stdout); for (i = 1; i < SIZE; i *= 2) { - fprintf (stderr, "For size %d... ", i); + fprintf (stdout, "For size %d... ", i); fflush (stdout); error = 0; @@ -321,7 +321,7 @@ main (int argc, char **argv) mangle_tree (ascending, build_and_del, &root, i); mangle_tree (descending, build_and_del, &root, i); - fputs (error ? " failed!\n" : " ok.\n", stderr); + fputs (error ? " failed!\n" : " ok.\n", stdout); total_error |= error; } diff --git a/posix/regex.c b/posix/regex.c index 202ee19c86..b7c82f633e 100644 --- a/posix/regex.c +++ b/posix/regex.c @@ -618,6 +618,7 @@ print_partial_compiled_pattern (start, end) unsigned char *end; { int mcnt, mcnt2; + unsigned char *p1; unsigned char *p = start; unsigned char *pend = end; @@ -759,20 +760,23 @@ print_partial_compiled_pattern (start, end) case succeed_n: extract_number_and_incr (&mcnt, &p); + p1 = p + mcnt; extract_number_and_incr (&mcnt2, &p); - printf ("/succeed_n to %d, %d times", p + mcnt - start, mcnt2); + printf ("/succeed_n to %d, %d times", p1 - start, mcnt2); break; case jump_n: extract_number_and_incr (&mcnt, &p); + p1 = p + mcnt; extract_number_and_incr (&mcnt2, &p); - printf ("/jump_n to %d, %d times", p + mcnt - start, mcnt2); + printf ("/jump_n to %d, %d times", p1 - start, mcnt2); break; case set_number_at: extract_number_and_incr (&mcnt, &p); + p1 = p + mcnt; extract_number_and_incr (&mcnt2, &p); - printf ("/set_number_at location %d to %d", p + mcnt - start, mcnt2); + printf ("/set_number_at location %d to %d", p1 - start, mcnt2); break; case wordbound: @@ -850,7 +854,8 @@ print_compiled_pattern (bufp) unsigned char *buffer = bufp->buffer; print_partial_compiled_pattern (buffer, buffer + bufp->used); - printf ("%d bytes used/%d bytes allocated.\n", bufp->used, bufp->allocated); + printf ("%ld bytes used/%ld bytes allocated.\n", + bufp->used, bufp->allocated); if (bufp->fastmap_accurate && bufp->fastmap) { @@ -865,7 +870,7 @@ print_compiled_pattern (bufp) printf ("no_sub: %d\t", bufp->no_sub); printf ("not_bol: %d\t", bufp->not_bol); printf ("not_eol: %d\t", bufp->not_eol); - printf ("syntax: %d\n", bufp->syntax); + printf ("syntax: %lx\n", bufp->syntax); /* Perhaps we should print the translate table? */ } @@ -878,7 +883,7 @@ print_double_string (where, string1, size1, string2, size2) int size1; int size2; { - unsigned this_char; + int this_char; if (where == NULL) printf ("(null)"); @@ -1245,7 +1250,7 @@ typedef struct DEBUG_PRINT2 (" Pushing high active reg: %d\n", highest_active_reg);\ PUSH_FAILURE_INT (highest_active_reg); \ \ - DEBUG_PRINT2 (" Pushing pattern 0x%x: ", pattern_place); \ + DEBUG_PRINT2 (" Pushing pattern 0x%x:\n", pattern_place); \ DEBUG_PRINT_COMPILED_PATTERN (bufp, pattern_place, pend); \ PUSH_FAILURE_POINTER (pattern_place); \ \ @@ -1329,7 +1334,7 @@ typedef struct DEBUG_PRINT1 ("'\n"); \ \ pat = (unsigned char *) POP_FAILURE_POINTER (); \ - DEBUG_PRINT2 (" Popping pattern 0x%x: ", pat); \ + DEBUG_PRINT2 (" Popping pattern 0x%x:\n", pat); \ DEBUG_PRINT_COMPILED_PATTERN (bufp, pat, pend); \ \ /* Restore register info. */ \ @@ -3882,7 +3887,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop) dend = end_match_2; } - DEBUG_PRINT1 ("The compiled pattern is: "); + DEBUG_PRINT1 ("The compiled pattern is:\n"); DEBUG_PRINT_COMPILED_PATTERN (bufp, p, pend); DEBUG_PRINT1 ("The string to match is: `"); DEBUG_PRINT_DOUBLE_STRING (d, string1, size1, string2, size2); @@ -3893,7 +3898,11 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop) fails at this starting point in the input data. */ for (;;) { +#ifdef _LIBC + DEBUG_PRINT2 ("\n%p: ", p); +#else DEBUG_PRINT2 ("\n0x%x: ", p); +#endif if (p == pend) { /* End of pattern means we might have succeeded. */ @@ -4472,7 +4481,11 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop) DEBUG_PRINT1 ("EXECUTING on_failure_keep_string_jump"); EXTRACT_NUMBER_AND_INCR (mcnt, p); +#ifdef _LIBC + DEBUG_PRINT3 (" %d (to %p):\n", mcnt, p + mcnt); +#else DEBUG_PRINT3 (" %d (to 0x%x):\n", mcnt, p + mcnt); +#endif PUSH_FAILURE_POINT (p + mcnt, NULL, -2); break; @@ -4495,7 +4508,11 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop) DEBUG_PRINT1 ("EXECUTING on_failure_jump"); EXTRACT_NUMBER_AND_INCR (mcnt, p); +#ifdef _LIBC + DEBUG_PRINT3 (" %d (to %p)", mcnt, p + mcnt); +#else DEBUG_PRINT3 (" %d (to 0x%x)", mcnt, p + mcnt); +#endif /* If this on_failure_jump comes right before a group (i.e., the original * applied to a group), save the information @@ -4708,16 +4725,25 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop) dummy_low_reg, dummy_high_reg, reg_dummy, reg_dummy, reg_info_dummy); } - /* Note fall through. */ + unconditional_jump: +#ifdef _LIBC + DEBUG_PRINT2 ("\n%p: ", p); +#else + DEBUG_PRINT2 ("\n0x%x: ", p); +#endif + /* Note fall through. */ /* Unconditionally jump (without popping any failure points). */ case jump: - unconditional_jump: EXTRACT_NUMBER_AND_INCR (mcnt, p); /* Get the amount to jump. */ DEBUG_PRINT2 ("EXECUTING jump %d ", mcnt); p += mcnt; /* Do the jump. */ +#ifdef _LIBC + DEBUG_PRINT2 ("(to %p).\n", p); +#else DEBUG_PRINT2 ("(to 0x%x).\n", p); +#endif break; @@ -4766,11 +4792,19 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop) mcnt--; p += 2; STORE_NUMBER_AND_INCR (p, mcnt); - DEBUG_PRINT3 (" Setting 0x%x to %d.\n", p, mcnt); +#ifdef _LIBC + DEBUG_PRINT3 (" Setting %p to %d.\n", p - 2, mcnt); +#else + DEBUG_PRINT3 (" Setting 0x%x to %d.\n", p - 2, mcnt); +#endif } else if (mcnt == 0) { +#ifdef _LIBC + DEBUG_PRINT2 (" Setting two bytes from %p to no_op.\n", p+2); +#else DEBUG_PRINT2 (" Setting two bytes from 0x%x to no_op.\n", p+2); +#endif p[2] = (unsigned char) no_op; p[3] = (unsigned char) no_op; goto on_failure; @@ -4786,6 +4820,11 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop) { mcnt--; STORE_NUMBER (p + 2, mcnt); +#ifdef _LIBC + DEBUG_PRINT3 (" Setting %p to %d.\n", p + 2, mcnt); +#else + DEBUG_PRINT3 (" Setting 0x%x to %d.\n", p + 2, mcnt); +#endif goto unconditional_jump; } /* If don't have to jump any more, skip over the rest of command. */ @@ -4800,7 +4839,11 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop) EXTRACT_NUMBER_AND_INCR (mcnt, p); p1 = p + mcnt; EXTRACT_NUMBER_AND_INCR (mcnt, p); +#ifdef _LIBC + DEBUG_PRINT3 (" Setting %p to %d.\n", p1, mcnt); +#else DEBUG_PRINT3 (" Setting 0x%x to %d.\n", p1, mcnt); +#endif STORE_NUMBER (p1, mcnt); break; } diff --git a/string/tst-strlen.c b/string/tst-strlen.c index 6651035a6a..b9efe1da29 100644 --- a/string/tst-strlen.c +++ b/string/tst-strlen.c @@ -6,26 +6,33 @@ main(int argc, char *argv[]) { static const size_t lens[] = { 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4 }; - char buf[24]; - size_t words; + char basebuf[24 + 32]; + size_t base; - for (words = 0; words < 4; ++words) + for (base = 0; base < 32; ++base) { - size_t last; - memset (buf, 'a', words * 4); + char *buf = basebuf + base; + size_t words; - for (last = 0; last < 16; ++last) - { - buf[words * 4 + 0] = (last & 1) != 0 ? 'b' : '\0'; - buf[words * 4 + 1] = (last & 2) != 0 ? 'c' : '\0'; - buf[words * 4 + 2] = (last & 4) != 0 ? 'd' : '\0'; - buf[words * 4 + 3] = (last & 8) != 0 ? 'e' : '\0'; - buf[words * 4 + 4] = '\0'; + for (words = 0; words < 4; ++words) + { + size_t last; + memset (buf, 'a', words * 4); - if (strlen (buf) != words * 4 + lens[last]) + for (last = 0; last < 16; ++last) { - printf ("failed for words=%d and last=%d\n", words, last); - return 1; + buf[words * 4 + 0] = (last & 1) != 0 ? 'b' : '\0'; + buf[words * 4 + 1] = (last & 2) != 0 ? 'c' : '\0'; + buf[words * 4 + 2] = (last & 4) != 0 ? 'd' : '\0'; + buf[words * 4 + 3] = (last & 8) != 0 ? 'e' : '\0'; + buf[words * 4 + 4] = '\0'; + + if (strlen (buf) != words * 4 + lens[last]) + { + printf ("failed for base=%d, words=%d, and last=%d\n", + base, words, last); + return 1; + } } } } diff --git a/sysdeps/i386/add_n.S b/sysdeps/i386/add_n.S index 9c1b133226..a68fe2ed39 100644 --- a/sysdeps/i386/add_n.S +++ b/sysdeps/i386/add_n.S @@ -1,24 +1,22 @@ -/* i80386 __mpn_add_n -- Add two limb vectors of the same length > 0 and store -sum in a third limb vector. +/* Add two limb vectors of the same length > 0 and store sum in a third + limb vector. + Copyright (C) 1992, 1994, 1995, 1997 Free Software Foundation, Inc. + This file is part of the GNU MP Library. -Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc. + The GNU MP Library is free software; you can redistribute it and/or modify + it under the terms of the GNU Library General Public License as published by + the Free Software Foundation; either version 2 of the License, or (at your + option) any later version. -This file is part of the GNU MP Library. + 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 Library General Public + License for more details. -The GNU MP Library is free software; you can redistribute it and/or modify -it under the terms of the GNU Library General Public License as published by -the Free Software Foundation; either version 2 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 Library General Public -License for more details. - -You should have received a copy of the GNU Library 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. */ + You should have received a copy of the GNU Library 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. */ /* INPUT PARAMETERS @@ -47,7 +45,7 @@ C_SYMBOL_NAME(__mpn_add_n:) shrl $3,%ecx /* compute count for unrolled loop */ negl %eax andl $7,%eax /* get index where to start loop */ - jz Loop /* necessary special case for 0 */ + jz L(oop) /* necessary special case for 0 */ incl %ecx /* adjust loop count */ shll $2,%eax /* adjustment for pointers... */ subl %eax,%edi /* ... since they are offset ... */ @@ -57,18 +55,18 @@ C_SYMBOL_NAME(__mpn_add_n:) #ifdef PIC /* Calculate start address in loop for PIC. Due to limitations in some assemblers, Loop-L0-3 cannot be put into the leal */ - call L0 -L0: leal (%eax,%eax,8),%eax + call L(0) +L(0): leal (%eax,%eax,8),%eax addl (%esp),%eax - addl $(Loop-L0-3),%eax + addl $(L(oop)-L(0)-3),%eax addl $4,%esp #else /* Calculate start address in loop for non-PIC. */ - leal (Loop - 3)(%eax,%eax,8),%eax + leal (L(oop) - 3)(%eax,%eax,8),%eax #endif jmp *%eax /* jump into loop */ ALIGN (3) -Loop: movl (%esi),%eax +L(oop): movl (%esi),%eax adcl (%edx),%eax movl %eax,(%edi) movl 4(%esi),%eax @@ -96,7 +94,7 @@ Loop: movl (%esi),%eax leal 32(%esi),%esi leal 32(%edx),%edx decl %ecx - jnz Loop + jnz L(oop) sbbl %eax,%eax negl %eax diff --git a/sysdeps/i386/addmul_1.S b/sysdeps/i386/addmul_1.S index c11209d925..3e2c5cd616 100644 --- a/sysdeps/i386/addmul_1.S +++ b/sysdeps/i386/addmul_1.S @@ -1,24 +1,22 @@ /* i80386 __mpn_addmul_1 -- Multiply a limb vector with a limb and add the result to a second limb vector. + Copyright (C) 1992, 1994, 1997 Free Software Foundation, Inc. + This file is part of the GNU MP Library. -Copyright (C) 1992, 1994 Free Software Foundation, Inc. + The GNU MP Library is free software; you can redistribute it and/or modify + it under the terms of the GNU Library General Public License as published by + the Free Software Foundation; either version 2 of the License, or (at your + option) any later version. -This file is part of the GNU MP Library. + 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 Library General Public + License for more details. -The GNU MP Library is free software; you can redistribute it and/or modify -it under the terms of the GNU Library General Public License as published by -the Free Software Foundation; either version 2 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 Library General Public -License for more details. - -You should have received a copy of the GNU Library 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. */ + You should have received a copy of the GNU Library 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. */ /* INPUT PARAMETERS @@ -56,7 +54,7 @@ C_SYMBOL_NAME(__mpn_addmul_1:) INSN1(neg,l ,R(size)) INSN2(xor,l ,R(ebx),R(ebx)) ALIGN (3) -Loop: +L(oop): INSN2(mov,l ,R(eax),MEM_INDEX(s1_ptr,size,4)) INSN1(mul,l ,R(s2_limb)) INSN2(add,l ,R(eax),R(ebx)) @@ -66,7 +64,7 @@ Loop: INSN2(mov,l ,R(ebx),R(edx)) INSN1(inc,l ,R(size)) - INSN1(jnz, ,Loop) + INSN1(jnz, ,L(oop)) INSN2(mov,l ,R(eax),R(ebx)) INSN1(pop,l ,R(ebp)) diff --git a/sysdeps/i386/asm-syntax.h b/sysdeps/i386/asm-syntax.h index fe3995f177..68c7b0e584 100644 --- a/sysdeps/i386/asm-syntax.h +++ b/sysdeps/i386/asm-syntax.h @@ -63,3 +63,18 @@ #undef ALIGN #define ALIGN(log) .align 1<=4. - Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. + Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper . Optimised a little by Alan Modra @@ -37,35 +37,35 @@ ENTRY (strcat) movl 8(%esp), %edx /* load destination pointer */ testb $0xff, (%ecx) /* Is source string empty? */ - jz L8 /* yes => return */ + jz L(8) /* yes => return */ /* Test the first bytes separately until destination is aligned. */ testl $3, %edx /* destination pointer aligned? */ - jz L1 /* yes => begin scan loop */ + jz L(1) /* yes => begin scan loop */ testb $0xff, (%edx) /* is end of string? */ - jz L2 /* yes => start appending */ + jz L(2) /* yes => start appending */ incl %edx /* increment source pointer */ testl $3, %edx /* destination pointer aligned? */ - jz L1 /* yes => begin scan loop */ + jz L(1) /* yes => begin scan loop */ testb $0xff, (%edx) /* is end of string? */ - jz L2 /* yes => start appending */ + jz L(2) /* yes => start appending */ incl %edx /* increment source pointer */ testl $3, %edx /* destination pointer aligned? */ - jz L1 /* yes => begin scan loop */ + jz L(1) /* yes => begin scan loop */ testb $0xff, (%edx) /* is end of string? */ - jz L2 /* yes => start appending */ + jz L(2) /* yes => start appending */ incl %edx /* increment source pointer */ /* Now we are aligned. Begin scan loop. */ - jmp L1 + jmp L(1) ALIGN(4) -L4: addl $16,%edx /* increment destination pointer for round */ +L(4): addl $16,%edx /* increment destination pointer for round */ -L1: movl (%edx), %eax /* get word (= 4 bytes) in question */ +L(1): movl (%edx), %eax /* get word (= 4 bytes) in question */ movl $0xfefefeff, %edi /* magic value */ /* If you compare this with the algorithm in memchr.S you will @@ -83,7 +83,7 @@ L1: movl (%edx), %eax /* get word (= 4 bytes) in question */ representation with more than 32 bits) not alter then last overflow, we can now test this condition. If no carry is signaled no overflow must have occurred in the last byte => it was 0. */ - jnc L3 + jnc L(3) /* We are only interested in carry bits that change due to the previous add, so remove original bits */ @@ -95,106 +95,106 @@ L1: movl (%edx), %eax /* get word (= 4 bytes) in question */ the addition will not result in 0. */ /* If at least one byte of the word is C we don't get 0 in %ecx. */ - jnz L3 + jnz L(3) movl 4(%edx), %eax /* get word from source */ movl $0xfefefeff, %edi /* magic value */ addl %eax, %edi /* add the magic value to the word. We get carry bits reported for each byte which is *not* 0 */ - jnc L5 /* highest byte is C => stop copying */ + jnc L(5) /* highest byte is C => stop copying */ xorl %eax, %edi /* ((word^charmask)+magic)^(word^charmask) */ orl $0xfefefeff, %edi /* set all non-carry bits */ incl %edi /* add 1: if one carry bit was *not* set the addition will not result in 0. */ - jnz L5 /* one byte is NUL => stop copying */ + jnz L(5) /* one byte is NUL => stop copying */ movl 8(%edx), %eax /* get word from source */ movl $0xfefefeff, %edi /* magic value */ addl %eax, %edi /* add the magic value to the word. We get carry bits reported for each byte which is *not* 0 */ - jnc L6 /* highest byte is C => stop copying */ + jnc L(6) /* highest byte is C => stop copying */ xorl %eax, %edi /* ((word^charmask)+magic)^(word^charmask) */ orl $0xfefefeff, %edi /* set all non-carry bits */ incl %edi /* add 1: if one carry bit was *not* set the addition will not result in 0. */ - jnz L6 /* one byte is NUL => stop copying */ + jnz L(6) /* one byte is NUL => stop copying */ movl 12(%edx), %eax /* get word from source */ movl $0xfefefeff, %edi /* magic value */ addl %eax, %edi /* add the magic value to the word. We get carry bits reported for each byte which is *not* 0 */ - jnc L7 /* highest byte is C => stop copying */ + jnc L(7) /* highest byte is C => stop copying */ xorl %eax, %edi /* ((word^charmask)+magic)^(word^charmask) */ orl $0xfefefeff, %edi /* set all non-carry bits */ incl %edi /* add 1: if one carry bit was *not* set the addition will not result in 0. */ - jz L4 /* no byte is NUL => carry on copying */ + jz L(4) /* no byte is NUL => carry on copying */ -L7: addl $4, %edx /* adjust source pointer */ -L6: addl $4, %edx -L5: addl $4, %edx +L(7): addl $4, %edx /* adjust source pointer */ +L(6): addl $4, %edx +L(5): addl $4, %edx -L3: testb %al, %al /* is first byte NUL? */ - jz L2 /* yes => start copying */ +L(3): testb %al, %al /* is first byte NUL? */ + jz L(2) /* yes => start copying */ incl %edx /* increment source pointer */ testb %ah, %ah /* is second byte NUL? */ - jz L2 /* yes => start copying */ + jz L(2) /* yes => start copying */ incl %edx /* increment source pointer */ testl $0xff0000, %eax /* is third byte NUL? */ - jz L2 /* yes => start copying */ + jz L(2) /* yes => start copying */ incl %edx /* increment source pointer */ -L2: subl %ecx, %edx /* reduce number of loop variants */ +L(2): subl %ecx, %edx /* reduce number of loop variants */ /* Now we have to align the source pointer. */ testl $3, %ecx /* pointer correctly aligned? */ - jz L29 /* yes => start copy loop */ + jz L(29) /* yes => start copy loop */ movb (%ecx), %al /* get first byte */ movb %al, (%ecx,%edx) /* and store it */ andb %al, %al /* is byte NUL? */ - jz L8 /* yes => return */ + jz L(8) /* yes => return */ incl %ecx /* increment pointer */ testl $3, %ecx /* pointer correctly aligned? */ - jz L29 /* yes => start copy loop */ + jz L(29) /* yes => start copy loop */ movb (%ecx), %al /* get first byte */ movb %al, (%ecx,%edx) /* and store it */ andb %al, %al /* is byte NUL? */ - jz L8 /* yes => return */ + jz L(8) /* yes => return */ incl %ecx /* increment pointer */ testl $3, %ecx /* pointer correctly aligned? */ - jz L29 /* yes => start copy loop */ + jz L(29) /* yes => start copy loop */ movb (%ecx), %al /* get first byte */ movb %al, (%ecx,%edx) /* and store it */ andb %al, %al /* is byte NUL? */ - jz L8 /* yes => return */ + jz L(8) /* yes => return */ incl %ecx /* increment pointer */ /* Now we are aligned. */ - jmp L29 /* start copy loop */ + jmp L(29) /* start copy loop */ ALIGN(4) -L28: movl %eax, 12(%ecx,%edx)/* store word at destination */ +L(28): movl %eax, 12(%ecx,%edx)/* store word at destination */ addl $16, %ecx /* adjust pointer for full round */ -L29: movl (%ecx), %eax /* get word from source */ +L(29): movl (%ecx), %eax /* get word from source */ movl $0xfefefeff, %edi /* magic value */ addl %eax, %edi /* add the magic value to the word. We get carry bits reported for each byte which is *not* 0 */ - jnc L9 /* highest byte is C => stop copying */ + jnc L(9) /* highest byte is C => stop copying */ xorl %eax, %edi /* ((word^charmask)+magic)^(word^charmask) */ orl $0xfefefeff, %edi /* set all non-carry bits */ incl %edi /* add 1: if one carry bit was *not* set the addition will not result in 0. */ - jnz L9 /* one byte is NUL => stop copying */ + jnz L(9) /* one byte is NUL => stop copying */ movl %eax, (%ecx,%edx) /* store word to destination */ movl 4(%ecx), %eax /* get word from source */ @@ -202,12 +202,12 @@ L29: movl (%ecx), %eax /* get word from source */ addl %eax, %edi /* add the magic value to the word. We get carry bits reported for each byte which is *not* 0 */ - jnc L91 /* highest byte is C => stop copying */ + jnc L(91) /* highest byte is C => stop copying */ xorl %eax, %edi /* ((word^charmask)+magic)^(word^charmask) */ orl $0xfefefeff, %edi /* set all non-carry bits */ incl %edi /* add 1: if one carry bit was *not* set the addition will not result in 0. */ - jnz L91 /* one byte is NUL => stop copying */ + jnz L(91) /* one byte is NUL => stop copying */ movl %eax, 4(%ecx,%edx) /* store word to destination */ movl 8(%ecx), %eax /* get word from source */ @@ -215,12 +215,12 @@ L29: movl (%ecx), %eax /* get word from source */ addl %eax, %edi /* add the magic value to the word. We get carry bits reported for each byte which is *not* 0 */ - jnc L92 /* highest byte is C => stop copying */ + jnc L(92) /* highest byte is C => stop copying */ xorl %eax, %edi /* ((word^charmask)+magic)^(word^charmask) */ orl $0xfefefeff, %edi /* set all non-carry bits */ incl %edi /* add 1: if one carry bit was *not* set the addition will not result in 0. */ - jnz L92 /* one byte is NUL => stop copying */ + jnz L(92) /* one byte is NUL => stop copying */ movl %eax, 8(%ecx,%edx) /* store word to destination */ movl 12(%ecx), %eax /* get word from source */ @@ -228,33 +228,33 @@ L29: movl (%ecx), %eax /* get word from source */ addl %eax, %edi /* add the magic value to the word. We get carry bits reported for each byte which is *not* 0 */ - jnc L93 /* highest byte is C => stop copying */ + jnc L(93) /* highest byte is C => stop copying */ xorl %eax, %edi /* ((word^charmask)+magic)^(word^charmask) */ orl $0xfefefeff, %edi /* set all non-carry bits */ incl %edi /* add 1: if one carry bit was *not* set the addition will not result in 0. */ - jz L28 /* no is NUL => carry on copying */ + jz L(28) /* no is NUL => carry on copying */ -L93: addl $4, %ecx /* adjust pointer */ -L92: addl $4, %ecx -L91: addl $4, %ecx +L(93): addl $4, %ecx /* adjust pointer */ +L(92): addl $4, %ecx +L(91): addl $4, %ecx -L9: movb %al, (%ecx,%edx) /* store first byte of last word */ +L(9): movb %al, (%ecx,%edx) /* store first byte of last word */ orb %al, %al /* is it NUL? */ - jz L8 /* yes => return */ + jz L(8) /* yes => return */ movb %ah, 1(%ecx,%edx) /* store second byte of last word */ orb %ah, %ah /* is it NUL? */ - jz L8 /* yes => return */ + jz L(8) /* yes => return */ shrl $16, %eax /* make upper bytes accessible */ movb %al, 2(%ecx,%edx) /* store third byte of last word */ orb %al, %al /* is it NUL? */ - jz L8 /* yes => return */ + jz L(8) /* yes => return */ movb %ah, 3(%ecx,%edx) /* store fourth byte of last word */ -L8: movl 8(%esp), %eax /* start address of destination is result */ +L(8): movl 8(%esp), %eax /* start address of destination is result */ popl %edi /* restore saved register */ ret diff --git a/sysdeps/i386/i486/strlen.S b/sysdeps/i386/i486/strlen.S index a92067ab41..4a25011016 100644 --- a/sysdeps/i386/i486/strlen.S +++ b/sysdeps/i386/i486/strlen.S @@ -1,23 +1,23 @@ /* strlen(str) -- determine the length of the string STR. -Optimized for Intel 80x86, x>=4. -Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc. -Contributed by Ulrich Drepper . -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 Library General Public License as -published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C 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. */ + Optimized for Intel 80x86, x>=4. + Copyright (C) 1991, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc. + Contributed by Ulrich Drepper . + 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 Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C 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 #include "asm-syntax.h" @@ -33,21 +33,21 @@ ENTRY (strlen) movl %ecx, %eax /* duplicate it */ andl $3, %ecx /* mask alignment bits */ - jz L1 /* aligned => start loop */ + jz L(1) /* aligned => start loop */ cmpb %ch, (%eax) /* is byte NUL? */ - je L2 /* yes => return */ + je L(2) /* yes => return */ incl %eax /* increment pointer */ xorl $3, %ecx /* was alignment = 3? */ - jz L1 /* yes => now it is aligned and start loop */ + jz L(1) /* yes => now it is aligned and start loop */ cmpb %ch, (%eax) /* is byte NUL? */ - je L2 /* yes => return */ + je L(2) /* yes => return */ addl $1, %eax /* increment pointer */ subl $1, %ecx /* was alignment = 2? */ - jz L1 /* yes => now it is aligned and start loop */ + jz L(1) /* yes => now it is aligned and start loop */ cmpb %ch, (%eax) /* is byte NUL? */ - je L2 /* yes => return */ + je L(2) /* yes => return */ /* Don't change the above `addl $1,%eax' and `subl $1, %ecx' into `incl %eax' and `decl %ecx' resp. The additional two byte per instruction make the @@ -61,73 +61,73 @@ ENTRY (strlen) subl $15, %eax /* effectively +1 */ -L4: addl $16, %eax /* adjust pointer for full loop */ +L(4): addl $16, %eax /* adjust pointer for full loop */ -L1: movl (%eax), %ecx /* get word (= 4 bytes) in question */ +L(1): movl (%eax), %ecx /* get word (= 4 bytes) in question */ movl $0xfefefeff, %edx /* magic value */ addl %ecx, %edx /* add the magic value to the word. We get carry bits reported for each byte which is *not* 0 */ - jnc L3 /* highest byte is NUL => return pointer */ + jnc L(3) /* highest byte is NUL => return pointer */ xorl %ecx, %edx /* (word+magic)^word */ orl $0xfefefeff, %edx /* set all non-carry bits */ incl %edx /* add 1: if one carry bit was *not* set the addition will not result in 0. */ - jnz L3 /* found NUL => return pointer */ + jnz L(3) /* found NUL => return pointer */ movl 4(%eax), %ecx /* get word (= 4 bytes) in question */ movl $0xfefefeff, %edx /* magic value */ addl %ecx, %edx /* add the magic value to the word. We get carry bits reported for each byte which is *not* 0 */ - jnc L5 /* highest byte is NUL => return pointer */ + jnc L(5) /* highest byte is NUL => return pointer */ xorl %ecx, %edx /* (word+magic)^word */ orl $0xfefefeff, %edx /* set all non-carry bits */ incl %edx /* add 1: if one carry bit was *not* set the addition will not result in 0. */ - jnz L5 /* found NUL => return pointer */ + jnz L(5) /* found NUL => return pointer */ movl 8(%eax), %ecx /* get word (= 4 bytes) in question */ movl $0xfefefeff, %edx /* magic value */ addl %ecx, %edx /* add the magic value to the word. We get carry bits reported for each byte which is *not* 0 */ - jnc L6 /* highest byte is NUL => return pointer */ + jnc L(6) /* highest byte is NUL => return pointer */ xorl %ecx, %edx /* (word+magic)^word */ orl $0xfefefeff, %edx /* set all non-carry bits */ incl %edx /* add 1: if one carry bit was *not* set the addition will not result in 0. */ - jnz L6 /* found NUL => return pointer */ + jnz L(6) /* found NUL => return pointer */ movl 12(%eax), %ecx /* get word (= 4 bytes) in question */ movl $0xfefefeff, %edx /* magic value */ addl %ecx, %edx /* add the magic value to the word. We get carry bits reported for each byte which is *not* 0 */ - jnc L7 /* highest byte is NUL => return pointer */ + jnc L(7) /* highest byte is NUL => return pointer */ xorl %ecx, %edx /* (word+magic)^word */ orl $0xfefefeff, %edx /* set all non-carry bits */ incl %edx /* add 1: if one carry bit was *not* set the addition will not result in 0. */ - jz L4 /* no NUL found => continue loop */ + jz L(4) /* no NUL found => continue loop */ -L7: addl $4, %eax /* adjust pointer */ -L6: addl $4, %eax -L5: addl $4, %eax +L(7): addl $4, %eax /* adjust pointer */ +L(6): addl $4, %eax +L(5): addl $4, %eax -L3: testb %cl, %cl /* is first byte NUL? */ - jz L2 /* yes => return */ +L(3): testb %cl, %cl /* is first byte NUL? */ + jz L(2) /* yes => return */ incl %eax /* increment pointer */ testb %ch, %ch /* is second byte NUL? */ - jz L2 /* yes => return */ + jz L(2) /* yes => return */ incl %eax /* increment pointer */ testl $0xff0000, %ecx /* is third byte NUL? */ - jz L2 /* yes => return pointer */ + jz L(2) /* yes => return pointer */ incl %eax /* increment pointer */ -L2: subl 4(%esp), %eax /* compute difference to string start */ +L(2): subl 4(%esp), %eax /* compute difference to string start */ ret END (strlen) diff --git a/sysdeps/i386/i586/add_n.S b/sysdeps/i386/i586/add_n.S index ac6f2819b2..6d86027b1f 100644 --- a/sysdeps/i386/i586/add_n.S +++ b/sysdeps/i386/i586/add_n.S @@ -1,24 +1,22 @@ /* Pentium __mpn_add_n -- Add two limb vectors of the same length > 0 and store sum in a third limb vector. + Copyright (C) 1992, 1994, 1995, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU MP Library. -Copyright (C) 1992, 1994, 1995, 1996 Free Software Foundation, Inc. + The GNU MP Library is free software; you can redistribute it and/or modify + it under the terms of the GNU Library General Public License as published by + the Free Software Foundation; either version 2 of the License, or (at your + option) any later version. -This file is part of the GNU MP Library. + 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 Library General Public + License for more details. -The GNU MP Library is free software; you can redistribute it and/or modify -it under the terms of the GNU Library General Public License as published by -the Free Software Foundation; either version 2 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 Library General Public -License for more details. - -You should have received a copy of the GNU Library 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. */ + You should have received a copy of the GNU Library 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. */ /* INPUT PARAMETERS @@ -52,14 +50,14 @@ C_SYMBOL_NAME(__mpn_add_n:) shrl $3,%ecx andl $7,%edx testl %ecx,%ecx /* zero carry flag */ - jz Lend + jz L(end) pushl %edx ALIGN (3) -Loop: movl 28(%edi),%eax /* fetch destination cache line */ +L(oop): movl 28(%edi),%eax /* fetch destination cache line */ leal 32(%edi),%edi -L1: movl (%esi),%eax +L(1): movl (%esi),%eax movl 4(%esi),%edx adcl %ebx,%eax movl 4(%ebp),%ebx @@ -68,7 +66,7 @@ L1: movl (%esi),%eax movl %eax,-32(%edi) movl %edx,-28(%edi) -L2: movl 8(%esi),%eax +L(2): movl 8(%esi),%eax movl 12(%esi),%edx adcl %ebx,%eax movl 12(%ebp),%ebx @@ -77,7 +75,7 @@ L2: movl 8(%esi),%eax movl %eax,-24(%edi) movl %edx,-20(%edi) -L3: movl 16(%esi),%eax +L(3): movl 16(%esi),%eax movl 20(%esi),%edx adcl %ebx,%eax movl 20(%ebp),%ebx @@ -86,7 +84,7 @@ L3: movl 16(%esi),%eax movl %eax,-16(%edi) movl %edx,-12(%edi) -L4: movl 24(%esi),%eax +L(4): movl 24(%esi),%eax movl 28(%esi),%edx adcl %ebx,%eax movl 28(%ebp),%ebx @@ -98,14 +96,14 @@ L4: movl 24(%esi),%eax leal 32(%esi),%esi leal 32(%ebp),%ebp decl %ecx - jnz Loop + jnz L(oop) popl %edx -Lend: +L(end): decl %edx /* test %edx w/o clobbering carry */ - js Lend2 + js L(end2) incl %edx -Loop2: +L(oop2): leal 4(%edi),%edi movl (%esi),%eax adcl %ebx,%eax @@ -114,8 +112,8 @@ Loop2: leal 4(%esi),%esi leal 4(%ebp),%ebp decl %edx - jnz Loop2 -Lend2: + jnz L(oop2) +L(end2): movl (%esi),%eax adcl %ebx,%eax movl %eax,(%edi) diff --git a/sysdeps/i386/i586/addmul_1.S b/sysdeps/i386/i586/addmul_1.S index 7cfa5db687..0d410f6ac3 100644 --- a/sysdeps/i386/i586/addmul_1.S +++ b/sysdeps/i386/i586/addmul_1.S @@ -1,24 +1,22 @@ /* Pentium __mpn_addmul_1 -- Multiply a limb vector with a limb and add the result to a second limb vector. + Copyright (C) 1992, 1994, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU MP Library. -Copyright (C) 1992, 1994, 1996 Free Software Foundation, Inc. + The GNU MP Library is free software; you can redistribute it and/or modify + it under the terms of the GNU Library General Public License as published by + the Free Software Foundation; either version 2 of the License, or (at your + option) any later version. -This file is part of the GNU MP Library. + 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 Library General Public + License for more details. -The GNU MP Library is free software; you can redistribute it and/or modify -it under the terms of the GNU Library General Public License as published by -the Free Software Foundation; either version 2 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 Library General Public -License for more details. - -You should have received a copy of the GNU Library 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. */ + You should have received a copy of the GNU Library 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. */ /* INPUT PARAMETERS @@ -57,7 +55,7 @@ C_SYMBOL_NAME(__mpn_addmul_1:) INSN2(xor,l ,R(ebx),R(ebx)) ALIGN (3) -Loop: INSN2(adc,l ,R(ebx),$0) +L(oop): INSN2(adc,l ,R(ebx),$0) INSN2(mov,l ,R(eax),MEM_INDEX(s1_ptr,size,4)) INSN1(mul,l ,R(s2_limb)) @@ -72,7 +70,7 @@ Loop: INSN2(adc,l ,R(ebx),$0) INSN1(inc,l ,R(size)) INSN2(mov,l ,R(ebx),R(edx)) - INSN1(jnz, ,Loop) + INSN1(jnz, ,L(oop)) INSN2(adc,l ,R(ebx),$0) INSN2(mov,l ,R(eax),R(ebx)) diff --git a/sysdeps/i386/i586/lshift.S b/sysdeps/i386/i586/lshift.S index bf9b223a0b..1d72fc901e 100644 --- a/sysdeps/i386/i586/lshift.S +++ b/sysdeps/i386/i586/lshift.S @@ -1,5 +1,5 @@ /* Pentium optimized __mpn_lshift -- - Copyright (C) 1992, 1994, 1995, 1996 Free Software Foundation, Inc. + Copyright (C) 1992, 1994, 1995, 1996, 1997 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 @@ -44,15 +44,15 @@ C_SYMBOL_NAME(__mpn_lshift:) /* We can use faster code for shift-by-1 under certain conditions. */ cmp $1,%ecx - jne Lnormal + jne L(normal) leal 4(%esi),%eax cmpl %edi,%eax - jnc Lspecial /* jump if s_ptr + 1 >= res_ptr */ + jnc L(special) /* jump if s_ptr + 1 >= res_ptr */ leal (%esi,%ebp,4),%eax cmpl %eax,%edi