diff options
author | ed <ed@FreeBSD.org> | 2009-06-23 09:04:59 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2009-06-23 09:04:59 +0000 |
commit | 29cef807d272d7d6066b8dcd7b17f2b5a0206c1d (patch) | |
tree | c60857807888035ce1d7d8c226f03c54ff66350b /lib/libc/i386 | |
parent | 2dddbc74133124806256d9da2600203460848dcd (diff) | |
download | FreeBSD-src-29cef807d272d7d6066b8dcd7b17f2b5a0206c1d.zip FreeBSD-src-29cef807d272d7d6066b8dcd7b17f2b5a0206c1d.tar.gz |
Remove hand-written labs/abs implementations. GCC is smart enough.
It turns out GCC generates code that's a couple of bytes big bigger, but
performs no branching whatsoever.
Submitted by: Christoph Mallon
Diffstat (limited to 'lib/libc/i386')
-rw-r--r-- | lib/libc/i386/stdlib/Makefile.inc | 2 | ||||
-rw-r--r-- | lib/libc/i386/stdlib/abs.S | 47 | ||||
-rw-r--r-- | lib/libc/i386/stdlib/labs.S | 47 |
3 files changed, 1 insertions, 95 deletions
diff --git a/lib/libc/i386/stdlib/Makefile.inc b/lib/libc/i386/stdlib/Makefile.inc index 0a6a6a8..e4197d8 100644 --- a/lib/libc/i386/stdlib/Makefile.inc +++ b/lib/libc/i386/stdlib/Makefile.inc @@ -1,4 +1,4 @@ # @(#)Makefile.inc 8.1 (Berkeley) 6/4/93 # $FreeBSD$ -MDSRCS+=abs.S div.S labs.S ldiv.S +MDSRCS+=div.S ldiv.S diff --git a/lib/libc/i386/stdlib/abs.S b/lib/libc/i386/stdlib/abs.S deleted file mode 100644 index 236a631..0000000 --- a/lib/libc/i386/stdlib/abs.S +++ /dev/null @@ -1,47 +0,0 @@ -/*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * William Jolitz. - * - * 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. - * 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) - .text - .asciz "@(#)abs.s 5.2 (Berkeley) 12/17/90" -#endif /* LIBC_SCCS and not lint */ -#include <machine/asm.h> -__FBSDID("$FreeBSD$"); - - -ENTRY(abs) - movl 4(%esp),%eax - testl %eax,%eax - jns 1f - negl %eax -1: ret -END(abs) diff --git a/lib/libc/i386/stdlib/labs.S b/lib/libc/i386/stdlib/labs.S deleted file mode 100644 index 5e00b7a..0000000 --- a/lib/libc/i386/stdlib/labs.S +++ /dev/null @@ -1,47 +0,0 @@ -/*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * William Jolitz. - * - * 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. - * 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) - .text - .asciz "@(#)abs.s 5.2 (Berkeley) 12/17/90" -#endif /* LIBC_SCCS and not lint */ -#include <machine/asm.h> -__FBSDID("$FreeBSD$"); - - -ENTRY(labs) - movl 4(%esp),%eax - testl %eax,%eax - jns 1f - negl %eax -1: ret -END(labs) |