diff options
65 files changed, 1684 insertions, 1279 deletions
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 <drepper@cygnus.com> + + * 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 <drepper@cygnus.com> + + * sysdeps/unix/sysv/linux/powerpc/Dist: Add kernel_*.h files. + +1997-03-23 01:41 Geoff Keating <geoffk@ozemail.com.au> + + * sysdeps/powerpc/strlen.s: Rewrote for more speed. + * string/tst-strlen.c: Also test various string alignments. + +1997-03-19 06:11 Geoff Keating <geoffk@ozemail.com.au> + + * 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 <drepper@cygnus.com> + + * 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 <asun@zoology.washington.edu>. + + * sysdeps/unix/sysv/linux/netatalk/atalk.h: Rename to... + * sysdeps/unix/sysv/linux/netatalk/at.h: ...this. + Suggested by a sun <asun@zoology.washington.edu>. + +1997-03-30 14:53 Ulrich Drepper <drepper@cygnus.com> + + * sysdeps/unix/sysv/linux/netinet/ip_icmp.h: Add former contents + of <netinet/icmp.h>. + Patch by a sun <asun@zoology.washington.edu>. + 1997-03-30 03:42 Ulrich Drepper <drepper@cygnus.com> * 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 <geoffk@ozemail.com.au> diff --git a/PROJECTS b/PROJECTS index 394b18efdf..6b381f7ceb 100644 --- a/PROJECTS +++ b/PROJECTS @@ -58,6 +58,13 @@ contact <bug-glibc@prep.ai.mit.edu> - 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 <bug-glibc@prep.ai.mit.edu> 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 <bug-glibc@prep.ai.mit.edu> - 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 <sys/types.h> -#include <netinet/in.h> -#include <arpa/inet.h> +/* 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 <drepper@cygnus.com>, 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU 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 <stdio.h> +#include <stdlib.h> +#include <arpa/inet.h> +#include <libc-lock.h> + +/* 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<<log #endif + +#undef L +#ifdef __ELF__ +#ifdef __STDC__ +#define L(body) .L##body +#else +#define L(body) .L/**/body +#endif +#else +#ifdef __STDC__ +#define L(body) L##body +#else +#define L(body) L/**/body +#endif +#endif diff --git a/sysdeps/i386/i486/strcat.S b/sysdeps/i386/i486/strcat.S index 9bac145ad4..c3893315e7 100644 --- a/sysdeps/i386/i486/strcat.S +++ b/sysdeps/i386/i486/strcat.S @@ -1,6 +1,6 @@ /* strcat(dest, src) -- Append SRC on the end of DEST. For Intel 80x86, x>=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 <drepper@ipd.info.uni-karlsruhe.de>. Optimised a little by Alan Modra <Alan@SPRI.Levels.UniSA.Edu.Au> @@ -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 <drepper@gnu.ai.mit.edu>. -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 <drepper@gnu.ai.mit.edu>. + 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 <sysdep.h> #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 - jnc Lspecial /* jump if res_ptr >= s_ptr + size */ + jnc L(special) /* jump if res_ptr >= s_ptr + size */ -Lnormal: +L(normal): leal -4(%edi,%ebp,4),%edi leal -4(%esi,%ebp,4),%esi @@ -65,12 +65,12 @@ Lnormal: decl %ebp pushl %ebp shrl $3,%ebp - jz Lend + jz L(end) movl (%edi),%eax /* fetch destination cache line */ ALIGN (2) -Loop: movl -28(%edi),%eax /* fetch destination cache line */ +L(oop): movl -28(%edi),%eax /* fetch destination cache line */ movl %edx,%ebx movl (%esi),%eax @@ -104,21 +104,23 @@ Loop: movl -28(%edi),%eax /* fetch destination cache line */ subl $32,%esi subl $32,%edi decl %ebp - jnz Loop + jnz L(oop) -Lend: popl %ebp +L(end): popl %ebp andl $7,%ebp - jz Lend2 -Loop2: movl (%esi),%eax + jz L(end2) +L(oop2): + movl (%esi),%eax shldl %cl,%eax,%edx movl %edx,(%edi) movl %eax,%edx subl $4,%esi subl $4,%edi decl %ebp - jnz Loop2 + jnz L(oop2) -Lend2: shll %cl,%edx /* compute least significant limb */ +L(end2): + shll %cl,%edx /* compute least significant limb */ movl %edx,(%edi) /* store it */ popl %eax /* pop carry limb */ @@ -134,7 +136,7 @@ Lend2: shll %cl,%edx /* compute least significant limb */ function is documented to work for overlapping source and destination. */ -Lspecial: +L(special): movl (%esi),%edx addl $4,%esi @@ -145,12 +147,13 @@ Lspecial: addl %edx,%edx incl %ebp decl %ebp - jz LLend + jz L(Lend) movl (%edi),%eax /* fetch destination cache line */ ALIGN (2) -LLoop: movl 28(%edi),%eax /* fetch destination cache line */ +L(Loop): + movl 28(%edi),%eax /* fetch destination cache line */ movl %edx,%ebx movl (%esi),%eax @@ -184,14 +187,16 @@ LLoop: movl 28(%edi),%eax /* fetch destination cache line */ leal 32(%esi),%esi /* use leal not to clobber carry */ leal 32(%edi),%edi decl %ebp - jnz LLoop + jnz L(Loop) -LLend: popl %ebp +L(Lend): + popl %ebp sbbl %eax,%eax /* save carry in %eax */ andl $7,%ebp - jz LLend2 + jz L(Lend2) addl %eax,%eax /* restore carry from eax */ -LLoop2: movl %edx,%ebx +L(Loop2): + movl %edx,%ebx movl (%esi),%edx adcl %edx,%edx movl %ebx,(%edi) @@ -199,11 +204,12 @@ LLoop2: movl %edx,%ebx leal 4(%esi),%esi /* use leal not to clobber carry */ leal 4(%edi),%edi decl %ebp - jnz LLoop2 + jnz L(Loop2) - jmp LL1 -LLend2: addl %eax,%eax /* restore carry from eax */ -LL1: movl %edx,(%edi) /* store last limb */ + jmp L(L1) +L(Lend2): + addl %eax,%eax /* restore carry from eax */ +L(L1): movl %edx,(%edi) /* store last limb */ sbbl %eax,%eax negl %eax diff --git a/sysdeps/i386/i586/memset.S b/sysdeps/i386/i586/memset.S index 1e8a9c2111..fb96a369b9 100644 --- a/sysdeps/i386/i586/memset.S +++ b/sysdeps/i386/i586/memset.S @@ -1,25 +1,26 @@ /* memset/bzero -- set memory area to CH/0 -Highly optimized version for ix85, x>=5. -Copyright (C) 1996 Free Software Foundation, Inc. -This file is part of the GNU C Library. -Contributed by Torbjorn Granlund, <tege@matematik.su.se> - -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. */ + Highly optimized version for ix85, x>=5. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Torbjorn Granlund, <tege@matematik.su.se> + + 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 <sysdep.h> +#include "asm-syntax.h" /* INPUT PARAMETERS: @@ -52,7 +53,7 @@ ENTRY (memset) /* If less than 36 bytes to write, skip tricky code (it wouldn't work). */ cmpl $36, %edx movl %edx, %ecx /* needed when branch is taken! */ - jl L2 + jl L(2) /* First write 0-3 bytes to make the pointer 32-bit aligned. */ movl %edi, %ecx /* Copy ptr to ecx... */ @@ -66,7 +67,7 @@ ENTRY (memset) movl (%edi), %ecx /* Fetch destination cache line */ .align 2, 0x90 /* supply 0x90 for broken assemblers */ -L1: movl 28(%edi), %ecx /* allocate cache line for destination */ +L(1): movl 28(%edi), %ecx /* allocate cache line for destination */ subl $32, %edx /* decr loop count */ movl %eax, 0(%edi) /* store words pairwise */ movl %eax, 4(%edi) @@ -77,12 +78,12 @@ L1: movl 28(%edi), %ecx /* allocate cache line for destination */ movl %eax, 24(%edi) movl %eax, 28(%edi) leal 32(%edi), %edi /* update destination pointer */ - jge L1 + jge L(1) leal 32(%edx), %ecx /* reset offset count */ /* Write last 0-7 full 32-bit words (up to 8 words if loop was skipped). */ -L2: shrl $2, %ecx /* convert byte count to longword count */ +L(2): shrl $2, %ecx /* convert byte count to longword count */ rep stosl diff --git a/sysdeps/i386/i586/mul_1.S b/sysdeps/i386/i586/mul_1.S index 4ac3050a61..905e65cb58 100644 --- a/sysdeps/i386/i586/mul_1.S +++ b/sysdeps/i386/i586/mul_1.S @@ -1,24 +1,22 @@ /* Pentium __mpn_mul_1 -- Multiply a limb vector with a limb and store the result in 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_mul_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)) @@ -68,7 +66,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/rshift.S b/sysdeps/i386/i586/rshift.S index 1860daf4d3..14ffbb8454 100644 --- a/sysdeps/i386/i586/rshift.S +++ b/sysdeps/i386/i586/rshift.S @@ -1,23 +1,21 @@ /* Pentium optimized __mpn_rshift -- + 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 @@ -46,15 +44,15 @@ C_SYMBOL_NAME(__mpn_rshift:) /* We can use faster code for shift-by-1 under certain conditions. */ cmp $1,%ecx - jne Lnormal + jne L(normal) leal 4(%edi),%eax cmpl %esi,%eax - jnc Lspecial /* jump if res_ptr + 1 >= s_ptr */ + jnc L(special) /* jump if res_ptr + 1 >= s_ptr */ leal (%edi,%ebp,4),%eax cmpl %eax,%esi - jnc Lspecial /* jump if s_ptr >= res_ptr + size */ + jnc L(special) /* jump if s_ptr >= res_ptr + size */ -Lnormal: +L(normal): movl (%esi),%edx addl $4,%esi xorl %eax,%eax @@ -64,12 +62,12 @@ Lnormal: decl %ebp pushl %ebp shrl $3,%ebp - jz Lend + jz L(end) movl (%edi),%eax /* fetch destination cache line */ ALIGN (2) -Loop: movl 28(%edi),%eax /* fetch destination cache line */ +L(oop): movl 28(%edi),%eax /* fetch destination cache line */ movl %edx,%ebx movl (%esi),%eax @@ -103,21 +101,23 @@ Loop: movl 28(%edi),%eax /* fetch destination cache line */ addl $32,%esi addl $32,%edi decl %ebp - jnz Loop + jnz L(oop) -Lend: popl %ebp +L(end): popl %ebp andl $7,%ebp - jz Lend2 -Loop2: movl (%esi),%eax + jz L(end2) +L(oop2): + movl (%esi),%eax shrdl %cl,%eax,%edx /* compute result limb */ movl %edx,(%edi) movl %eax,%edx addl $4,%esi addl $4,%edi decl %ebp - jnz Loop2 + jnz L(oop2) -Lend2: shrl %cl,%edx /* compute most significant limb */ +L(end2): + shrl %cl,%edx /* compute most significant limb */ movl %edx,(%edi) /* store it */ popl %eax /* pop carry limb */ @@ -133,7 +133,7 @@ Lend2: shrl %cl,%edx /* compute most significant limb */ function is documented to work for overlapping source and destination. */ -Lspecial: +L(special): leal -4(%edi,%ebp,4),%edi leal -4(%esi,%ebp,4),%esi @@ -147,12 +147,13 @@ Lspecial: shrl $1,%edx incl %ebp decl %ebp - jz LLend + jz L(Lend) movl (%edi),%eax /* fetch destination cache line */ ALIGN (2) -LLoop: movl -28(%edi),%eax /* fetch destination cache line */ +L(Loop): + movl -28(%edi),%eax /* fetch destination cache line */ movl %edx,%ebx movl (%esi),%eax @@ -186,14 +187,16 @@ LLoop: movl -28(%edi),%eax /* fetch destination cache line */ leal -32(%esi),%esi /* use leal not to clobber carry */ leal -32(%edi),%edi decl %ebp - jnz LLoop + jnz L(Loop) -LLend: popl %ebp +L(Lend): + popl %ebp sbbl %eax,%eax /* save carry in %eax */ andl $7,%ebp - jz LLend2 + jz L(Lend2) addl %eax,%eax /* restore carry from eax */ -LLoop2: movl %edx,%ebx +L(Loop2): + movl %edx,%ebx movl (%esi),%edx rcrl $1,%edx movl %ebx,(%edi) @@ -201,11 +204,12 @@ LLoop2: movl %edx,%ebx leal -4(%esi),%esi /* use leal not to clobber carry */ leal -4(%edi),%edi decl %ebp - jnz LLoop2 + jnz L(Loop2) - jmp LL1 -LLend2: addl %eax,%eax /* restore carry from eax */ -LL1: movl %edx,(%edi) /* store last limb */ + jmp L(L1) +L(Lend2): + addl %eax,%eax /* restore carry from eax */ +L(L1): movl %edx,(%edi) /* store last limb */ movl $0,%eax rcrl $1,%eax diff --git a/sysdeps/i386/i586/strchr.S b/sysdeps/i386/i586/strchr.S index fda053216f..e351853231 100644 --- a/sysdeps/i386/i586/strchr.S +++ b/sysdeps/i386/i586/strchr.S @@ -1,6 +1,6 @@ -/* strchr -- find character CH in a NUL terminated string. +/* Find character CH in a NUL terminated string. Highly optimized version for ix85, x>=5. - Copyright (C) 1995, 1996 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>. @@ -20,6 +20,7 @@ Boston, MA 02111-1307, USA. */ #include <sysdep.h> +#include "asm-syntax.h" /* This version is especially optimized for the i586 (and following?) processors. This is mainly done by using the two pipelines. The @@ -67,38 +68,38 @@ ENTRY (strchr) orl %ecx, %edx /* and finally c|c|c|c */ andl $3, %edi /* mask alignment bits */ - jz L11 /* alignment is 0 => start loop */ + jz L(11) /* alignment is 0 => start loop */ movb %dl, %cl /* 0 is needed below */ - jp L0 /* exactly two bits set */ + jp L(0) /* exactly two bits set */ xorb (%eax), %cl /* is byte the one we are looking for? */ - jz L2 /* yes => return pointer */ + jz L(2) /* yes => return pointer */ xorb %dl, %cl /* load single byte and test for NUL */ - je L3 /* yes => return NULL */ + je L(3) /* yes => return NULL */ movb 1(%eax), %cl /* load single byte */ incl %eax cmpb %cl, %dl /* is byte == C? */ - je L2 /* aligned => return pointer */ + je L(2) /* aligned => return pointer */ cmpb $0, %cl /* is byte NUL? */ - je L3 /* yes => return NULL */ + je L(3) /* yes => return NULL */ incl %eax decl %edi - jne L11 + jne L(11) -L0: movb (%eax), %cl /* load single byte */ +L(0): movb (%eax), %cl /* load single byte */ cmpb %cl, %dl /* is byte == C? */ - je L2 /* aligned => return pointer */ + je L(2) /* aligned => return pointer */ cmpb $0, %cl /* is byte NUL? */ - je L3 /* yes => return NULL */ + je L(3) /* yes => return NULL */ incl %eax /* increment pointer */ @@ -106,7 +107,7 @@ L0: movb (%eax), %cl /* load single byte */ four instruction up to `L1' will not be executed in the loop because the same code is found at the end of the loop, but there it is executed in parallel with other instructions. */ -L11: movl (%eax), %ecx +L(11): movl (%eax), %ecx movl $magic, %ebp movl $magic, %edi @@ -135,17 +136,17 @@ L11: movl (%eax), %ecx C allows us to overlap the test for 0 in the next word with the test for C. */ -L1: xorl %ecx, %ebp /* (word^magic) */ +L(1): xorl %ecx, %ebp /* (word^magic) */ addl %ecx, %edi /* add magic word */ leal 4(%eax), %eax /* increment pointer */ - jnc L4 /* previous addl caused overflow? */ + jnc L(4) /* previous addl caused overflow? */ movl %ecx, %ebx /* duplicate original word */ orl $magic, %ebp /* (word^magic)|magic */ addl $1, %ebp /* (word^magic)|magic == 0xffffffff? */ - jne L4 /* yes => we found word with NUL */ + jne L(4) /* yes => we found word with NUL */ movl $magic, %esi /* load magic value */ xorl %edx, %ebx /* clear words which are C */ @@ -154,7 +155,7 @@ L1: xorl %ecx, %ebp /* (word^magic) */ addl %ebx, %esi /* (word+magic) */ movl $magic, %edi - jnc L5 /* previous addl caused overflow? */ + jnc L(5) /* previous addl caused overflow? */ movl %edi, %ebp xorl %ebx, %esi /* (word+magic)^word */ @@ -163,19 +164,19 @@ L1: xorl %ecx, %ebp /* (word^magic) */ orl $magic, %esi /* ((word+magic)^word)|magic */ addl $1, %esi /* ((word+magic)^word)|magic==0xf..f?*/ - jne L5 /* yes => we found word with C */ + jne L(5) /* yes => we found word with C */ xorl %ecx, %ebp addl %ecx, %edi leal 4(%eax), %eax - jnc L4 + jnc L(4) movl %ecx, %ebx orl $magic, %ebp addl $1, %ebp - jne L4 + jne L(4) movl $magic, %esi xorl %edx, %ebx @@ -184,7 +185,7 @@ L1: xorl %ecx, %ebp /* (word^magic) */ addl %ebx, %esi movl $magic, %edi - jnc L5 + jnc L(5) movl %edi, %ebp xorl %ebx, %esi @@ -193,19 +194,19 @@ L1: xorl %ecx, %ebp /* (word^magic) */ orl $magic, %esi addl $1, %esi - jne L5 + jne L(5) xorl %ecx, %ebp addl %ecx, %edi leal 4(%eax), %eax - jnc L4 + jnc L(4) movl %ecx, %ebx orl $magic, %ebp addl $1, %ebp - jne L4 + jne L(4) movl $magic, %esi xorl %edx, %ebx @@ -214,7 +215,7 @@ L1: xorl %ecx, %ebp /* (word^magic) */ addl %ebx, %esi movl $magic, %edi - jnc L5 + jnc L(5) movl %edi, %ebp xorl %ebx, %esi @@ -223,19 +224,19 @@ L1: xorl %ecx, %ebp /* (word^magic) */ orl $magic, %esi addl $1, %esi - jne L5 + jne L(5) xorl %ecx, %ebp addl %ecx, %edi leal 4(%eax), %eax - jnc L4 + jnc L(4) movl %ecx, %ebx orl $magic, %ebp addl $1, %ebp - jne L4 + jne L(4) movl $magic, %esi xorl %edx, %ebx @@ -244,7 +245,7 @@ L1: xorl %ecx, %ebp /* (word^magic) */ addl %ebx, %esi movl $magic, %edi - jnc L5 + jnc L(5) movl %edi, %ebp xorl %ebx, %esi @@ -254,29 +255,29 @@ L1: xorl %ecx, %ebp /* (word^magic) */ addl $1, %esi - je L1 + je L(1) /* We know there is no NUL byte but a C byte in the word. %ebx contains NUL in this particular byte. */ -L5: subl $4, %eax /* adjust pointer */ +L(5): subl $4, %eax /* adjust pointer */ testb %bl, %bl /* first byte == C? */ - jz L2 /* yes => return pointer */ + jz L(2) /* yes => return pointer */ incl %eax /* increment pointer */ testb %bh, %bh /* second byte == C? */ - jz L2 /* yes => return pointer */ + jz L(2) /* yes => return pointer */ shrl $16, %ebx /* make upper bytes accessible */ incl %eax /* increment pointer */ cmp $0, %bl /* third byte == C */ - je L2 /* yes => return pointer */ + je L(2) /* yes => return pointer */ incl %eax /* increment pointer */ -L2: popl %ebp /* restore saved registers */ +L(2): popl %ebp /* restore saved registers */ popl %ebx popl %esi @@ -286,38 +287,38 @@ L2: popl %ebp /* restore saved registers */ /* We know there is a NUL byte in the word. But we have to test whether there is an C byte before it in the word. */ -L4: subl $4, %eax /* adjust pointer */ +L(4): subl $4, %eax /* adjust pointer */ cmpb %dl, %cl /* first byte == C? */ - je L2 /* yes => return pointer */ + je L(2) /* yes => return pointer */ cmpb $0, %cl /* first byte == NUL? */ - je L3 /* yes => return NULL */ + je L(3) /* yes => return NULL */ incl %eax /* increment pointer */ cmpb %dl, %ch /* second byte == C? */ - je L2 /* yes => return pointer */ + je L(2) /* yes => return pointer */ cmpb $0, %ch /* second byte == NUL? */ - je L3 /* yes => return NULL */ + je L(3) /* yes => return NULL */ shrl $16, %ecx /* make upper bytes accessible */ incl %eax /* increment pointer */ cmpb %dl, %cl /* third byte == C? */ - je L2 /* yes => return pointer */ + je L(2) /* yes => return pointer */ cmpb $0, %cl /* third byte == NUL? */ - je L3 /* yes => return NULL */ + je L(3) /* yes => return NULL */ incl %eax /* increment pointer */ /* The test four the fourth byte is necessary! */ cmpb %dl, %ch /* fourth byte == C? */ - je L2 /* yes => return pointer */ + je L(2) /* yes => return pointer */ -L3: xorl %eax, %eax /* set return value = NULL */ +L(3): xorl %eax, %eax /* set return value = NULL */ popl %ebp /* restore saved registers */ popl %ebx diff --git a/sysdeps/i386/i586/strlen.S b/sysdeps/i386/i586/strlen.S index e8fb916812..2e6ea680ec 100644 --- a/sysdeps/i386/i586/strlen.S +++ b/sysdeps/i386/i586/strlen.S @@ -1,6 +1,6 @@ /* strlen -- Compute length og NUL terminated string. Highly optimized version for ix86, x>=5. - Copyright (C) 1995, 1996 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>. @@ -20,6 +20,7 @@ Boston, MA 02111-1307, USA. */ #include <sysdep.h> +#include "asm-syntax.h" /* This version is especially optimized for the i586 (and following?) processors. This is mainly done by using the two pipelines. The @@ -46,24 +47,24 @@ ENTRY(strlen) andl %eax, %edx /* separate last two bits of address */ - jz L1 /* aligned => start loop */ - jp L0 /* exactly two bits set */ + jz L(1) /* aligned => start loop */ + jp L(0) /* exactly two bits set */ cmpb %dh, (%eax) /* is byte NUL? */ - je L2 /* yes => return */ + je L(2) /* yes => return */ incl %eax /* increment pointer */ cmpb %dh, (%eax) /* is byte NUL? */ - je L2 /* yes => return */ + je L(2) /* yes => return */ incl %eax /* increment pointer */ xorl $2, %edx - jz L1 + jz L(1) -L0: cmpb %dh, (%eax) /* is byte NUL? */ - je L2 /* yes => return */ +L(0): cmpb %dh, (%eax) /* is byte NUL? */ + je L(2) /* yes => return */ incl %eax /* increment pointer */ xorl %edx, %edx /* We need %edx == 0 for later */ @@ -91,7 +92,7 @@ L0: cmpb %dh, (%eax) /* is byte NUL? */ Note: %edx == 0 in any case here. */ -L1: +L(1): movl (%eax), %ecx /* get word (= 4 bytes) in question */ addl $4, %eax /* adjust pointer for *next* word */ @@ -99,13 +100,13 @@ L1: addl $magic, %ecx /* add magic word */ decl %edx /* complete negation of word */ - jnc L3 /* previous addl caused overflow? */ + jnc L(3) /* previous addl caused overflow? */ xorl %ecx, %edx /* (word+magic)^word */ andl $~magic, %edx /* any of the carry flags set? */ - jne L3 /* yes => determine byte */ + jne L(3) /* yes => determine byte */ movl (%eax), %ecx /* get word (= 4 bytes) in question */ @@ -115,13 +116,13 @@ L1: addl $magic, %ecx /* add magic word */ decl %edx /* complete negation of word */ - jnc L3 /* previous addl caused overflow? */ + jnc L(3) /* previous addl caused overflow? */ xorl %ecx, %edx /* (word+magic)^word */ andl $~magic, %edx /* any of the carry flags set? */ - jne L3 /* yes => determine byte */ + jne L(3) /* yes => determine byte */ movl (%eax), %ecx /* get word (= 4 bytes) in question */ @@ -131,13 +132,13 @@ L1: addl $magic, %ecx /* add magic word */ decl %edx /* complete negation of word */ - jnc L3 /* previous addl caused overflow? */ + jnc L(3) /* previous addl caused overflow? */ xorl %ecx, %edx /* (word+magic)^word */ andl $~magic, %edx /* any of the carry flags set? */ - jne L3 /* yes => determine byte */ + jne L(3) /* yes => determine byte */ movl (%eax), %ecx /* get word (= 4 bytes) in question */ @@ -147,35 +148,35 @@ L1: addl $magic, %ecx /* add magic word */ decl %edx /* complete negation of word */ - jnc L3 /* previous addl caused overflow? */ + jnc L(3) /* previous addl caused overflow? */ xorl %ecx, %edx /* (word+magic)^word */ andl $~magic, %edx /* any of the carry flags set? */ - je L1 /* no => start loop again */ + je L(1) /* no => start loop again */ -L3: subl $4, %eax /* correct too early pointer increment */ +L(3): subl $4, %eax /* correct too early pointer increment */ subl $magic, %ecx cmpb $0, %cl /* lowest byte NUL? */ - jz L2 /* yes => return */ + jz L(2) /* yes => return */ inc %eax /* increment pointer */ testb %ch, %ch /* second byte NUL? */ - jz L2 /* yes => return */ + jz L(2) /* yes => return */ shrl $16, %ecx /* make upper bytes accessible */ incl %eax /* increment pointer */ cmpb $0, %cl /* is third byte NUL? */ - jz L2 /* yes => return */ + jz L(2) /* yes => return */ incl %eax /* increment pointer */ -L2: subl 4(%esp), %eax /* now compute the length as difference +L(2): subl 4(%esp), %eax /* now compute the length as difference between start and terminating NUL character */ diff --git a/sysdeps/i386/i586/sub_n.S b/sysdeps/i386/i586/sub_n.S index d1a2bc0840..758fa86bd3 100644 --- a/sysdeps/i386/i586/sub_n.S +++ b/sysdeps/i386/i586/sub_n.S @@ -1,24 +1,22 @@ /* Pentium __mpn_sub_n -- Subtract two limb vectors of the same length > 0 and store difference 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_sub_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 sbbl %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 sbbl %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 sbbl %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 sbbl %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 sbbl %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 sbbl %ebx,%eax movl %eax,(%edi) diff --git a/sysdeps/i386/i586/submul_1.S b/sysdeps/i386/i586/submul_1.S index adf2d63e68..20c4d8df0e 100644 --- a/sysdeps/i386/i586/submul_1.S +++ b/sysdeps/i386/i586/submul_1.S @@ -1,24 +1,22 @@ /* Pentium __mpn_submul_1 -- Multiply a limb vector with a limb and subtract the result from 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_submul_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/lshift.S b/sysdeps/i386/lshift.S index 8173b92cbe..cd6d95b62e 100644 --- a/sysdeps/i386/lshift.S +++ b/sysdeps/i386/lshift.S @@ -1,23 +1,21 @@ -/* i80386 __mpn_lshift -- +/* i80386 __mpn_lshift -- + 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 @@ -49,22 +47,22 @@ C_SYMBOL_NAME(__mpn_lshift:) xorl %eax,%eax shldl %cl,%ebx,%eax /* compute carry limb */ decl %edx - jz Lend + jz L(end) pushl %eax /* push carry limb onto stack */ testb $1,%edx - jnz L1 /* enter loop in the middle */ + jnz L(1) /* enter loop in the middle */ movl %ebx,%eax ALIGN (3) -Loop: movl (%esi,%edx,4),%ebx /* load next lower limb */ +L(oop): movl (%esi,%edx,4),%ebx /* load next lower limb */ shldl %cl,%ebx,%eax /* compute result limb */ movl %eax,(%edi,%edx,4) /* store it */ decl %edx -L1: movl (%esi,%edx,4),%eax +L(1): movl (%esi,%edx,4),%eax shldl %cl,%eax,%ebx movl %ebx,(%edi,%edx,4) decl %edx - jnz Loop + jnz L(oop) shll %cl,%eax /* compute least significant limb */ movl %eax,(%edi) /* store it */ @@ -76,7 +74,7 @@ L1: movl (%esi,%edx,4),%eax popl %edi ret -Lend: shll %cl,%ebx /* compute least significant limb */ +L(end): shll %cl,%ebx /* compute least significant limb */ movl %ebx,(%edi) /* store it */ popl %ebx diff --git a/sysdeps/i386/memchr.S b/sysdeps/i386/memchr.S index f0fb3abe45..c4dcef1a6c 100644 --- a/sysdeps/i386/memchr.S +++ b/sysdeps/i386/memchr.S @@ -1,7 +1,7 @@ /* memchr (str, ch, n) -- Return pointer to first occurrence of CH in STR less than N. For Intel 80x86, x>=3. - 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 <drepper@gnu.ai.mit.edu> Optimised a little by Alan Modra <Alan@SPRI.Levels.UniSA.Edu.Au> @@ -54,7 +54,7 @@ ENTRY (memchr) /* If my must not test more than three characters test them one by one. This is especially true for 0. */ cmpl $4, %esi - jb L3 + jb L(3) /* At the moment %edx contains C. What we need for the algorithm is C in all bytes of the dword. Avoid @@ -71,30 +71,30 @@ ENTRY (memchr) reached. Don't use a loop for better performance. */ testb $3, %eax /* correctly aligned ? */ - je L2 /* yes => begin loop */ + je L(2) /* yes => begin loop */ cmpb %dl, (%eax) /* compare byte */ - je L9 /* target found => return */ + je L(9) /* target found => return */ incl %eax /* increment source pointer */ decl %esi /* decrement length counter */ - je L4 /* len==0 => return NULL */ + je L(4) /* len==0 => return NULL */ testb $3, %eax /* correctly aligned ? */ - je L2 /* yes => begin loop */ + je L(2) /* yes => begin loop */ cmpb %dl, (%eax) /* compare byte */ - je L9 /* target found => return */ + je L(9) /* target found => return */ incl %eax /* increment source pointer */ decl %esi /* decrement length counter */ - je L4 /* len==0 => return NULL */ + je L(4) /* len==0 => return NULL */ testb $3, %eax /* correctly aligned ? */ - je L2 /* yes => begin loop */ + je L(2) /* yes => begin loop */ cmpb %dl, (%eax) /* compare byte */ - je L9 /* target found => return */ + je L(9) /* target found => return */ incl %eax /* increment source pointer */ decl %esi /* decrement length counter */ /* no test for len==0 here, because this is done in the loop head */ - jmp L2 + jmp L(2) /* We exit the loop if adding MAGIC_BITS to LONGWORD fails to change any of the hole bits of LONGWORD. @@ -127,7 +127,7 @@ ENTRY (memchr) ALIGN (4) -L1: movl (%eax), %ecx /* get word (= 4 bytes) in question */ +L(1): movl (%eax), %ecx /* get word (= 4 bytes) in question */ movl $0xfefefeff, %edi /* magic value */ xorl %edx, %ecx /* XOR with word c|c|c|c => bytes of str == c are now 0 */ @@ -141,7 +141,7 @@ L1: movl (%eax), %ecx /* 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 L8 + jnc L(8) /* We are only interested in carry bits that change due to the previous add, so remove original bits */ @@ -153,7 +153,7 @@ L1: movl (%eax), %ecx /* 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 %edi. */ - jnz L8 /* found it => return pointer */ + jnz L(8) /* found it => return pointer */ /* This process is unfolded four times for better performance. we don't increment the source pointer each time. Instead we @@ -169,12 +169,12 @@ L1: movl (%eax), %ecx /* get word (= 4 bytes) in question */ addl %ecx, %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 => return pointer */ + jnc L(7) /* highest byte is C => return pointer */ xorl %ecx, %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 L7 /* found it => return pointer */ + jnz L(7) /* found it => return pointer */ movl 8(%eax), %ecx /* get word (= 4 bytes) in question */ movl $0xfefefeff, %edi /* magic value */ @@ -183,12 +183,12 @@ L1: movl (%eax), %ecx /* get word (= 4 bytes) in question */ addl %ecx, %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 => return pointer */ + jnc L(6) /* highest byte is C => return pointer */ xorl %ecx, %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 /* found it => return pointer */ + jnz L(6) /* found it => return pointer */ movl 12(%eax), %ecx /* get word (= 4 bytes) in question */ movl $0xfefefeff, %edi /* magic value */ @@ -197,21 +197,21 @@ L1: movl (%eax), %ecx /* get word (= 4 bytes) in question */ addl %ecx, %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 => return pointer */ + jnc L(5) /* highest byte is C => return pointer */ xorl %ecx, %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 /* found it => return pointer */ + jnz L(5) /* found it => return pointer */ /* Adjust both counters for a full round, i.e. 16 bytes. */ addl $16, %eax -L2: subl $16, %esi - jae L1 /* Still more than 16 bytes remaining */ +L(2): subl $16, %esi + jae L(1) /* Still more than 16 bytes remaining */ /* Process remaining bytes separately. */ cmpl $4-16, %esi /* rest < 4 bytes? */ - jb L3 /* yes, than test byte by byte */ + jb L(3) /* yes, than test byte by byte */ movl (%eax), %ecx /* get word (= 4 bytes) in question */ movl $0xfefefeff, %edi /* magic value */ @@ -220,16 +220,16 @@ L2: subl $16, %esi addl %ecx, %edi /* add the magic value to the word. We get carry bits reported for each byte which is *not* 0 */ - jnc L8 /* highest byte is C => return pointer */ + jnc L(8) /* highest byte is C => return pointer */ xorl %ecx, %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. */ - jne L8 /* found it => return pointer */ + jne L(8) /* found it => return pointer */ addl $4, %eax /* adjust source pointer */ cmpl $8-16, %esi /* rest < 8 bytes? */ - jb L3 /* yes, than test byte by byte */ + jb L(3) /* yes, than test byte by byte */ movl (%eax), %ecx /* get word (= 4 bytes) in question */ movl $0xfefefeff, %edi /* magic value */ @@ -238,16 +238,16 @@ L2: subl $16, %esi addl %ecx, %edi /* add the magic value to the word. We get carry bits reported for each byte which is *not* 0 */ - jnc L8 /* highest byte is C => return pointer */ + jnc L(8) /* highest byte is C => return pointer */ xorl %ecx, %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. */ - jne L8 /* found it => return pointer */ + jne L(8) /* found it => return pointer */ addl $4, %eax /* adjust source pointer */ cmpl $12-16, %esi /* rest < 12 bytes? */ - jb L3 /* yes, than test byte by byte */ + jb L(3) /* yes, than test byte by byte */ movl (%eax), %ecx /* get word (= 4 bytes) in question */ movl $0xfefefeff, %edi /* magic value */ @@ -256,60 +256,60 @@ L2: subl $16, %esi addl %ecx, %edi /* add the magic value to the word. We get carry bits reported for each byte which is *not* 0 */ - jnc L8 /* highest byte is C => return pointer */ + jnc L(8) /* highest byte is C => return pointer */ xorl %ecx, %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. */ - jne L8 /* found it => return pointer */ + jne L(8) /* found it => return pointer */ addl $4, %eax /* adjust source pointer */ /* Check the remaining bytes one by one. */ -L3: andl $3, %esi /* mask out uninteresting bytes */ - jz L4 /* no remaining bytes => return NULL */ +L(3): andl $3, %esi /* mask out uninteresting bytes */ + jz L(4) /* no remaining bytes => return NULL */ cmpb %dl, (%eax) /* compare byte with C */ - je L9 /* equal, than return pointer */ + je L(9) /* equal, than return pointer */ incl %eax /* increment source pointer */ decl %esi /* decrement length */ - jz L4 /* no remaining bytes => return NULL */ + jz L(4) /* no remaining bytes => return NULL */ cmpb %dl, (%eax) /* compare byte with C */ - je L9 /* equal, than return pointer */ + je L(9) /* equal, than return pointer */ incl %eax /* increment source pointer */ decl %esi /* decrement length */ - jz L4 /* no remaining bytes => return NULL */ + jz L(4) /* no remaining bytes => return NULL */ cmpb %dl, (%eax) /* compare byte with C */ - je L9 /* equal, than return pointer */ + je L(9) /* equal, than return pointer */ -L4: /* no byte found => return NULL */ +L(4): /* no byte found => return NULL */ xorl %eax, %eax - jmp L9 + jmp L(9) /* add missing source pointer increments */ -L5: addl $4, %eax -L6: addl $4, %eax -L7: addl $4, %eax +L(5): addl $4, %eax +L(6): addl $4, %eax +L(7): addl $4, %eax /* Test for the matching byte in the word. %ecx contains a NUL char in the byte which originally was the byte we are looking at. */ -L8: testb %cl, %cl /* test first byte in dword */ - jz L9 /* if zero => return pointer */ +L(8): testb %cl, %cl /* test first byte in dword */ + jz L(9) /* if zero => return pointer */ incl %eax /* increment source pointer */ testb %ch, %ch /* test second byte in dword */ - jz L9 /* if zero => return pointer */ + jz L(9) /* if zero => return pointer */ incl %eax /* increment source pointer */ testl $0xff0000, %ecx /* test third byte in dword */ - jz L9 /* if zero => return pointer */ + jz L(9) /* if zero => return pointer */ incl %eax /* increment source pointer */ /* No further test needed we we know it is one of the four bytes. */ -L9: popl %edi /* pop saved registers */ +L(9): popl %edi /* pop saved registers */ popl %esi ret diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S index 73714b75fe..5ad8b6e973 100644 --- a/sysdeps/i386/memcmp.S +++ b/sysdeps/i386/memcmp.S @@ -1,22 +1,21 @@ -/* memcmp -- compare two memory blocks for differences in the first COUNT - bytes. -Copyright (C) 1995, 1996 Free Software Foundation, Inc. -This file is part of the GNU C Library. +/* Compare two memory blocks for differences in the first COUNT bytes. + Copyright (C) 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 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 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. + 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. */ + 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 <sysdep.h> #include "asm-syntax.h" @@ -44,7 +43,7 @@ ENTRY (memcmp) repe /* Compare at most %ecx bytes. */ cmpsb - jz L1 /* If even last byte was equal we return 0. */ + jz L(1) /* If even last byte was equal we return 0. */ /* The memory blocks are not equal. So result of the last subtraction is present in the carry flag. It is set when @@ -59,7 +58,7 @@ ENTRY (memcmp) Note that the following operation does not change 0xffffffff. */ orb $1, %al /* Change 0 to 1. */ -L1: popl %esi /* Restore registers. */ +L(1): popl %esi /* Restore registers. */ movl %edx, %edi ret diff --git a/sysdeps/i386/memset.c b/sysdeps/i386/memset.c index 2987445d4f..e1e12fb742 100644 --- a/sysdeps/i386/memset.c +++ b/sysdeps/i386/memset.c @@ -1,32 +1,30 @@ -/* memset -- set a block of memory to some byte value. +/* Set a block of memory to some byte value. For Intel 80x86, x>=3. - Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc. + Copyright (C) 1991, 1992, 1993, 1997 Free Software Foundation, Inc. Contributed by Torbjorn Granlund (tege@sics.se). -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 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. + 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., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + 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 <ansidecl.h> #include <string.h> #include <memcopy.h> #ifdef __GNUC__ -PTR -DEFUN(memset, (dstpp, c, len), - PTR dstpp AND int c AND size_t len) +vod * +memset (void *dstpp, int c, size_t len) { unsigned long int dstp = (unsigned long int) dstpp; diff --git a/sysdeps/i386/mul_1.S b/sysdeps/i386/mul_1.S index b271399980..7c3a62323c 100644 --- a/sysdeps/i386/mul_1.S +++ b/sysdeps/i386/mul_1.S @@ -1,24 +1,22 @@ /* i80386 __mpn_mul_1 -- Multiply a limb vector with a limb and store the result in 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_mul_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)) @@ -65,7 +63,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/rshift.S b/sysdeps/i386/rshift.S index 9abbf9a45d..f00f9d59f2 100644 --- a/sysdeps/i386/rshift.S +++ b/sysdeps/i386/rshift.S @@ -1,23 +1,21 @@ -/* i80386 __mpn_rshift -- +/* i80386 __mpn_rshift -- + 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 @@ -51,22 +49,22 @@ C_SYMBOL_NAME(__mpn_rshift:) xorl %eax,%eax shrdl %cl,%ebx,%eax /* compute carry limb */ incl %edx - jz Lend + jz L(end) pushl %eax /* push carry limb onto stack */ testb $1,%edx - jnz L1 /* enter loop in the middle */ + jnz L(1) /* enter loop in the middle */ movl %ebx,%eax ALIGN (3) -Loop: movl (%esi,%edx,4),%ebx /* load next higher limb */ +L(oop): movl (%esi,%edx,4),%ebx /* load next higher limb */ shrdl %cl,%ebx,%eax /* compute result limb */ movl %eax,(%edi,%edx,4) /* store it */ incl %edx -L1: movl (%esi,%edx,4),%eax +L(1): movl (%esi,%edx,4),%eax shrdl %cl,%eax,%ebx movl %ebx,(%edi,%edx,4) incl %edx - jnz Loop + jnz L(oop) shrl %cl,%eax /* compute most significant limb */ movl %eax,(%edi) /* store it */ @@ -78,7 +76,7 @@ L1: movl (%esi,%edx,4),%eax popl %edi ret -Lend: shrl %cl,%ebx /* compute most significant limb */ +L(end): shrl %cl,%ebx /* compute most significant limb */ movl %ebx,(%edi) /* store it */ popl %ebx diff --git a/sysdeps/i386/stpcpy.S b/sysdeps/i386/stpcpy.S index 73292ab0fb..751e22c1c6 100644 --- a/sysdeps/i386/stpcpy.S +++ b/sysdeps/i386/stpcpy.S @@ -1,7 +1,6 @@ -/* stpcpy -- copy SRC to DEST returning the address of the terminating '\0' - in DEST. +/* Copy SRC to DEST returning the address of the terminating '\0' in DEST. For Intel 80x86, x>=3. - 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 (drepper@gnu.ai.mit.edu). @@ -56,32 +55,32 @@ ENTRY (__stpcpy) is achieved by the use of index+base addressing mode. As the loop counter we use the destination address because this is also the result. */ -L1: addl $4, %eax /* increment loop counter */ +L(1): addl $4, %eax /* increment loop counter */ movb (%eax,%ecx), %dl /* load current char */ movb %dl, (%eax) /* and store it */ testb %dl, %dl /* was it NUL? */ - jz L2 /* yes, then exit */ + jz L(2) /* yes, then exit */ movb 1(%eax,%ecx), %dl /* load current char */ movb %dl, 1(%eax) /* and store it */ testb %dl, %dl /* was it NUL? */ - jz L3 /* yes, then exit */ + jz L(3) /* yes, then exit */ movb 2(%eax,%ecx), %dl /* load current char */ movb %dl, 2(%eax) /* and store it */ testb %dl, %dl /* was it NUL? */ - jz L4 /* yes, then exit */ + jz L(4) /* yes, then exit */ movb 3(%eax,%ecx), %dl /* load current char */ movb %dl, 3(%eax) /* and store it */ testb %dl, %dl /* was it NUL? */ - jnz L1 /* no, then continue loop */ + jnz L(1) /* no, then continue loop */ incl %eax /* correct loop counter */ -L4: incl %eax -L3: incl %eax -L2: +L(4): incl %eax +L(3): incl %eax +L(2): ret END (__stpcpy) diff --git a/sysdeps/i386/stpncpy.S b/sysdeps/i386/stpncpy.S index 96878fb79a..e0213082f8 100644 --- a/sysdeps/i386/stpncpy.S +++ b/sysdeps/i386/stpncpy.S @@ -1,7 +1,7 @@ -/* stpncpy -- copy no more then N bytes from SRC to DEST, returning the - address of the terminating '\0' in DEST. +/* copy no more then N bytes from SRC to DEST, returning the address of + the terminating '\0' in DEST. For Intel 80x86, x>=3. - 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 <drepper@gnu.ai.mit.edu> Some bug fixes by Alan Modra <Alan@SPRI.Levels.UniSA.Edu.Au> @@ -45,98 +45,98 @@ ENTRY (__stpncpy) subl %eax, %esi /* magic: reduce number of loop variants to one using addressing mode */ - jmp L1 /* jump to loop "head" */ + jmp L(1) /* jump to loop "head" */ ALIGN(4) /* Four times unfolded loop with two loop counters. We get the the third value (the source address) by using the index+base addressing mode. */ -L2: movb (%eax,%esi), %dl /* load current char */ +L(2): movb (%eax,%esi), %dl /* load current char */ movb %dl, (%eax) /* and store it */ testb %dl, %dl /* was it NUL? */ - jz L7 /* yes, then exit */ + jz L(7) /* yes, then exit */ movb 1(%eax,%esi), %dl /* load current char */ movb %dl, 1(%eax) /* and store it */ testb %dl, %dl /* was it NUL? */ - jz L6 /* yes, then exit */ + jz L(6) /* yes, then exit */ movb 2(%eax,%esi), %dl /* load current char */ movb %dl, 2(%eax) /* and store it */ testb %dl, %dl /* was it NUL? */ - jz L5 /* yes, then exit */ + jz L(5) /* yes, then exit */ movb 3(%eax,%esi), %dl /* load current char */ movb %dl, 3(%eax) /* and store it */ testb %dl, %dl /* was it NUL? */ - jz L4 /* yes, then exit */ + jz L(4) /* yes, then exit */ addl $4, %eax /* increment loop counter for full round */ -L1: subl $4, %ecx /* still more than 4 bytes allowed? */ - jae L2 /* yes, then go to start of loop */ +L(1): subl $4, %ecx /* still more than 4 bytes allowed? */ + jae L(2) /* yes, then go to start of loop */ /* The maximal remaining 15 bytes are not processed in a loop. */ addl $4, %ecx /* correct above subtraction */ - jz L9 /* maximal allowed char reached => go to end */ + jz L(9) /* maximal allowed char reached => go to end */ movb (%eax,%esi), %dl /* load current char */ movb %dl, (%eax) /* and store it */ testb %dl, %dl /* was it NUL? */ - jz L3 /* yes, then exit */ + jz L(3) /* yes, then exit */ incl %eax /* increment pointer */ decl %ecx /* decrement length counter */ - jz L9 /* no more allowed => exit */ + jz L(9) /* no more allowed => exit */ movb (%eax,%esi), %dl /* load current char */ movb %dl, (%eax) /* and store it */ testb %dl, %dl /* was it NUL? */ - jz L3 /* yes, then exit */ + jz L(3) /* yes, then exit */ incl %eax /* increment pointer */ decl %ecx /* decrement length counter */ - jz L9 /* no more allowed => exit */ + jz L(9) /* no more allowed => exit */ movb (%eax,%esi), %dl /* load current char */ movb %dl, (%eax) /* and store it */ testb %dl, %dl /* was it NUL? */ - jz L3 /* yes, then exit */ + jz L(3) /* yes, then exit */ incl %eax /* increment pointer */ - jmp L9 /* we don't have to test for counter underflow + jmp L(9) /* we don't have to test for counter underflow because we know we had a most 3 bytes remaining => exit */ /* When coming from the main loop we have to adjust the pointer. */ -L4: decl %ecx /* decrement counter */ +L(4): decl %ecx /* decrement counter */ incl %eax /* increment pointer */ -L5: decl %ecx /* increment pointer */ +L(5): decl %ecx /* increment pointer */ incl %eax /* increment pointer */ -L6: decl %ecx /* increment pointer */ +L(6): decl %ecx /* increment pointer */ incl %eax /* increment pointer */ -L7: +L(7): addl $3, %ecx /* correct pre-decrementation of counter at the beginning of the loop; but why 3 and not 4? Very simple, we have to count the NUL char we already wrote. */ - jz L9 /* counter is also 0 => exit */ + jz L(9) /* counter is also 0 => exit */ /* We now have to fill the rest of the buffer with NUL. This is done in a tricky way. Please note that the addressing mode used below is not the same we used above. Here we use the %ecx register. */ -L8: +L(8): movb $0, (%ecx,%eax) /* store NUL char */ -L3: decl %ecx /* all bytes written? */ - jnz L8 /* no, then again */ +L(3): decl %ecx /* all bytes written? */ + jnz L(8) /* no, then again */ -L9: popl %esi /* restore saved register content */ +L(9): popl %esi /* restore saved register content */ ret END (__stpncpy) diff --git a/sysdeps/i386/strchr.S b/sysdeps/i386/strchr.S index e4e5c55572..7bcd73cfe3 100644 --- a/sysdeps/i386/strchr.S +++ b/sysdeps/i386/strchr.S @@ -1,6 +1,6 @@ /* strchr (str, ch) -- Return pointer to first occurrence of CH in STR. For Intel 80x86, x>=3. - 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 <drepper@gnu.ai.mit.edu> Some optimisations by Alan Modra <Alan@SPRI.Levels.UniSA.Edu.Au> @@ -57,34 +57,34 @@ ENTRY (strchr) boundaries are multiples of 4. */ testb $3, %eax /* correctly aligned ? */ - jz L11 /* yes => begin loop */ + jz L(11) /* yes => begin loop */ movb (%eax), %cl /* load byte in question (we need it twice) */ cmpb %cl, %dl /* compare byte */ - je L6 /* target found => return */ + je L(6) /* target found => return */ testb %cl, %cl /* is NUL? */ - jz L2 /* yes => return NULL */ + jz L(2) /* yes => return NULL */ incl %eax /* increment pointer */ testb $3, %eax /* correctly aligned ? */ - jz L11 /* yes => begin loop */ + jz L(11) /* yes => begin loop */ movb (%eax), %cl /* load byte in question (we need it twice) */ cmpb %cl, %dl /* compare byte */ - je L6 /* target found => return */ + je L(6) /* target found => return */ testb %cl, %cl /* is NUL? */ - jz L2 /* yes => return NULL */ + jz L(2) /* yes => return NULL */ incl %eax /* increment pointer */ testb $3, %eax /* correctly aligned ? */ - jz L11 /* yes => begin loop */ + jz L(11) /* yes => begin loop */ movb (%eax), %cl /* load byte in question (we need it twice) */ cmpb %cl, %dl /* compare byte */ - je L6 /* target found => return */ + je L(6) /* target found => return */ testb %cl, %cl /* is NUL? */ - jz L2 /* yes => return NULL */ + jz L(2) /* yes => return NULL */ incl %eax /* increment pointer */ /* No we have reached alignment. */ - jmp L11 /* begin loop */ + jmp L(11) /* begin loop */ /* We exit the loop if adding MAGIC_BITS to LONGWORD fails to change any of the hole bits of LONGWORD. @@ -116,9 +116,9 @@ ENTRY (strchr) ALIGN(4) -L1: addl $16, %eax /* adjust pointer for whole round */ +L(1): addl $16, %eax /* adjust pointer for whole round */ -L11: movl (%eax), %ecx /* get word (= 4 bytes) in question */ +L(11): movl (%eax), %ecx /* get word (= 4 bytes) in question */ xorl %edx, %ecx /* XOR with word c|c|c|c => bytes of str == c are now 0 */ movl $0xfefefeff, %edi /* magic value */ @@ -132,7 +132,7 @@ L11: movl (%eax), %ecx /* 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 L7 + jnc L(7) /* We are only interested in carry bits that change due to the previous add, so remove original bits */ @@ -144,7 +144,7 @@ L11: movl (%eax), %ecx /* 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 %edi. */ - jnz L7 /* found it => return pointer */ + jnz L(7) /* found it => return pointer */ /* Now we made sure the dword does not contain the character we are looking for. But because we deal with strings we have to check @@ -155,12 +155,12 @@ L11: movl (%eax), %ecx /* get word (= 4 bytes) in question */ addl %ecx, %edi /* add the magic value to the word. We get carry bits reported for each byte which is *not* 0 */ - jnc L2 /* highest byte is NUL => return NULL */ + jnc L(2) /* highest byte is NUL => return NULL */ xorl %ecx, %edi /* (word+magic)^word */ 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 L2 /* found NUL => return NULL */ + jnz L(2) /* found NUL => return NULL */ movl 4(%eax), %ecx /* get word (= 4 bytes) in question */ xorl %edx, %ecx /* XOR with word c|c|c|c => bytes of str == c @@ -169,23 +169,23 @@ L11: movl (%eax), %ecx /* get word (= 4 bytes) in question */ addl %ecx, %edi /* add the magic value to the word. We get carry bits reported for each byte which is *not* C */ - jnc L71 /* highest byte is C => return pointer */ + jnc L(71) /* highest byte is C => return pointer */ xorl %ecx, %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 L71 /* found it => return pointer */ + jnz L(71) /* found it => return pointer */ xorl %edx, %ecx /* restore original dword without reload */ movl $0xfefefeff, %edi /* magic value */ addl %ecx, %edi /* add the magic value to the word. We get carry bits reported for each byte which is *not* 0 */ - jnc L2 /* highest byte is NUL => return NULL */ + jnc L(2) /* highest byte is NUL => return NULL */ xorl %ecx, %edi /* (word+magic)^word */ 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 L2 /* found NUL => return NULL */ + jnz L(2) /* found NUL => return NULL */ movl 8(%eax), %ecx /* get word (= 4 bytes) in question */ xorl %edx, %ecx /* XOR with word c|c|c|c => bytes of str == c @@ -194,23 +194,23 @@ L11: movl (%eax), %ecx /* get word (= 4 bytes) in question */ addl %ecx, %edi /* add the magic value to the word. We get carry bits reported for each byte which is *not* C */ - jnc L72 /* highest byte is C => return pointer */ + jnc L(72) /* highest byte is C => return pointer */ xorl %ecx, %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 L72 /* found it => return pointer */ + jnz L(72) /* found it => return pointer */ xorl %edx, %ecx /* restore original dword without reload */ movl $0xfefefeff, %edi /* magic value */ addl %ecx, %edi /* add the magic value to the word. We get carry bits reported for each byte which is *not* 0 */ - jnc L2 /* highest byte is NUL => return NULL */ + jnc L(2) /* highest byte is NUL => return NULL */ xorl %ecx, %edi /* (word+magic)^word */ 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 L2 /* found NUL => return NULL */ + jnz L(2) /* found NUL => return NULL */ movl 12(%eax), %ecx /* get word (= 4 bytes) in question */ xorl %edx, %ecx /* XOR with word c|c|c|c => bytes of str == c @@ -219,59 +219,59 @@ L11: movl (%eax), %ecx /* get word (= 4 bytes) in question */ addl %ecx, %edi /* add the magic value to the word. We get carry bits reported for each byte which is *not* C */ - jnc L73 /* highest byte is C => return pointer */ + jnc L(73) /* highest byte is C => return pointer */ xorl %ecx, %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 L73 /* found it => return pointer */ + jnz L(73) /* found it => return pointer */ xorl %edx, %ecx /* restore original dword without reload */ movl $0xfefefeff, %edi /* magic value */ addl %ecx, %edi /* add the magic value to the word. We get carry bits reported for each byte which is *not* 0 */ - jnc L2 /* highest byte is NUL => return NULL */ + jnc L(2) /* highest byte is NUL => return NULL */ xorl %ecx, %edi /* (word+magic)^word */ 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 L1 /* no NUL found => restart loop */ + jz L(1) /* no NUL found => restart loop */ -L2: /* Return NULL. */ +L(2): /* Return NULL. */ xorl %eax, %eax /* load NULL in return value register */ popl %edi /* restore saved register content */ ret -L73: addl $4, %eax /* adjust pointer */ -L72: addl $4, %eax -L71: addl $4, %eax +L(73): addl $4, %eax /* adjust pointer */ +L(72): addl $4, %eax +L(71): addl $4, %eax /* We now scan for the byte in which the character was matched. But we have to take care of the case that a NUL char is found before this in the dword. */ -L7: testb %cl, %cl /* is first byte C? */ - jz L6 /* yes => return pointer */ +L(7): testb %cl, %cl /* is first byte C? */ + jz L(6) /* yes => return pointer */ cmpb %dl, %cl /* is first byte NUL? */ - je L2 /* yes => return NULL */ + je L(2) /* yes => return NULL */ incl %eax /* it's not in the first byte */ testb %ch, %ch /* is second byte C? */ - jz L6 /* yes => return pointer */ + jz L(6) /* yes => return pointer */ cmpb %dl, %ch /* is second byte NUL? */ - je L2 /* yes => return NULL? */ + je L(2) /* yes => return NULL? */ incl %eax /* it's not in the second byte */ shrl $16, %ecx /* make upper byte accessible */ testb %cl, %cl /* is third byte C? */ - jz L6 /* yes => return pointer */ + jz L(6) /* yes => return pointer */ cmpb %dl, %cl /* is third byte NUL? */ - je L2 /* yes => return NULL */ + je L(2) /* yes => return NULL */ /* It must be in the fourth byte and it cannot be NUL. */ incl %eax -L6: popl %edi /* restore saved register content */ +L(6): popl %edi /* restore saved register content */ ret END (strchr) diff --git a/sysdeps/i386/strcspn.S b/sysdeps/i386/strcspn.S index 47b157a2eb..f2c53122b5 100644 --- a/sysdeps/i386/strcspn.S +++ b/sysdeps/i386/strcspn.S @@ -1,7 +1,7 @@ /* strcspn (str, ss) -- Return the length of the initial segment of STR which contains no characters from SS. For Intel 80x86, x>=3. - 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 <drepper@gnu.ai.mit.edu> Bug fixes by Alan Modra <Alan@SPRI.Levels.UniSA.Edu.Au> @@ -114,28 +114,28 @@ ENTRY (strcspn) /* Don't change the "testb $0xff,%%cl" to "testb %%cl,%%cl". We want longer instructions so that the next loop aligns without adding nops. */ -L2: movb (%eax), %cl /* get byte from stopset */ +L(2): movb (%eax), %cl /* get byte from stopset */ testb %cl, %cl /* is NUL char? */ - jz L1 /* yes => start compare loop */ + jz L(1) /* yes => start compare loop */ movb %cl, (%esp,%ecx) /* set corresponding byte in stopset table */ movb 1(%eax), %cl /* get byte from stopset */ testb $0xff, %cl /* is NUL char? */ - jz L1 /* yes => start compare loop */ + jz L(1) /* yes => start compare loop */ movb %cl, (%esp,%ecx) /* set corresponding byte in stopset table */ movb 2(%eax), %cl /* get byte from stopset */ testb $0xff, %cl /* is NUL char? */ - jz L1 /* yes => start compare loop */ + jz L(1) /* yes => start compare loop */ movb %cl, (%esp,%ecx) /* set corresponding byte in stopset table */ movb 3(%eax), %cl /* get byte from stopset */ addl $4, %eax /* increment stopset pointer */ movb %cl, (%esp,%ecx) /* set corresponding byte in stopset table */ testb $0xff, %cl /* is NUL char? */ - jnz L2 /* no => process next dword from stopset */ + jnz L(2) /* no => process next dword from stopset */ -L1: leal -4(%edx), %eax /* prepare loop */ +L(1): leal -4(%edx), %eax /* prepare loop */ /* We use a neat trick for the following loop. Normally we would have to test for two termination conditions @@ -146,29 +146,29 @@ L1: leal -4(%edx), %eax /* prepare loop */ value in the table. But the value of NUL is NUL so the loop terminates for NUL in every case. */ -L3: addl $4, %eax /* adjust pointer for full loop round */ +L(3): addl $4, %eax /* adjust pointer for full loop round */ movb (%eax), %cl /* get byte from string */ cmpb %cl, (%esp,%ecx) /* is it contained in stopset? */ - je L4 /* yes => return */ + je L(4) /* yes => return */ movb 1(%eax), %cl /* get byte from string */ cmpb %cl, (%esp,%ecx) /* is it contained in stopset? */ - je L5 /* yes => return */ + je L(5) /* yes => return */ movb 2(%eax), %cl /* get byte from string */ cmpb %cl, (%esp,%ecx) /* is it contained in stopset? */ - je L6 /* yes => return */ + je L(6) /* yes => return */ movb 3(%eax), %cl /* get byte from string */ cmpb %cl, (%esp,%ecx) /* is it contained in stopset? */ - jne L3 /* yes => return */ + jne L(3) /* yes => return */ incl %eax /* adjust pointer */ -L6: incl %eax -L5: incl %eax +L(6): incl %eax +L(5): incl %eax -L4: subl %edx, %eax /* we have to return the number of valid +L(4): subl %edx, %eax /* we have to return the number of valid characters, so compute distance to first non-valid character */ addl $256, %esp /* remove stopset */ diff --git a/sysdeps/i386/strlen.c b/sysdeps/i386/strlen.c index 6305d364c8..b86c3935d3 100644 --- a/sysdeps/i386/strlen.c +++ b/sysdeps/i386/strlen.c @@ -1,22 +1,21 @@ -/* strlen -- determine the length of a string. - For Intel 80x86, x>=3. - Copyright (C) 1991, 1992, 1993, 1996 Free Software Foundation, Inc. +/* Determine the length of a string. For Intel 80x86, x>=3. + Copyright (C) 1991, 1992, 1993, 1996, 1997 Free Software Foundation, Inc. Contributed by Torbjorn Granlund (tege@sics.se). -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 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. + 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., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + 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 <string.h> diff --git a/sysdeps/i386/strpbrk.S b/sysdeps/i386/strpbrk.S index 5d0dfece4a..ff0990272a 100644 --- a/sysdeps/i386/strpbrk.S +++ b/sysdeps/i386/strpbrk.S @@ -1,25 +1,25 @@ /* strcspn (str, ss) -- Return the length of the initial segement of STR which contains no characters from SS. -For Intel 80x86, x>=3. -Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. -Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu> -Bug fixes by Alan Modra <Alan@SPRI.Levels.UniSA.Edu.Au> -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. */ + For Intel 80x86, x>=3. + Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc. + Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu> + Bug fixes by Alan Modra <Alan@SPRI.Levels.UniSA.Edu.Au> + 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 <sysdep.h> #include "asm-syntax.h" @@ -114,28 +114,28 @@ ENTRY (strpbrk) /* Don't change the "testb $0xff,%%cl" to "testb %%cl,%%cl". We want longer instructions so that the next loop aligns without adding nops. */ -L2: movb (%eax), %cl /* get byte from stopset */ +L(2): movb (%eax), %cl /* get byte from stopset */ testb %cl, %cl /* is NUL char? */ - jz L1 /* yes => start compare loop */ + jz L(1) /* yes => start compare loop */ movb %cl, (%esp,%ecx) /* set corresponding byte in stopset table */ movb 1(%eax), %cl /* get byte from stopset */ testb $0xff, %cl /* is NUL char? */ - jz L1 /* yes => start compare loop */ + jz L(1) /* yes => start compare loop */ movb %cl, (%esp,%ecx) /* set corresponding byte in stopset table */ movb 2(%eax), %cl /* get byte from stopset */ testb $0xff, %cl /* is NUL char? */ - jz L1 /* yes => start compare loop */ + jz L(1) /* yes => start compare loop */ movb %cl, (%esp,%ecx) /* set corresponding byte in stopset table */ movb 3(%eax), %cl /* get byte from stopset */ addl $4, %eax /* increment stopset pointer */ movb %cl, (%esp,%ecx) /* set corresponding byte in stopset table */ testb $0xff, %cl /* is NUL char? */ - jnz L2 /* no => process next dword from stopset */ + jnz L(2) /* no => process next dword from stopset */ -L1: leal -4(%edx), %eax /* prepare loop */ +L(1): leal -4(%edx), %eax /* prepare loop */ /* We use a neat trick for the following loop. Normally we would have to test for two termination conditions @@ -146,33 +146,33 @@ L1: leal -4(%edx), %eax /* prepare loop */ value in the table. But the value of NUL is NUL so the loop terminates for NUL in every case. */ -L3: addl $4, %eax /* adjust pointer for full loop round */ +L(3): addl $4, %eax /* adjust pointer for full loop round */ movb (%eax), %cl /* get byte from string */ cmpb %cl, (%esp,%ecx) /* is it contained in stopset? */ - je L4 /* yes => return */ + je L(4) /* yes => return */ movb 1(%eax), %cl /* get byte from string */ cmpb %cl, (%esp,%ecx) /* is it contained in stopset? */ - je L5 /* yes => return */ + je L(5) /* yes => return */ movb 2(%eax), %cl /* get byte from string */ cmpb %cl, (%esp,%ecx) /* is it contained in stopset? */ - je L6 /* yes => return */ + je L(6) /* yes => return */ movb 3(%eax), %cl /* get byte from string */ cmpb %cl, (%esp,%ecx) /* is it contained in stopset? */ - jne L3 /* yes => return */ + jne L(3) /* yes => return */ incl %eax /* adjust pointer */ -L6: incl %eax -L5: incl %eax +L(6): incl %eax +L(5): incl %eax -L4: addl $256, %esp /* remove stopset */ +L(4): addl $256, %esp /* remove stopset */ orb %cl, %cl /* was last character NUL? */ - jnz L7 /* no => return pointer */ + jnz L(7) /* no => return pointer */ xorl %eax, %eax /* return NULL */ -L7: ret +L(7): ret END (strpbrk) diff --git a/sysdeps/i386/strrchr.S b/sysdeps/i386/strrchr.S index 3786d3f690..111f986dd8 100644 --- a/sysdeps/i386/strrchr.S +++ b/sysdeps/i386/strrchr.S @@ -1,6 +1,6 @@ /* strrchr (str, ch) -- Return pointer to last occurrence of CH in STR. For Intel 80x86, x>=3. - 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 <drepper@gnu.ai.mit.edu> Some optimisations by Alan Modra <Alan@SPRI.Levels.UniSA.Edu.Au> @@ -59,37 +59,37 @@ ENTRY (strrchr) boundaries are multiples of 4. */ testl $3, %esi /* correctly aligned ? */ - jz L19 /* yes => begin loop */ + jz L(19) /* yes => begin loop */ movb (%esi), %dl /* load byte in question (we need it twice) */ cmpb %dl, %cl /* compare byte */ - jne L11 /* target found => return */ + jne L(11) /* target found => return */ movl %esi, %eax /* remember pointer as possible result */ -L11: orb %dl, %dl /* is NUL? */ - jz L2 /* yes => return NULL */ +L(11): orb %dl, %dl /* is NUL? */ + jz L(2) /* yes => return NULL */ incl %esi /* increment pointer */ testl $3, %esi /* correctly aligned ? */ - jz L19 /* yes => begin loop */ + jz L(19) /* yes => begin loop */ movb (%esi), %dl /* load byte in question (we need it twice) */ cmpb %dl, %cl /* compare byte */ - jne L12 /* target found => return */ + jne L(12) /* target found => return */ movl %esi, %eax /* remember pointer as result */ -L12: orb %dl, %dl /* is NUL? */ - jz L2 /* yes => return NULL */ +L(12): orb %dl, %dl /* is NUL? */ + jz L(2) /* yes => return NULL */ incl %esi /* increment pointer */ testl $3, %esi /* correctly aligned ? */ - jz L19 /* yes => begin loop */ + jz L(19) /* yes => begin loop */ movb (%esi), %dl /* load byte in question (we need it twice) */ cmpb %dl, %cl /* compare byte */ - jne L13 /* target found => return */ + jne L(13) /* target found => return */ movl %esi, %eax /* remember pointer as result */ -L13: orb %dl, %dl /* is NUL? */ - jz L2 /* yes => return NULL */ +L(13): orb %dl, %dl /* is NUL? */ + jz L(2) /* yes => return NULL */ incl %esi /* increment pointer */ /* No we have reached alignment. */ - jmp L19 /* begin loop */ + jmp L(19) /* begin loop */ /* We exit the loop if adding MAGIC_BITS to LONGWORD fails to change any of the hole bits of LONGWORD. @@ -140,34 +140,34 @@ L13: orb %dl, %dl /* is NUL? */ .byte 0 #endif -L4: subl $4, %esi /* adjust pointer */ -L41: subl $4, %esi -L42: subl $4, %esi -L43: testl $0xff000000, %edx /* is highest byte == C? */ - jnz L33 /* no => try other bytes */ +L(4): subl $4, %esi /* adjust pointer */ +L(41): subl $4, %esi +L(42): subl $4, %esi +L(43): testl $0xff000000, %edx /* is highest byte == C? */ + jnz L(33) /* no => try other bytes */ leal 15(%esi), %eax /* store address as result */ - jmp L1 /* and start loop again */ + jmp L(1) /* and start loop again */ -L3: subl $4, %esi /* adjust pointer */ -L31: subl $4, %esi -L32: subl $4, %esi -L33: testl $0xff0000, %edx /* is C in third byte? */ - jnz L51 /* no => try other bytes */ +L(3): subl $4, %esi /* adjust pointer */ +L(31): subl $4, %esi +L(32): subl $4, %esi +L(33): testl $0xff0000, %edx /* is C in third byte? */ + jnz L(51) /* no => try other bytes */ leal 14(%esi), %eax /* store address as result */ - jmp L1 /* and start loop again */ + jmp L(1) /* and start loop again */ -L51: +L(51): /* At this point we know that the byte is in one of the lower bytes. We make a guess and correct it if necessary. This reduces the number of necessary jumps. */ leal 12(%esi), %eax /* guess address of lowest byte as result */ testb %dh, %dh /* is guess correct? */ - jnz L1 /* yes => start loop */ + jnz L(1) /* yes => start loop */ leal 13(%esi), %eax /* correct guess to second byte */ -L1: addl $16, %esi /* increment pointer for full round */ +L(1): addl $16, %esi /* increment pointer for full round */ -L19: movl (%esi), %edx /* get word (= 4 bytes) in question */ +L(19): movl (%esi), %edx /* get word (= 4 bytes) in question */ movl $0xfefefeff, %edi /* magic value */ addl %edx, %edi /* add the magic value to the word. We get carry bits reported for each byte which @@ -180,7 +180,7 @@ L19: movl (%esi), %edx /* get word (= 4 bytes) in question */ 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 L20 /* found NUL => check last word */ + jnc L(20) /* found NUL => check last word */ /* We are only interested in carry bits that change due to the previous add, so remove original bits */ @@ -192,7 +192,7 @@ L19: movl (%esi), %edx /* 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 %edi. */ - jnz L20 /* found NUL => check last word */ + jnz L(20) /* found NUL => check last word */ /* Now we made sure the dword does not contain the character we are looking for. But because we deal with strings we have to check @@ -204,89 +204,89 @@ L19: movl (%esi), %edx /* get word (= 4 bytes) in question */ addl %edx, %edi /* add the magic value to the word. We get carry bits reported for each byte which is *not* 0 */ - jnc L4 /* highest byte is C => examine dword */ + jnc L(4) /* highest byte is C => examine dword */ xorl %edx, %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 L3 /* C is detected in the word => examine it */ + jnz L(3) /* C is detected in the word => examine it */ movl 4(%esi), %edx /* get word (= 4 bytes) in question */ movl $0xfefefeff, %edi /* magic value */ addl %edx, %edi /* add the magic value to the word. We get carry bits reported for each byte which is *not* 0 */ - jnc L21 /* found NUL => check last word */ + jnc L(21) /* found NUL => check last word */ xorl %edx, %edi /* (word+magic)^word */ 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 L21 /* found NUL => check last word */ + jnz L(21) /* found NUL => check last word */ xorl %ecx, %edx /* XOR with word c|c|c|c => bytes of str == c are now 0 */ movl $0xfefefeff, %edi /* magic value */ addl %edx, %edi /* add the magic value to the word. We get carry bits reported for each byte which is *not* 0 */ - jnc L41 /* highest byte is C => examine dword */ + jnc L(41) /* highest byte is C => examine dword */ xorl %edx, %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 L31 /* C is detected in the word => examine it */ + jnz L(31) /* C is detected in the word => examine it */ movl 8(%esi), %edx /* get word (= 4 bytes) in question */ movl $0xfefefeff, %edi /* magic value */ addl %edx, %edi /* add the magic value to the word. We get carry bits reported for each byte which is *not* 0 */ - jnc L22 /* found NUL => check last word */ + jnc L(22) /* found NUL => check last word */ xorl %edx, %edi /* (word+magic)^word */ 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 L22 /* found NUL => check last word */ + jnz L(22) /* found NUL => check last word */ xorl %ecx, %edx /* XOR with word c|c|c|c => bytes of str == c are now 0 */ movl $0xfefefeff, %edi /* magic value */ addl %edx, %edi /* add the magic value to the word. We get carry bits reported for each byte which is *not* 0 */ - jnc L42 /* highest byte is C => examine dword */ + jnc L(42) /* highest byte is C => examine dword */ xorl %edx, %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 L32 /* C is detected in the word => examine it */ + jnz L(32) /* C is detected in the word => examine it */ movl 12(%esi), %edx /* get word (= 4 bytes) in question */ movl $0xfefefeff, %edi /* magic value */ addl %edx, %edi /* add the magic value to the word. We get carry bits reported for each byte which is *not* 0 */ - jnc L23 /* found NUL => check last word */ + jnc L(23) /* found NUL => check last word */ xorl %edx, %edi /* (word+magic)^word */ 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 L23 /* found NUL => check last word */ + jnz L(23) /* found NUL => check last word */ xorl %ecx, %edx /* XOR with word c|c|c|c => bytes of str == c are now 0 */ movl $0xfefefeff, %edi /* magic value */ addl %edx, %edi /* add the magic value to the word. We get carry bits reported for each byte which is *not* 0 */ - jnc L43 /* highest byte is C => examine dword */ + jnc L(43) /* highest byte is C => examine dword */ xorl %edx, %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 L1 /* C is not detected => restart loop */ - jmp L33 /* examine word */ + jz L(1) /* C is not detected => restart loop */ + jmp L(33) /* examine word */ -L23: addl $4, %esi /* adjust pointer */ -L22: addl $4, %esi -L21: addl $4, %esi +L(23): addl $4, %esi /* adjust pointer */ +L(22): addl $4, %esi +L(21): addl $4, %esi /* What remains to do is to test which byte the NUL char is and whether the searched character appears in one of the bytes @@ -294,30 +294,30 @@ L21: addl $4, %esi In this case a pointer to the terminating NUL char has to be returned. */ -L20: cmpb %cl, %dl /* is first byte == C? */ - jne L24 /* no => skip */ +L(20): cmpb %cl, %dl /* is first byte == C? */ + jne L(24) /* no => skip */ movl %esi, %eax /* store address as result */ -L24: testb %dl, %dl /* is first byte == NUL? */ - jz L2 /* yes => return */ +L(24): testb %dl, %dl /* is first byte == NUL? */ + jz L(2) /* yes => return */ cmpb %cl, %dh /* is second byte == C? */ - jne L25 /* no => skip */ + jne L(25) /* no => skip */ leal 1(%esi), %eax /* store address as result */ -L25: testb %dh, %dh /* is second byte == NUL? */ - jz L2 /* yes => return */ +L(25): testb %dh, %dh /* is second byte == NUL? */ + jz L(2) /* yes => return */ shrl $16,%edx /* make upper bytes accessible */ cmpb %cl, %dl /* is third byte == C */ - jne L26 /* no => skip */ + jne L(26) /* no => skip */ leal 2(%esi), %eax /* store address as result */ -L26: testb %dl, %dl /* is third byte == NUL */ - jz L2 /* yes => return */ +L(26): testb %dl, %dl /* is third byte == NUL */ + jz L(2) /* yes => return */ cmpb %cl, %dh /* is fourth byte == C */ - jne L2 /* no => skip */ + jne L(2) /* no => skip */ leal 3(%esi), %eax /* store address as result */ -L2: popl %esi /* restore saved register content */ +L(2): popl %esi /* restore saved register content */ popl %edi ret diff --git a/sysdeps/i386/strspn.S b/sysdeps/i386/strspn.S index 72e0e7d41a..9f83adcc27 100644 --- a/sysdeps/i386/strspn.S +++ b/sysdeps/i386/strspn.S @@ -1,7 +1,7 @@ /* strcspn (str, ss) -- Return the length of the initial segment of STR which contains only characters from SS. For Intel 80x86, x>=3. - 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 <drepper@gnu.ai.mit.edu> Bug fixes by Alan Modra <Alan@SPRI.Levels.UniSA.Edu.Au> @@ -114,28 +114,28 @@ ENTRY (strspn) /* Don't change the "testb $0xff,%%cl" to "testb %%cl,%%cl". We want longer instructions so that the next loop aligns without adding nops. */ -L2: movb (%eax), %cl /* get byte from stopset */ +L(2): movb (%eax), %cl /* get byte from stopset */ testb %cl, %cl /* is NUL char? */ - jz L1 /* yes => start compare loop */ + jz L(1) /* yes => start compare loop */ movb %cl, (%esp,%ecx) /* set corresponding byte in stopset table */ movb 1(%eax), %cl /* get byte from stopset */ testb $0xff, %cl /* is NUL char? */ - jz L1 /* yes => start compare loop */ + jz L(1) /* yes => start compare loop */ movb %cl, (%esp,%ecx) /* set corresponding byte in stopset table */ movb 2(%eax), %cl /* get byte from stopset */ testb $0xff, %cl /* is NUL char? */ - jz L1 /* yes => start compare loop */ + jz L(1) /* yes => start compare loop */ movb %cl, (%esp,%ecx) /* set corresponding byte in stopset table */ movb 3(%eax), %cl /* get byte from stopset */ addl $4, %eax /* increment stopset pointer */ movb %cl, (%esp,%ecx) /* set corresponding byte in stopset table */ testb $0xff, %cl /* is NUL char? */ - jnz L2 /* no => process next dword from stopset */ + jnz L(2) /* no => process next dword from stopset */ -L1: leal -4(%edx), %eax /* prepare loop */ +L(1): leal -4(%edx), %eax /* prepare loop */ /* We use a neat trick for the following loop. Normally we would have to test for two termination conditions @@ -146,29 +146,29 @@ L1: leal -4(%edx), %eax /* prepare loop */ value in the table. But the value of NUL is NUL so the loop terminates for NUL in every case. */ -L3: addl $4, %eax /* adjust pointer for full loop round */ +L(3): addl $4, %eax /* adjust pointer for full loop round */ movb (%eax), %cl /* get byte from string */ testb %cl, (%esp,%ecx) /* is it contained in skipset? */ - jz L4 /* no => return */ + jz L(4) /* no => return */ movb 1(%eax), %cl /* get byte from string */ testb %cl, (%esp,%ecx) /* is it contained in skipset? */ - jz L5 /* no => return */ + jz L(5) /* no => return */ movb 2(%eax), %cl /* get byte from string */ testb %cl, (%esp,%ecx) /* is it contained in skipset? */ - jz L6 /* no => return */ + jz L(6) /* no => return */ movb 3(%eax), %cl /* get byte from string */ testb %cl, (%esp,%ecx) /* is it contained in skipset? */ - jnz L3 /* yes => start loop again */ + jnz L(3) /* yes => start loop again */ incl %eax /* adjust pointer */ -L6: incl %eax -L5: incl %eax +L(6): incl %eax +L(5): incl %eax -L4: subl %edx, %eax /* we have to return the number of valid +L(4): subl %edx, %eax /* we have to return the number of valid characters, so compute distance to first non-valid character */ addl $256, %esp /* remove stopset */ diff --git a/sysdeps/i386/strtok.S b/sysdeps/i386/strtok.S index 19f62cf4e0..3d09dd7406 100644 --- a/sysdeps/i386/strtok.S +++ b/sysdeps/i386/strtok.S @@ -1,25 +1,26 @@ /* strtok (str, delim) -- Return next DELIM separated token from STR. -For Intel 80x86, x>=3. -Copyright (C) 1996 Free Software Foundation, Inc. -This file is part of the GNU C Library. -Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. - -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. */ + For Intel 80x86, x>=3. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. + + 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 <sysdep.h> +#include "asm-syntax.h" /* This file can be used for three variants of the strtok function: @@ -56,15 +57,16 @@ ENTRY (FUNCTION) #if !defined (USE_AS_STRTOK_R) && defined (PIC) pushl %ebx /* Save PIC register. */ - call Lhere -Lhere: popl %ebx - addl $_GLOBAL_OFFSET_TABLE_+[.-Lhere], %ebx + call L(here) +L(here): + popl %ebx + addl $_GLOBAL_OFFSET_TABLE_+[.-L(here)], %ebx #endif /* If the pointer is NULL we have to use the stored value of the last run. */ cmpl $0, %edx - jne L0 + jne L(0) #ifdef USE_AS_STRTOK_R /* The value is stored in the third argument. */ @@ -80,7 +82,7 @@ Lhere: popl %ebx # endif #endif -L0: +L(0): /* First we create a table with flags for all possible characters. For the ASCII (7bit/8bit) or ISO-8859-X character sets which are supported by the C string functions we have 256 characters. @@ -157,28 +159,28 @@ L0: Although all the following instruction only modify %cl we always have a correct zero-extended 32-bit value in %ecx. */ -L2: movb (%eax), %cl /* get byte from stopset */ +L(2): movb (%eax), %cl /* get byte from stopset */ testb %cl, %cl /* is NUL char? */ - jz L1 /* yes => start compare loop */ + jz L(1) /* yes => start compare loop */ movb %cl, (%esp,%ecx) /* set corresponding byte in stopset table */ movb 1(%eax), %cl /* get byte from stopset */ testb $0xff, %cl /* is NUL char? */ - jz L1 /* yes => start compare loop */ + jz L(1) /* yes => start compare loop */ movb %cl, (%esp,%ecx) /* set corresponding byte in stopset table */ movb 2(%eax), %cl /* get byte from stopset */ testb $0xff, %cl /* is NUL char? */ - jz L1 /* yes => start compare loop */ + jz L(1) /* yes => start compare loop */ movb %cl, (%esp,%ecx) /* set corresponding byte in stopset table */ movb 3(%eax), %cl /* get byte from stopset */ addl $4, %eax /* increment stopset pointer */ movb %cl, (%esp,%ecx) /* set corresponding byte in stopset table */ testb $0xff, %cl /* is NUL char? */ - jnz L2 /* no => process next dword from stopset */ + jnz L(2) /* no => process next dword from stopset */ -L1: leal -4(%edx), %eax /* prepare loop */ +L(1): leal -4(%edx), %eax /* prepare loop */ /* We use a neat trick for the following loop. Normally we would have to test for two termination conditions @@ -189,68 +191,68 @@ L1: leal -4(%edx), %eax /* prepare loop */ value in the table. The value of NUL is NUL so the loop terminates for NUL in every case. */ -L3: addl $4, %eax /* adjust pointer for full loop round */ +L(3): addl $4, %eax /* adjust pointer for full loop round */ movb (%eax), %cl /* get byte from string */ testb %cl, (%esp,%ecx) /* is it contained in stopset? */ - jz L4 /* no => start of token */ + jz L(4) /* no => start of token */ movb 1(%eax), %cl /* get byte from string */ testb %cl, (%esp,%ecx) /* is it contained in stopset? */ - jz L5 /* no => start of token */ + jz L(5) /* no => start of token */ movb 2(%eax), %cl /* get byte from string */ testb %cl, (%esp,%ecx) /* is it contained in stopset? */ - jz L6 /* no => start of token */ + jz L(6) /* no => start of token */ movb 3(%eax), %cl /* get byte from string */ testb %cl, (%esp,%ecx) /* is it contained in stopset? */ - jnz L3 /* yes => start of loop */ + jnz L(3) /* yes => start of loop */ incl %eax /* adjust pointer */ -L6: incl %eax -L5: incl %eax +L(6): incl %eax +L(5): incl %eax /* Now we have to terminate the string. */ -L4: leal -4(%eax), %edx /* We use %EDX for the next run. */ +L(4): leal -4(%eax), %edx /* We use %EDX for the next run. */ -L7: addl $4, %edx /* adjust pointer for full loop round */ +L(7): addl $4, %edx /* adjust pointer for full loop round */ movb (%edx), %cl /* get byte from string */ cmpb %cl, (%esp,%ecx) /* is it contained in skipset? */ - je L8 /* yes => return */ + je L(8) /* yes => return */ movb 1(%edx), %cl /* get byte from string */ cmpb %cl, (%esp,%ecx) /* is it contained in skipset? */ - je L9 /* yes => return */ + je L(9) /* yes => return */ movb 2(%edx), %cl /* get byte from string */ cmpb %cl, (%esp,%ecx) /* is it contained in skipset? */ - je L10 /* yes => return */ + je L(10) /* yes => return */ movb 3(%edx), %cl /* get byte from string */ cmpb %cl, (%esp,%ecx) /* is it contained in skipset? */ - jne L7 /* no => start loop again */ + jne L(7) /* no => start loop again */ incl %edx /* adjust pointer */ -L10: incl %edx -L9: incl %edx +L(10): incl %edx +L(9): incl %edx -L8: /* Remove the stopset table. */ +L(8): /* Remove the stopset table. */ addl $256, %esp cmpl %eax, %edx - je LreturnNULL /* There was no token anymore. */ + je L(returnNULL) /* There was no token anymore. */ movb $0, (%edx) /* Terminate string. */ /* Are we at end of string? */ cmpb $0, %cl - je L11 + je L(11) incl %edx -L11: +L(11): /* Store the pointer to the next character. */ #ifdef USE_AS_STRTOK_R @@ -266,7 +268,7 @@ L11: #endif ret -LreturnNULL: +L(returnNULL): xorl %eax, %eax /* Store current pointer for next round. */ diff --git a/sysdeps/i386/sub_n.S b/sysdeps/i386/sub_n.S index ec93d1bd57..229734c2e9 100644 --- a/sysdeps/i386/sub_n.S +++ b/sysdeps/i386/sub_n.S @@ -1,24 +1,22 @@ /* i80386 __mpn_sub_n -- 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_sub_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_sub_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 sbbl (%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/submul_1.S b/sysdeps/i386/submul_1.S index 730e732045..8efef7609f 100644 --- a/sysdeps/i386/submul_1.S +++ b/sysdeps/i386/submul_1.S @@ -1,24 +1,22 @@ /* i80386 __mpn_submul_1 -- Multiply a limb vector with a limb and subtract the result from 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_submul_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/libm-ieee754/s_cexp.c b/sysdeps/libm-ieee754/s_cexp.c index 233a40014f..f6b443ddba 100644 --- a/sysdeps/libm-ieee754/s_cexp.c +++ b/sysdeps/libm-ieee754/s_cexp.c @@ -33,8 +33,16 @@ __cexp (__complex__ double x) { double exp_val = __exp (__real__ x); - __real__ retval = exp_val * __cos (__imag__ x); - __imag__ retval = exp_val * __sin (__imag__ x); + if (isfinite (exp_val)) + { + __real__ retval = exp_val * __cos (__imag__ x); + __imag__ retval = exp_val * __sin (__imag__ x); + } + else + { + __real__ retval = __copysign (exp_val, __cos (__imag__ x)); + __imag__ retval = __copysign (exp_val, __sin (__imag__ x)); + } } else { @@ -48,14 +56,17 @@ __cexp (__complex__ double x) { if (isfinite (__imag__ x)) { - if (signbit (__real__ x) == 0 && __imag__ x == 0.0) - retval = HUGE_VAL; + double value = signbit (__real__ x) ? 0.0 : HUGE_VAL; + + if (__imag__ x == 0.0) + { + __real__ retval = value; + __imag__ retval = __imag__ x; + } else { - double value = signbit (__real__ x) ? 0.0 : HUGE_VAL; - - __real__ retval = value * __cos (__imag__ x); - __imag__ retval = value * __sin (__imag__ x); + __real__ retval = __copysign (value, __cos (__imag__ x)); + __imag__ retval = __copysign (value, __sin (__imag__ x)); } } else if (signbit (__real__ x) == 0) @@ -64,7 +75,10 @@ __cexp (__complex__ double x) __imag__ retval = __nan (""); } else - retval = 0.0; + { + __real__ retval = 0.0; + __imag__ retval = __copysign (0.0, __imag__ x); + } } else { diff --git a/sysdeps/powerpc/bsd-setjmp.S b/sysdeps/powerpc/bsd-setjmp.S index 19c2fe308c..1a6300660e 100644 --- a/sysdeps/powerpc/bsd-setjmp.S +++ b/sysdeps/powerpc/bsd-setjmp.S @@ -23,11 +23,14 @@ #include <sysdep.h> -ENTRY (setjmp) +ENTRY (__setjmp) li 4,1 /* Set second argument to 1. */ #ifdef PIC b __sigsetjmp@plt #else b __sigsetjmp #endif -END (setjmp) +END (__setjmp) + + .globl setjmp + .set setjmp,__setjmp diff --git a/sysdeps/powerpc/dl-machine.h b/sysdeps/powerpc/dl-machine.h index 526887da18..ab22e46956 100644 --- a/sysdeps/powerpc/dl-machine.h +++ b/sysdeps/powerpc/dl-machine.h @@ -188,14 +188,21 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, finaladdr = reloc->r_addend; } else - finaladdr = (loadbase + (Elf32_Word) (char *) sym->st_value + - reloc->r_addend); + finaladdr = (loadbase + (Elf32_Word) (char *) sym->st_value + + reloc->r_addend); } /* This is an if/else if chain because GCC 2.7.2.[012] turns case statements into non-PIC table lookups. When a later version comes out that fixes this, this should be changed. */ - if (rinfo == R_PPC_ADDR16_LO) + if (rinfo == R_PPC_UADDR32 || + rinfo == R_PPC_GLOB_DAT || + rinfo == R_PPC_ADDR32 || + rinfo == R_PPC_RELATIVE) + { + *reloc_addr = finaladdr; + } + else if (rinfo == R_PPC_ADDR16_LO) { *(Elf32_Half*) reloc_addr = finaladdr; } @@ -205,32 +212,29 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, } else if (rinfo == R_PPC_ADDR16_HA) { - *(Elf32_Half*) reloc_addr = finaladdr + 0x8000 >> 16; + *(Elf32_Half*) reloc_addr = (finaladdr + 0x8000) >> 16; } +#ifndef RTLD_BOOTSTRAP else if (rinfo == R_PPC_REL24) { Elf32_Sword delta = finaladdr - (Elf32_Word) (char *) reloc_addr; - assert (delta << 6 >> 6 == delta); + if (delta << 6 >> 6 != delta) + _dl_signal_error (0, map->l_name, + "R_PPC_REL24 relocation out of range"); *reloc_addr = *reloc_addr & 0xfc000003 | delta & 0x3fffffc; } - else if (rinfo == R_PPC_UADDR32 || - rinfo == R_PPC_GLOB_DAT || - rinfo == R_PPC_ADDR32 || - rinfo == R_PPC_RELATIVE) - { - *reloc_addr = finaladdr; - } else if (rinfo == R_PPC_ADDR24) { - assert (finaladdr << 6 >> 6 == finaladdr); + if (finaladdr << 6 >> 6 != finaladdr) + _dl_signal_error (0, map->l_name, + "R_PPC_ADDR24 relocation out of range"); *reloc_addr = *reloc_addr & 0xfc000003 | finaladdr & 0x3fffffc; } else if (rinfo == R_PPC_COPY) { - /* Memcpy is safe to use here, because ld.so doesn't have any - COPY relocs (it's self-contained). */ memcpy (reloc_addr, (char *) finaladdr, sym->st_size); } +#endif else if (rinfo == R_PPC_REL32) { *reloc_addr = finaladdr - (Elf32_Word) (char *) reloc_addr; @@ -239,41 +243,44 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, { Elf32_Sword delta = finaladdr - (Elf32_Word) (char *) reloc_addr; if (delta << 6 >> 6 == delta) - *reloc_addr = OPCODE_B(delta); + *reloc_addr = OPCODE_B (delta); else if (finaladdr <= 0x01fffffc || finaladdr >= 0xfe000000) - *reloc_addr = OPCODE_BA(finaladdr); + *reloc_addr = OPCODE_BA (finaladdr); else { - Elf32_Word *plt = (Elf32_Word *)((char *)map->l_addr + - map->l_info[DT_PLTGOT]->d_un.d_val); - Elf32_Word index = (reloc_addr - plt - PLT_INITIAL_ENTRY_WORDS)/2; - Elf32_Word offset = index * 2 + PLT_INITIAL_ENTRY_WORDS; + Elf32_Word *plt; + Elf32_Word index; + + plt = (Elf32_Word *)((char *)map->l_addr + + map->l_info[DT_PLTGOT]->d_un.d_val); + index = (reloc_addr - plt - PLT_INITIAL_ENTRY_WORDS)/2; if (index >= PLT_DOUBLE_SIZE) { - /* Slots greater than or equal to 2^13 have 4 words - available instead of two. */ - plt[offset ] = OPCODE_LI (11,finaladdr); - plt[offset+1] = OPCODE_ADDIS (11,11,finaladdr + 0x8000 >> 16); - plt[offset+2] = OPCODE_MTCTR (11); - plt[offset+3] = OPCODE_BCTR (); + /* Slots greater than or equal to 2^13 have 4 words available + instead of two. */ + reloc_addr[0] = OPCODE_LI (11, finaladdr); + reloc_addr[1] = OPCODE_ADDIS (11, 11, finaladdr + 0x8000 >> 16); + reloc_addr[2] = OPCODE_MTCTR (11); + reloc_addr[3] = OPCODE_BCTR (); } else { Elf32_Word num_plt_entries; - Elf32_Word rel_offset_words; num_plt_entries = (map->l_info[DT_PLTRELSZ]->d_un.d_val / sizeof(Elf32_Rela)); - rel_offset_words = PLT_DATA_START_WORDS (num_plt_entries); - plt[offset ] = OPCODE_LI (11,index * 4); - plt[offset+1] = OPCODE_B (-(4 * (offset + 1 - - PLT_LONGBRANCH_ENTRY_WORDS))); - plt[index + rel_offset_words] = finaladdr; + reloc_addr[0] = OPCODE_LI (11, index*4); + reloc_addr[1] = + OPCODE_B (-(4*(index*2 + + 1 + - PLT_LONGBRANCH_ENTRY_WORDS + + PLT_INITIAL_ENTRY_WORDS))); + plt[index+PLT_DATA_START_WORDS (num_plt_entries)] = finaladdr; } } - MODIFIED_CODE(reloc_addr); + MODIFIED_CODE (reloc_addr); } else assert (! "unexpected dynamic reloc type"); @@ -295,7 +302,28 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, #define elf_machine_pltrel_p(type) ((type) == R_PPC_JMP_SLOT) /* Set up the loaded object described by L so its unrelocated PLT - entries will jump to the on-demand fixup code in dl-runtime.c. */ + entries will jump to the on-demand fixup code in dl-runtime.c. + Also install a small trampoline to be used by entries that have + been relocated to an address too far away for a single branch. */ + +/* A PLT entry does one of three things: + (i) Jumps to the actual routine. Such entries are set up above, in + elf_machine_rela. + + (ii) Jumps to the actual routine via glue at the start of the PLT. + We do this by putting the address of the routine in space + allocated at the end of the PLT, and when the PLT entry is + called we load the offset of that word (from the start of the + space) into r11, then call the glue, which loads the word and + branches to that address. These entries are set up in + elf_machine_rela, but the glue is set up here. + + (iii) Loads the index of this PLT entry (we count the double-size + entries as one entry for this purpose) into r11, then + branches to code at the start of the PLT. This code then + calls `fixup', in dl-runtime.c, via the glue in the macro + ELF_MACHINE_RUNTIME_TRAMPOLINE, which resets the PLT entry to + be one of the above two types. These entries are set up here. */ static inline void elf_machine_runtime_setup (struct link_map *map, int lazy) { @@ -316,54 +344,78 @@ elf_machine_runtime_setup (struct link_map *map, int lazy) if (lazy) for (i = 0; i < num_plt_entries; i++) { - Elf32_Word offset = PLT_ENTRY_START_WORDS(i); + Elf32_Word offset = PLT_ENTRY_START_WORDS (i); if (i >= PLT_DOUBLE_SIZE) { - plt[offset ] = OPCODE_LI (11, i * 4); - plt[offset+1] = OPCODE_ADDIS (11, 11, i * 4 + 0x8000 >> 16); + plt[offset ] = OPCODE_LI (11, i * 4); + plt[offset+1] = OPCODE_ADDIS (11, 11, (i * 4 + 0x8000) >> 16); plt[offset+2] = OPCODE_B (-(4 * (offset + 2))); } else { - plt[offset ] = OPCODE_LI (11, i * 4); - plt[offset+1] = OPCODE_B(-(4 * (offset + 1))); + plt[offset ] = OPCODE_LI (11, i * 4); + plt[offset+1] = OPCODE_B (-(4 * (offset + 1))); } + } - /* Multiply index of entry, by 0xC. */ - plt[0] = OPCODE_SLWI (12, 11, 1); - plt[1] = OPCODE_ADD (11, 12, 11); - if ((Elf32_Word) (char *) _dl_runtime_resolve <= 0x01fffffc - || (Elf32_Word) (char *) _dl_runtime_resolve >= 0xfe000000) - { - plt[2] = OPCODE_LI (12, (Elf32_Word) (char *) map); - plt[3] = OPCODE_ADDIS (12, 12, - (Elf32_Word) (char *) map + 0x8000 >> 16); - plt[4] = OPCODE_BA ((Elf32_Word) (char *) _dl_runtime_resolve); - } + /* Multiply index of entry by 3 (in r11). */ + plt[0] = OPCODE_SLWI (12, 11, 1); + plt[1] = OPCODE_ADD (11, 12, 11); + if ((Elf32_Word) (char *) _dl_runtime_resolve <= 0x01fffffc || + (Elf32_Word) (char *) _dl_runtime_resolve >= 0xfe000000) + { + /* Load address of link map in r12. */ + plt[2] = OPCODE_LI (12, (Elf32_Word) (char *) map); + plt[3] = OPCODE_ADDIS (12, 12, (((Elf32_Word) (char *) map + + 0x8000) >> 16)); + + /* Call _dl_runtime_resolve. */ + plt[4] = OPCODE_BA ((Elf32_Word) (char *) _dl_runtime_resolve); } else { + /* Get address of _dl_runtime_resolve in CTR. */ plt[2] = OPCODE_LI (12, (Elf32_Word) (char *) _dl_runtime_resolve); - plt[3] = OPCODE_ADDIS(12, 12, 0x8000 + - ((Elf32_Word) (char *) _dl_runtime_resolve - >> 16)); + plt[3] = OPCODE_ADDIS (12, 12, ((((Elf32_Word) (char *) + _dl_runtime_resolve) + + 0x8000) >> 16)); plt[4] = OPCODE_MTCTR (12); + + /* Load address of link map in r12. */ plt[5] = OPCODE_LI (12, (Elf32_Word) (char *) map); - plt[6] = OPCODE_ADDIS (12, 12, ((Elf32_Word) (char *) map - + 0x8000 >> 16)); + plt[6] = OPCODE_ADDIS (12, 12, (((Elf32_Word) (char *) map + + 0x8000) >> 16)); + + /* Call _dl_runtime_resolve. */ plt[7] = OPCODE_BCTR (); } + + + /* Convert the index in r11 into an actual address, and get the + word at that address. */ plt[PLT_LONGBRANCH_ENTRY_WORDS] = - OPCODE_ADDIS (11, 11, (Elf32_Word) (char*) (plt + rel_offset_words) - + 0x8000 >> 16); + OPCODE_ADDIS (11, 11, (((Elf32_Word) (char*) (plt + rel_offset_words) + + 0x8000) >> 16)); plt[PLT_LONGBRANCH_ENTRY_WORDS+1] = - OPCODE_LWZ(11,(Elf32_Word)(char*)(plt+rel_offset_words),11); + OPCODE_LWZ (11, (Elf32_Word) (char*) (plt+rel_offset_words), 11); + + /* Call the procedure at that address. */ plt[PLT_LONGBRANCH_ENTRY_WORDS+2] = OPCODE_MTCTR (11); plt[PLT_LONGBRANCH_ENTRY_WORDS+3] = OPCODE_BCTR (); + + /* Now, we've modified code (quite a lot of code, possibly). We + need to write the changes from the data cache to a + second-level unified cache, then make sure that stale data in + the instruction cache is removed. (In a multiprocessor + system, the effect is more complex.) + + Assumes the cache line size is at least 32 bytes, or at least + that dcbst and icbi apply to 32-byte lines. At present, all + PowerPC processors have line sizes of exactly 32 bytes. */ + size_modified = lazy ? rel_offset_words : PLT_INITIAL_ENTRY_WORDS; - /* Now we need to keep the caches in sync. */ for (i = 0; i < size_modified; i+=8) PPC_DCBST (plt + i); PPC_SYNC; @@ -411,7 +463,7 @@ _dl_runtime_resolve: # The code that calls this has put parameters for `fixup' in r12 and r11. mr 3,12 mr 4,11 - bl fixup + bl fixup@local # 'fixup' returns the address we want to branch to. mtctr 3 # Put the registers back... @@ -440,8 +492,9 @@ _dl_runtime_resolve: The C function `_dl_start' is the real entry point; its return value is the user program's entry point. */ #define RTLD_START \ +static ElfW(Addr) _dl_start (void *arg) __attribute__((unused)); \ asm ("\ - .text + .section \".text\" .align 2 .globl _start .type _start,@function @@ -535,16 +588,34 @@ _start: .previous "); +/* The idea here is that to conform to the ABI, we are supposed to try + to load dynamic objects between 0x10000 (we actually use 0x40000 as + the lower bound, to increase the chance of a memory reference from + a null pointer giving a segfault) and the program's load address. + Regrettably, in this code we can't find the program's load address, + so we punt and choose 0x01800000, which is below the ABI's + recommended default, and what GNU ld currently chooses. We only use + the address as a preference for mmap, so if we get it wrong the + worst that happens is that it gets mapped somewhere else. + + FIXME: Unfortunately, 'somewhere else' is probably right after the + program's break, which causes malloc to fail. We really need more + information here about the way memory is mapped. */ + #define ELF_PREFERRED_ADDRESS_DATA \ -static ElfW(Addr) _dl_preferred_address = 0; +static ElfW(Addr) _dl_preferred_address = 1; #define ELF_PREFERRED_ADDRESS(loader, maplength, mapstartpref) \ ( { \ ElfW(Addr) prefd; \ - if (mapstartpref != 0 && _dl_preferred_address == 0) \ + if (mapstartpref != 0 && _dl_preferred_address == 1) \ _dl_preferred_address = mapstartpref; \ if (mapstartpref != 0) \ prefd = mapstartpref; \ + else if (_dl_preferred_address == 1) \ + prefd = _dl_preferred_address = \ + (0x01800000 - maplength - 0x10000) & \ + ~(_dl_pagesize - 1); \ else if (_dl_preferred_address < maplength + 0x50000) \ prefd = 0; \ else \ @@ -556,7 +627,7 @@ static ElfW(Addr) _dl_preferred_address = 0; #define ELF_FIXED_ADDRESS(loader, mapstart) \ ( { \ - if (mapstart != 0 && _dl_preferred_address < mapstart) \ + if (mapstart != 0 && _dl_preferred_address == 1) \ _dl_preferred_address = mapstart; \ } ) diff --git a/sysdeps/powerpc/elf/start.c b/sysdeps/powerpc/elf/start.c index 001d6aa97c..d32aeee6c7 100644 --- a/sysdeps/powerpc/elf/start.c +++ b/sysdeps/powerpc/elf/start.c @@ -29,6 +29,7 @@ asm ("\ .section \".text\" .align 2 .globl _start + .type _start,@function _start: # save the stack pointer, in case we're statically linked under Linux mr 8,1 diff --git a/sysdeps/stub/s_exp2.c b/sysdeps/stub/s_exp2.c new file mode 100644 index 0000000000..a3d0906a33 --- /dev/null +++ b/sysdeps/stub/s_exp2.c @@ -0,0 +1,12 @@ +#include <math.h> +#include <stdio.h> + +double +__exp2 (double x) +{ + fputs ("__exp2 not implemented\n", stderr); + return 0.0; +} +weak_alias (__exp2, exp2) + +stub_warning (exp2) diff --git a/sysdeps/stub/s_exp2f.c b/sysdeps/stub/s_exp2f.c new file mode 100644 index 0000000000..5d6540e074 --- /dev/null +++ b/sysdeps/stub/s_exp2f.c @@ -0,0 +1,12 @@ +#include <math.h> +#include <stdio.h> + +float +__exp2f (float x) +{ + fputs ("__exp2f not implemented\n", stderr); + return 0.0; +} +weak_alias (__exp2f, exp2f) + +stub_warning (exp2) diff --git a/sysdeps/stub/s_exp2l.c b/sysdeps/stub/s_exp2l.c new file mode 100644 index 0000000000..4c52fc904d --- /dev/null +++ b/sysdeps/stub/s_exp2l.c @@ -0,0 +1,12 @@ +#include <math.h> +#include <stdio.h> + +long double +__exp2l (long double x) +{ + fputs ("__exp2l not implemented\n", stderr); + return 0.0; +} +weak_alias (__exp2l, exp2l) + +stub_warning (exp2l) diff --git a/sysdeps/stub/s_log2l.c b/sysdeps/stub/s_log2l.c index cfa1a7d016..d8d86af995 100644 --- a/sysdeps/stub/s_log2l.c +++ b/sysdeps/stub/s_log2l.c @@ -7,5 +7,6 @@ __log2l (long double x) fputs ("__log2l not implemented\n", stderr); return 0.0; } +weak_alias (__log2l, log2l) -stub_warning (__log2l) +stub_warning (log2l) diff --git a/sysdeps/unix/sysv/linux/netatalk/atalk.h b/sysdeps/unix/sysv/linux/netatalk/at.h index be3a72d48f..be3a72d48f 100644 --- a/sysdeps/unix/sysv/linux/netatalk/atalk.h +++ b/sysdeps/unix/sysv/linux/netatalk/at.h diff --git a/sysdeps/unix/sysv/linux/netinet/ip_icmp.h b/sysdeps/unix/sysv/linux/netinet/ip_icmp.h index cb50193b37..be7959ee7f 100644 --- a/sysdeps/unix/sysv/linux/netinet/ip_icmp.h +++ b/sysdeps/unix/sysv/linux/netinet/ip_icmp.h @@ -24,6 +24,74 @@ __BEGIN_DECLS +struct icmphdr +{ + u_int8_t type; /* message type */ + u_int8_t code; /* type sub-code */ + u_int16_t checksum; + union + { + struct + { + u_int16_t id; + u_int16_t sequence; + } echo; /* echo datagram */ + u_int32_t gateway; /* gateway address */ + struct + { + u_int16_t __unused; + u_int16_t mtu; + } frag; /* path mtu discovery */ + } un; +}; + +#define ICMP_ECHOREPLY 0 /* Echo Reply */ +#define ICMP_DEST_UNREACH 3 /* Destination Unreachable */ +#define ICMP_SOURCE_QUENCH 4 /* Source Quench */ +#define ICMP_REDIRECT 5 /* Redirect (change route) */ +#define ICMP_ECHO 8 /* Echo Request */ +#define ICMP_TIME_EXCEEDED 11 /* Time Exceeded */ +#define ICMP_PARAMETERPROB 12 /* Parameter Problem */ +#define ICMP_TIMESTAMP 13 /* Timestamp Request */ +#define ICMP_TIMESTAMPREPLY 14 /* Timestamp Reply */ +#define ICMP_INFO_REQUEST 15 /* Information Request */ +#define ICMP_INFO_REPLY 16 /* Information Reply */ +#define ICMP_ADDRESS 17 /* Address Mask Request */ +#define ICMP_ADDRESSREPLY 18 /* Address Mask Reply */ +#define NR_ICMP_TYPES 18 + + +/* Codes for UNREACH. */ +#define ICMP_NET_UNREACH 0 /* Network Unreachable */ +#define ICMP_HOST_UNREACH 1 /* Host Unreachable */ +#define ICMP_PROT_UNREACH 2 /* Protocol Unreachable */ +#define ICMP_PORT_UNREACH 3 /* Port Unreachable */ +#define ICMP_FRAG_NEEDED 4 /* Fragmentation Needed/DF set */ +#define ICMP_SR_FAILED 5 /* Source Route failed */ +#define ICMP_NET_UNKNOWN 6 +#define ICMP_HOST_UNKNOWN 7 +#define ICMP_HOST_ISOLATED 8 +#define ICMP_NET_ANO 9 +#define ICMP_HOST_ANO 10 +#define ICMP_NET_UNR_TOS 11 +#define ICMP_HOST_UNR_TOS 12 +#define ICMP_PKT_FILTERED 13 /* Packet filtered */ +#define ICMP_PREC_VIOLATION 14 /* Precedence violation */ +#define ICMP_PREC_CUTOFF 15 /* Precedence cut off */ +#define NR_ICMP_UNREACH 15 /* instead of hardcoding immediate value */ + +/* Codes for REDIRECT. */ +#define ICMP_REDIR_NET 0 /* Redirect Net */ +#define ICMP_REDIR_HOST 1 /* Redirect Host */ +#define ICMP_REDIR_NETTOS 2 /* Redirect Net for TOS */ +#define ICMP_REDIR_HOSTTOS 3 /* Redirect Host for TOS */ + +/* Codes for TIME_EXCEEDED. */ +#define ICMP_EXC_TTL 0 /* TTL count exceeded */ +#define ICMP_EXC_FRAGTIME 1 /* Fragment Reass time exceeded */ + + +#ifdef __USE_BSD /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. @@ -65,31 +133,37 @@ __BEGIN_DECLS /* * Internal of an ICMP Router Advertisement */ -struct icmp_ra_addr { - u_int32_t ira_addr; - u_int32_t ira_preference; +struct icmp_ra_addr +{ + u_int32_t ira_addr; + u_int32_t ira_preference; }; -struct icmp { +struct icmp +{ u_int8_t icmp_type; /* type of message, see below */ u_int8_t icmp_code; /* type sub code */ u_int16_t icmp_cksum; /* ones complement checksum of struct */ - union { + union + { u_char ih_pptr; /* ICMP_PARAMPROB */ struct in_addr ih_gwaddr; /* gateway address */ - struct ih_idseq { /* echo datagram */ + struct ih_idseq /* echo datagram */ + { u_int16_t icd_id; u_int16_t icd_seq; } ih_idseq; u_int32_t ih_void; /* ICMP_UNREACH_NEEDFRAG -- Path MTU Discovery (RFC1191) */ - struct ih_pmtu { + struct ih_pmtu + { u_int16_t ipm_void; u_int16_t ipm_nextmtu; } ih_pmtu; - struct ih_rtradv { + struct ih_rtradv + { u_int8_t irt_num_addrs; u_int8_t irt_wpa; u_int16_t irt_lifetime; @@ -105,13 +179,16 @@ struct icmp { #define icmp_num_addrs icmp_hun.ih_rtradv.irt_num_addrs #define icmp_wpa icmp_hun.ih_rtradv.irt_wpa #define icmp_lifetime icmp_hun.ih_rtradv.irt_lifetime - union { - struct { + union + { + struct + { u_int32_t its_otime; u_int32_t its_rtime; u_int32_t its_ttime; } id_ts; - struct { + struct + { struct ip idi_ip; /* options and then 64 bits of data */ } id_ip; @@ -149,11 +226,9 @@ struct icmp { #endif /* Definition of type and code fields. */ -#define ICMP_ECHOREPLY 0 /* echo reply */ +/* defined above: ICMP_ECHOREPLY, ICMP_REDIRECT, ICMP_ECHO */ #define ICMP_UNREACH 3 /* dest unreachable, codes: */ #define ICMP_SOURCEQUENCH 4 /* packet lost, slow down */ -#define ICMP_REDIRECT 5 /* shorter route, codes: */ -#define ICMP_ECHO 8 /* echo service */ #define ICMP_ROUTERADVERT 9 /* router advertisement */ #define ICMP_ROUTERSOLICIT 10 /* router solicitation */ #define ICMP_TIMXCEED 11 /* time exceeded, code: */ @@ -205,6 +280,8 @@ struct icmp { (type) == ICMP_IREQ || (type) == ICMP_IREQREPLY || \ (type) == ICMP_MASKREQ || (type) == ICMP_MASKREPLY) +#endif /* __USE_BSD */ + __END_DECLS #endif /* netinet/ip_icmp.h */ diff --git a/sysdeps/unix/sysv/linux/powerpc/Dist b/sysdeps/unix/sysv/linux/powerpc/Dist index 3df65c325c..c8c265c474 100644 --- a/sysdeps/unix/sysv/linux/powerpc/Dist +++ b/sysdeps/unix/sysv/linux/powerpc/Dist @@ -2,3 +2,6 @@ clone.S ioctl-types.h termbits.h termios.h +kernel_stat.h +kernel_termios.h +sys/kernel_termios.h diff --git a/sysdeps/unix/sysv/linux/powerpc/clone.S b/sysdeps/unix/sysv/linux/powerpc/clone.S index 0afd0717f4..d255abfe0f 100644 --- a/sysdeps/unix/sysv/linux/powerpc/clone.S +++ b/sysdeps/unix/sysv/linux/powerpc/clone.S @@ -27,22 +27,30 @@ /* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */ -ENTRY(clone) +ENTRY(__clone) /* Set up stack frame, save registers. */ - stwu 1,-20(1) + stwu 1,-32(1) stw 31,16(1) + stw 30,20(1) - /* Check for child_stack == NULL, fn == NULL. */ - mr. 31,4 + /* Check for child_stack == NULL || fn == NULL. */ + cmpwi 0,4,0 cmpwi 1,3,0 cror 2+0*4,2+0*4,2+1*4 beq- 0,badargs - /* Save 'fn' and its argument on the new stack. */ - stw 3,0(4) - stw 6,4(4) + /* Set up stack frame for child. */ + addi 4,4,-16 + clrrwi 4,4,4 + li 0,0 + stw 0,0(4) - /* 'flags' argument is (only) parameter to clone syscall. */ + /* Save new stack, fn, args across syscall. */ + mr 30,3 /* Function in r30. */ + mr 31,6 /* Arguments in r31. */ + + /* 'flags' argument is first parameter to clone syscall. (The other + argument is the stack pointer, already in r4.) */ mr 3,5 /* Do the call. */ @@ -51,22 +59,22 @@ ENTRY(clone) beq child /* Parent. Restore registers & return. */ - lwz 31,20(1) - addi 1,1,20 + lwz 31,16(1) + lwz 30,20(1) + addi 1,1,32 blr child: - /* Get address of procedure to call. */ - lwz 0,0(31) - /* Set up argument register. */ - lwz 3,4(31) - mtlr 0 - /* Switch to new stack. */ - mr 1,31 /* Call procedure. */ + mtlr 30 + mr 3,31 blrl /* Call _exit with result from procedure. */ - DO_CALL (SYS_ify (exit)) +#ifdef PIC + b _exit@plt +#else + b _exit +#endif badargs: li 3,-EINVAL @@ -76,3 +84,7 @@ error: #else b __syscall_error #endif + +PSEUDO_END (__clone) + +weak_alias (__clone, clone) diff --git a/sysdeps/powerpc/strlen.S b/sysdeps/unix/sysv/linux/powerpc/kernel_stat.h index 95eaf94de1..c07e182748 100644 --- a/sysdeps/powerpc/strlen.S +++ b/sysdeps/unix/sysv/linux/powerpc/kernel_stat.h @@ -1,4 +1,4 @@ -/* Optimized strlen implementation for PowerPC. +/* Definition of `struct stat' used in the kernel. Copyright (C) 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -17,36 +17,29 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - .section ".text" - .align 2 - .globl strlen - .type strlen,@function -strlen: - rlwinm 7,3,0,0,29 - lis 8,0x7f7f - lwz 11,0(7) - ori 8,8,32639 - rlwinm 4,3,3,27,28 - li 9,-1 - or 10,11,8 - and 0,11,8 - srw 9,9,4 - add 0,0,8 - nor 0,10,0 - and. 11,0,9 - bc 4,2,.L2 -.L3: - lwzu 11,4(7) - or 10,11,8 - and 0,11,8 - add 0,0,8 - nor. 11,10,0 - bc 12,2,.L3 -.L2: - subf 0,3,7 - cntlzw 3,11 - srwi 3,3,3 - add 3,0,3 - blr -.Lfe1: - .size strlen,.Lfe1-strlen +struct kernel_stat + { + unsigned int st_dev; + unsigned int st_ino; + unsigned int st_mode; + unsigned short st_nlink; + unsigned int st_uid; + unsigned int st_gid; + unsigned int st_rdev; + unsigned long int st_size; + unsigned long int st_blksize; + unsigned long int st_blocks; + unsigned long int st_atime; + unsigned long int __unused1; +#define _HAVE___UNUSED1 + unsigned long int st_mtime; + unsigned long int __unused2; +#define _HAVE___UNUSED2 + unsigned long int st_ctime; + unsigned long int __unused3; +#define _HAVE___UNUSED3 + unsigned long int __unused4; +#define _HAVE___UNUSED4 + unsigned long int __unused5; +#define _HAVE___UNUSED5 + }; diff --git a/sysdeps/unix/sysv/linux/powerpc/statbuf.h b/sysdeps/unix/sysv/linux/powerpc/statbuf.h deleted file mode 100644 index 5be5736931..0000000000 --- a/sysdeps/unix/sysv/linux/powerpc/statbuf.h +++ /dev/null @@ -1,79 +0,0 @@ -/* Copyright (C) 1992, 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 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. */ - -#ifndef _STATBUF_H -#define _STATBUF_H 1 - -/* Versions of the `struct stat' data structure. */ -#define _STAT_VER_LINUX 1 -#define _STAT_VER_SVR4 2 -#define _STAT_VER _STAT_VER_LINUX /* The one defined below. */ - -/* Versions of the `xmknod' interface. */ -#define _MKNOD_VER_LINUX 1 -#define _MKNOD_VER_SVR4 2 -#define _MKNOD_VER _MKNOD_VER_LINUX /* The bits defined below. */ - - -struct stat - { - unsigned int st_dev; /* Device. */ - unsigned int st_ino; /* File serial number. */ - unsigned int st_mode; /* File mode. */ - unsigned short int st_nlink; /* Link count. */ - unsigned int st_uid; /* User ID of the file's owner. */ - unsigned int st_gid; /* Group ID of the file's group.*/ - unsigned int st_rdev; /* Device number, if device. */ - long int st_size; /* Size of file, in bytes. */ - unsigned long int st_blksize; /* Optimal block size for I/O. */ -#define _STATBUF_ST_BLKSIZE /* Tell code we have this member. */ - - unsigned long int st_blocks; /* Number of 512-byte blocks allocated. */ - unsigned long int st_atime; /* Time of last access. */ - unsigned long int __unused1; - unsigned long int st_mtime; /* Time of last modification. */ - unsigned long int __unused2; - unsigned long int st_ctime; /* Time of last status change. */ - unsigned long int __unused3; - unsigned long int __unused4; - unsigned long int __unused5; - }; - -/* Encoding of the file mode. */ - -#define __S_IFMT 0170000 /* These bits determine file type. */ - -/* File types. */ -#define __S_IFDIR 0040000 /* Directory. */ -#define __S_IFCHR 0020000 /* Character device. */ -#define __S_IFBLK 0060000 /* Block device. */ -#define __S_IFREG 0100000 /* Regular file. */ -#define __S_IFIFO 0010000 /* FIFO. */ -#define __S_IFLNK 0120000 /* Symbolic link. */ -#define __S_IFSOCK 0140000 /* Socket. */ - -/* Protection bits. */ - -#define __S_ISUID 04000 /* Set user ID on execution. */ -#define __S_ISGID 02000 /* Set group ID on execution. */ -#define __S_ISVTX 01000 /* Save swapped text after use (sticky). */ -#define __S_IREAD 0400 /* Read by owner. */ -#define __S_IWRITE 0200 /* Write by owner. */ -#define __S_IEXEC 0100 /* Execute by owner. */ - -#endif /* statbuf.h */ diff --git a/sysdeps/unix/sysv/linux/powerpc/sys/kernel_termios.h b/sysdeps/unix/sysv/linux/powerpc/sys/kernel_termios.h new file mode 100644 index 0000000000..c5e9e2684a --- /dev/null +++ b/sysdeps/unix/sysv/linux/powerpc/sys/kernel_termios.h @@ -0,0 +1,43 @@ +/* Copyright (C) 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 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. */ + +#ifndef _SYS_KERNEL_TERMIOS_H +#define _SYS_KERNEL_TERMIOS_H 1 +/* The following corresponds to the values from the Linux 2.0.28 kernel. */ + +/* We need the definition of tcflag_t, cc_t, and speed_t. */ +#include <termbits.h> + +#define __KERNEL_NCCS 19 + +struct __kernel_termios + { + tcflag_t c_iflag; /* input mode flags */ + tcflag_t c_oflag; /* output mode flags */ + tcflag_t c_cflag; /* control mode flags */ + tcflag_t c_lflag; /* local mode flags */ + cc_t c_cc[__KERNEL_NCCS]; /* control characters */ + cc_t c_line; /* line discipline */ + int c_ispeed; /* input speed */ + int c_ospeed; /* output speed */ + }; + +#define _HAVE_C_ISPEED 1 +#define _HAVE_C_OSPEED 1 + +#endif /* sys/kernel_termios.h */ diff --git a/sysdeps/unix/sysv/linux/powerpc/sysdep.h b/sysdeps/unix/sysv/linux/powerpc/sysdep.h index d6d33bf7af..6cad9ae087 100644 --- a/sysdeps/unix/sysv/linux/powerpc/sysdep.h +++ b/sysdeps/unix/sysv/linux/powerpc/sysdep.h @@ -43,7 +43,7 @@ #ifdef PIC #define PSEUDO(name, syscall_name, args) \ - .text; \ + .section ".text"; \ ENTRY (name) \ DO_CALL (SYS_ify (syscall_name)); \ bnslr; \ @@ -56,6 +56,7 @@ bnslr; \ b __syscall_error #endif + #define ret /* Nothing (should be 'blr', but never reached). */ #endif /* ASSEMBLER */ diff --git a/time/africa b/time/africa index 49f39fbfab..1ac3835056 100644 --- a/time/africa +++ b/time/africa @@ -1,4 +1,4 @@ -# @(#)africa 7.16 +# @(#)africa 7.17 # This data is by no means authoritative; if you think you know better, # go ahead and edit the file (and please send any changes to @@ -403,8 +403,10 @@ Rule Libya 1986 only - Oct 3 0:00 0 - Rule Libya 1987 1989 - Apr 1 0:00 1:00 S Rule Libya 1987 1990 - Oct 1 0:00 0 - Rule Libya 1990 only - May 4 0:00 1:00 S -Rule Libya 1996 max - Mar 30 2:00s 1:00 S -Rule Libya 1996 max - Sep 30 2:00s 0 - +Rule Libya 1996 only - Mar 30 2:00s 1:00 S +Rule Libya 1996 only - Sep 30 2:00s 0 - +Rule Libya 1997 max - Mar lastThu 2:00s 1:00 S +Rule Libya 1997 max - Oct Thu>=1 2:00s 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Tripoli 0:52:44 - LMT 1920 1:00 Libya CE%sT 1959 @@ -525,9 +527,10 @@ Zone Atlantic/St_Helena -0:22:48 - LMT 1890 # Jamestown -0:06 - SHT 1951 # St Helena Time (?) 0:00 - GMT # The other parts of the St Helena territory are similar: -# Tristan da Cunha: on GMT, says Whitman -# Ascension: on GMT, says usno1995 -# Gough, Inaccessible, Nightingale: no information, but probably GMT +# Tristan da Cunha: on GMT, say Whitman and the CIA +# Ascension: on GMT, says usno1995 and the CIA +# Gough (scientific station since 1955): on GMT, says the CIA +# Inaccessible, Nightingale: no information, but probably GMT # Sao Tome and Principe # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -577,7 +580,8 @@ Rule SA 1943 1944 - Mar Sun>=15 2:00 0 - Zone Africa/Johannesburg 1:52:00 - LMT 1892 Feb 8 1:30 - SAT 1903 Mar 2:00 SA SA%sT -# Prince Edward Is +# Marion and Prince Edward Is +# weather station since 1947 # no information # Sudan diff --git a/time/antarctica b/time/antarctica index c06231e454..83f0cfed76 100644 --- a/time/antarctica +++ b/time/antarctica @@ -1,8 +1,9 @@ -# @(#)antarctica 7.7 +# @(#)antarctica 7.8 -# From Paul Eggert (1997-01-20): +# From Paul Eggert (1997-03-28): # To keep things manageable, we list only locations occupied year-round; -# see <URL:http://earth.agu.org/amen/nations.html> (1996-05-24). +# see <URL:http://earth.agu.org/amen/nations.html> (1996-05-24) +# and <URL:http://www.spri.cam.ac.uk/bob/periant.htm> (1996-09-05). # Unless otherwise specified, we have no time zone information. # # Except for the French entries, @@ -29,7 +30,7 @@ Rule ChileAQ 1970 max - Mar Sun>=9 0:00 0 - # 5 others # Australia - territories -# Heard Island, McDonald Islands +# Heard Island, McDonald Islands (uninhabited) # # year-round bases # Casey, Bailey Peninsula, since 1969 @@ -70,9 +71,10 @@ Zone Antarctica/Mawson 0 - ___ 1954 Feb 13 # # Martin-de-Vivies Base, Amsterdam Island, -374105+0773155, since 1950 # Alfred-Faure Base, Crozet Islands, -462551+0515152, since 1964 -# Port-aux-Francais, Kerguelen Islands, -492110+0701303, since 1951 +# Port-aux-Francais, Kerguelen Islands, -492110+0701303, since 1951; +# a whaling and sealing station operated 1908-14, 1920-29, and 1951-56 # -# St Paul Island - near Amsterdam, uninhabited since 1927 +# St Paul Island - near Amsterdam, uninhabited since 1931 # # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Indian/Kerguelen 0 - ___ 1950 # Port-aux-Francais @@ -107,8 +109,8 @@ Zone Antarctica/DumontDUrville 0 - ___ 1947 # King Sejong, King George Island, since 1988 # New Zealand - claims -# Balleny Islands -# Scott Island +# Balleny Islands (never inhabited) +# Scott Island (never inhabited) # # year-round base # Scott, Ross Island, since 1957-01, is like Antarctica/McMurdo. @@ -124,10 +126,10 @@ Rule NZAQ 1976 1989 - Mar Sun>=1 2:00s 0 S Rule NZAQ 1990 max - Mar Sun>=15 2:00s 0 S # Norway - territories -# Bouvet (uninhabited) +# Bouvet (never inhabited) # # claims -# Peter I Island (uninhabited) +# Peter I Island (never inhabited) # Poland - year-round base # Arctowski, King George Island, since 1977 @@ -147,7 +149,11 @@ Rule NZAQ 1990 max - Mar Sun>=15 2:00s 0 S # # British Antarctic Territories (BAT) claims # South Orkney Islands +# scientific station from 1903 +# whaling station at Signy I 1920-1926 # South Shetland Islands +# whaling station at Deception I 1912-1931 +# scientific station from 1943 # # year-round bases # Halley, Coates Land, -7535-2619, since 1956-01-06 diff --git a/time/asia b/time/asia index 0a3c4fed00..829d40b9a8 100644 --- a/time/asia +++ b/time/asia @@ -1,4 +1,4 @@ -# @(#)asia 7.28 +# @(#)asia 7.29 # This data is by no means authoritative; if you think you know better, # go ahead and edit the file (and please send any changes to @@ -508,8 +508,6 @@ Rule Zion 1988 only - Sep 3 0:00 0 S # From Ephraim Silverberg (ephraim@cs.huji.ac.il), 1997-03-04: -# Zone Information Compiler (ZIC) File for the State of Israel (1989-2009) - # According to the Office of the Secretary General of the Ministry of # Interior, there is NO set rule for Daylight-Savings/Standard time changes. # Each year they decide anew what havoc to wreak on the country. However, @@ -525,27 +523,27 @@ Rule Zion 1988 only - Sep 3 0:00 0 S # change back to standard time took place on Sunday night instead of Saturday # night to avoid conflicts with the Jewish New Year. -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Zion 1989 only - Apr 30 0:00 1:00 D -Rule Zion 1989 only - Sep 3 0:00 0:00 S -Rule Zion 1990 only - Mar 25 0:00 1:00 D -Rule Zion 1990 only - Aug 26 0:00 0:00 S -Rule Zion 1991 only - Mar 24 0:00 1:00 D -Rule Zion 1991 only - Sep 1 0:00 0:00 S -Rule Zion 1992 only - Mar 29 0:00 1:00 D -Rule Zion 1992 only - Sep 6 0:00 0:00 S -Rule Zion 1993 only - Apr 2 0:00 1:00 D -Rule Zion 1993 only - Sep 5 0:00 0:00 S +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Zion 1989 only - Apr 30 0:00 1:00 D +Rule Zion 1989 only - Sep 3 0:00 0 S +Rule Zion 1990 only - Mar 25 0:00 1:00 D +Rule Zion 1990 only - Aug 26 0:00 0 S +Rule Zion 1991 only - Mar 24 0:00 1:00 D +Rule Zion 1991 only - Sep 1 0:00 0 S +Rule Zion 1992 only - Mar 29 0:00 1:00 D +Rule Zion 1992 only - Sep 6 0:00 0 S +Rule Zion 1993 only - Apr 2 0:00 1:00 D +Rule Zion 1993 only - Sep 5 0:00 0 S # The dates for 1994-1995 were obtained from Office of the Spokeswoman for the # Ministry of Interior, Jerusalem, Israel. The spokeswoman can be reached by # calling the office directly at 972-2-6701447 or 972-2-6701448. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Zion 1994 only - Apr 1 0:00 1:00 D -Rule Zion 1994 only - Aug 28 0:00 0:00 S -Rule Zion 1995 only - Mar 31 0:00 1:00 D -Rule Zion 1995 only - Sep 3 0:00 0:00 S +Rule Zion 1994 only - Apr 1 0:00 1:00 D +Rule Zion 1994 only - Aug 28 0:00 0 S +Rule Zion 1995 only - Mar 31 0:00 1:00 D +Rule Zion 1995 only - Sep 3 0:00 0 S # The dates for 1996 were determined by the Minister of Interior of the # time, Haim Ramon. The official announcement regarding 1996-1998 @@ -560,40 +558,20 @@ Rule Zion 1995 only - Sep 3 0:00 0:00 S # # ftp://ftp.huji.ac.il/pub/tz/announcements/1997.ps.gz +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Zion 1996 only - Mar 15 0:00 1:00 D +Rule Zion 1996 only - Sep 16 0:00 0 S +Rule Zion 1997 only - Mar 21 0:00 1:00 D +Rule Zion 1997 only - Sep 14 0:00 0 S +Rule Zion 1998 only - Mar 20 0:00 1:00 D +Rule Zion 1998 only - Oct 18 0:00 0 S + +# From Paul Eggert (1997-03-15): +# Here are guesses for rules after 1998. +# They are probably wrong, but they are more likely than no DST at all. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Zion 1996 only - Mar 15 0:00 1:00 D -Rule Zion 1996 only - Sep 16 0:00 0:00 S -Rule Zion 1997 only - Mar 21 0:00 1:00 D -Rule Zion 1997 only - Sep 14 0:00 0:00 S -Rule Zion 1998 only - Mar 20 0:00 1:00 D -Rule Zion 1998 only - Oct 18 0:00 0:00 S - -# These rules are probably wrong, but they are close approximations (usually -# within a few weeks): - -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Zion 1999 only - Apr 11 0:00 1:00 D -Rule Zion 1999 only - Sep 5 0:00 0:00 S -Rule Zion 2000 only - Apr 30 0:00 1:00 D -Rule Zion 2000 only - Sep 24 0:00 0:00 S -Rule Zion 2001 only - Apr 15 0:00 1:00 D -Rule Zion 2001 only - Sep 9 0:00 0:00 S -Rule Zion 2002 only - Apr 7 0:00 1:00 D -Rule Zion 2002 only - Sep 1 0:00 0:00 S -Rule Zion 2003 only - Apr 27 0:00 1:00 D -Rule Zion 2003 only - Sep 21 0:00 0:00 S -Rule Zion 2004 only - Apr 18 0:00 1:00 D -Rule Zion 2004 only - Sep 12 0:00 0:00 S -Rule Zion 2005 only - May 1 0:00 1:00 D -Rule Zion 2005 only - Sep 25 0:00 0:00 S -Rule Zion 2006 only - Apr 23 0:00 1:00 D -Rule Zion 2006 only - Sep 17 0:00 0:00 S -Rule Zion 2007 only - Apr 15 0:00 1:00 D -Rule Zion 2007 only - Sep 9 0:00 0:00 S -Rule Zion 2008 only - Apr 27 0:00 1:00 D -Rule Zion 2008 only - Sep 21 0:00 0:00 S -Rule Zion 2009 only - Apr 19 0:00 1:00 D -Rule Zion 2009 only - Sep 13 0:00 0:00 S +Rule Zion 1999 max - Mar Fri>=15 0:00 1:00 D +Rule Zion 1999 max - Sep Sun>=15 0:00 0 S # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Jerusalem 2:20:56 - LMT 1880 @@ -810,7 +788,8 @@ Rule Mongol 1985 1990 - Mar lastSun 2:00 1:00 S Rule Mongol 1985 1990 - Sep lastSun 3:00 0 - Rule Mongol 1991 max - Mar lastSun 0:00 1:00 S Rule Mongol 1991 1995 - Sep lastSun 0:00 0 - -Rule Mongol 1996 max - Oct Fri>=22 0:00 0 - +Rule Mongol 1996 only - Oct Fri>=22 0:00 0 - +Rule Mongol 1997 max - Sep lastSun 0:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] #Zone Asia/Dariv 6:14:32 - LMT 1905 Aug # 6:00 - DART 1978 # Dariv Time @@ -909,6 +888,11 @@ Zone Asia/Singapore 6:55:24 - LMT 1880 # reported ``the country's standard time will be put forward by one hour at # midnight Friday (1830 GMT) `in the light of the present power crisis'.'' # Transitions before 1996 are from Shanks (1991). +# +# From Dharmasiri Senanayake, Sri Lanka Media Minister (1996-10-24), as quoted +# in <URL:news:54rka5$m5h@mtinsc01-mgt.ops.worldnet.att.net> (1996-10-26): +# With effect from 12.30 a.m. on 26th October 1996 +# Sri Lanka will be six (06) hours ahead of GMT. # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Colombo 5:19:24 - LMT 1880 @@ -917,7 +901,8 @@ Zone Asia/Colombo 5:19:24 - LMT 1880 5:30 0:30 IHST 1942 Sep 5:30 1:00 IST 1945 Oct 16 2:00 5:30 - IST 1996 May 25 0:00 - 6:30 - LKT # Sri Lanka Time + 6:30 - LKT 1996 Oct 26 0:30 + 6:00 - LKT # Syria # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S diff --git a/time/australasia b/time/australasia index aa6387997e..11b0045a98 100644 --- a/time/australasia +++ b/time/australasia @@ -1,4 +1,4 @@ -# @(#)australasia 7.32 +# @(#)australasia 7.33 # This file also includes Pacific islands. # Notes are at the end of this file @@ -170,7 +170,12 @@ Zone Indian/Christmas 7:02:52 - LMT 1895 Feb # no indigenous inhabitants; only meteorologists # no information # -# Macquarie, Manihiki, Penrhyn, Rakehanga +# Macquarie +# permanent occupation (scientific station) since 1948; +# sealing and penguin oil station operated 1888-1917 +# no information +# +# Manihiki, Penrhyn, Rakehanga # no information @@ -277,6 +282,9 @@ Zone Pacific/Nauru 11:07:40 - LMT 1921 Jan 15 # Uaobe # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule NC 1977 1978 - Dec Sun>=1 0:00 1:00 S Rule NC 1978 1979 - Feb 27 0:00 0 - +Rule NC 1996 only - Dec 1 2:00s 1:00 S +Rule NC 1997 max - Mar Sun>=1 2:00s 0 - +Rule NC 1997 max - Nov lastSun 2:00s 1:00 S # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Noumea 11:05:48 - LMT 1912 Jan 13 11:00 NC NC%sT @@ -315,8 +323,13 @@ Zone Pacific/Auckland 11:39:04 - LMT 1868 Zone Pacific/Chatham 12:45 Chatham CHA%sT -# Antipodes Is, Kermadec Is -# uninhabited except by research personnel; probably like Pacific/Auckland +# Auckland Is +# uninhabited + +# Campbell I +# minor whaling stations operated 1909-14 +# scientific station operated 1941-1995 +# was probably like Pacific/Auckland ############################################################################### diff --git a/time/europe b/time/europe index 78ad05d7f5..23f45ada8d 100644 --- a/time/europe +++ b/time/europe @@ -1,4 +1,4 @@ -# @(#)europe 7.42 +# @(#)europe 7.43 # This data is by no means authoritative; if you think you know better, # go ahead and edit the file (and please send any changes to @@ -630,10 +630,18 @@ # came into force on 16 November. It restates the dates from the EC # seventh Summer Time Directive.... # -# From Peter Ilieve <peter@aldie.co.uk> (1996-04-20): -# Proposals for the eighth directive were supposed to have been produced -# by the Commission by 1 Jan 96. They have not yet appeared (I asked just -# before Easter). +# From Peter Ilieve <peter@aldie.co.uk> (1997-03-28): +# The [European] Transport Council discussed the proposed Eighth Directive +# on 11 March and agreed [to] it, so it moves forward to the next stage, +# from a Commission proposal to a Common Position.... What this means is: +# +# - The eighth directive proposal rules have been accepted. +# These are the same as the current rules (last Sunday in March and last +# Sunday in October). The rules will run until 2001. +# +# - The French have had their request to abandon summer time turned down. +# They have been promised some sort of review in 1999 which might change +# the rules for 2000 and 2001. # From Peter Ilieve <peter@memex.co.uk> (1994-03-28): # The [GB-Eire] end date of 22 October [1995] conflicts with your current rule diff --git a/time/northamerica b/time/northamerica index 9bd959e45c..b70cb900c0 100644 --- a/time/northamerica +++ b/time/northamerica @@ -1,4 +1,4 @@ -# @(#)northamerica 7.30 +# @(#)northamerica 7.31 # also includes Central America and the Caribbean # This data is by no means authoritative; if you think you know better, @@ -1141,14 +1141,14 @@ Rule Cuba 1969 1971 - Oct lastSun 0:00 0 S Rule Cuba 1972 1974 - Oct 8 0:00 0 S Rule Cuba 1975 1977 - Oct lastSun 0:00 0 S Rule Cuba 1978 only - May 7 0:00 1:00 D -Rule Cuba 1978 1980 - Oct Sun>=8 0:00 0 S +Rule Cuba 1978 1990 - Oct Sun>=8 0:00 0 S Rule Cuba 1979 1980 - Mar Sun>=15 0:00 1:00 D Rule Cuba 1981 1985 - May Sun>=5 0:00 1:00 D -Rule Cuba 1981 1990 - Oct Sun>=8 0:00 0 S Rule Cuba 1986 1989 - Mar Sun>=14 0:00 1:00 D Rule Cuba 1990 max - Apr Sun>=1 0:00 1:00 D Rule Cuba 1991 1995 - Oct Sun>=8 0:00s 0 S -Rule Cuba 1996 max - Oct Sun>=1 0:00s 0 S +Rule Cuba 1996 only - Oct Sun>=1 0:00s 0 S +Rule Cuba 1997 max - Oct Sun>=8 0:00s 0 S # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone America/Havana -5:29:28 - LMT 1890 diff --git a/time/private.h b/time/private.h index 5502aa8c98..5a5b516d0f 100644 --- a/time/private.h +++ b/time/private.h @@ -176,13 +176,14 @@ extern int errno; ** Private function declarations. */ char * icalloc P((int nelem, int elsize)); -char * icatalloc P((char * old, const char * const new)); -char * icpyalloc P((const char * const string)); -char * imalloc P((const int n)); -void * irealloc P((void * const pointer, const int size)); -void icfree P((char * const pointer)); -void ifree P((char * const pointer)); -char * scheck P((const char * const string, const char * const format)); +char * icatalloc P((char * old, const char * new)); +char * icpyalloc P((const char * string)); +char * imalloc P((int n)); +void * irealloc P((void * pointer, int size)); +void icfree P((char * pointer)); +void ifree P((char * pointer)); +char * scheck P((const char *string, char *format)); + /* ** Finally, some convenience items. diff --git a/time/scheck.c b/time/scheck.c index 52b4ff51fd..b51f58d042 100644 --- a/time/scheck.c +++ b/time/scheck.c @@ -11,7 +11,7 @@ static char elsieid[] = "@(#)scheck.c 8.14"; char * scheck(string, format) const char * const string; -const char * const format; +char * const format; { register char * fbuf; register const char * fp; diff --git a/time/southamerica b/time/southamerica index b2b5138171..927f71638a 100644 --- a/time/southamerica +++ b/time/southamerica @@ -1,4 +1,4 @@ -# @(#)southamerica 7.16 +# @(#)southamerica 7.17 # This data is by no means authoritative; if you think you know better, # go ahead and edit the file (and please send any changes to @@ -267,10 +267,11 @@ Rule Brazil 1988 1989 - Oct Sun>=10 0:00 1:00 D Rule Brazil 1990 1991 - Feb Sun>=11 0:00 0 S Rule Brazil 1990 1992 - Oct Sun>=20 0:00 1:00 D Rule Brazil 1992 only - Feb 9 0:00 0 S -Rule Brazil 1993 max - Oct Sun>=11 0:00 1:00 D +Rule Brazil 1993 1995 - Oct Sun>=11 0:00 1:00 D Rule Brazil 1993 only - Jan 31 0:00 0 S Rule Brazil 1994 1995 - Feb Sun>=15 0:00 0 S Rule Brazil 1996 max - Feb Sun>=11 0:00 0 S +Rule Brazil 1996 max - Oct Sun>=1 0:00 1:00 D # Zone NAME GMTOFF RULES FORMAT [UNTIL] # @@ -434,9 +435,11 @@ Rule Para 1991 only - Oct 6 0:00 1:00 S Rule Para 1992 only - Mar 1 0:00 0 - Rule Para 1992 only - Oct 5 0:00 1:00 S Rule Para 1993 only - Mar 31 0:00 0 - -Rule Para 1993 max - Oct 1 0:00 1:00 S +Rule Para 1993 1995 - Oct 1 0:00 1:00 S Rule Para 1994 1995 - Feb lastSun 0:00 0 - Rule Para 1996 max - Mar 1 0:00 0 - +Rule Para 1996 only - Oct 6 0:00 1:00 S +Rule Para 1997 max - Oct 1 0:00 1:00 S # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone America/Asuncion -3:50:40 - LMT 1890 -3:50:40 - AMT 1931 Oct 10 # Asuncion Mean Time |