summaryrefslogtreecommitdiff
path: root/sysdeps/i386
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1997-07-22 00:10:33 +0000
committerUlrich Drepper <drepper@redhat.com>1997-07-22 00:10:33 +0000
commit60c966358ed6fa6ce3ded5426f46232cbfd8e0fd (patch)
tree2edfd4ad681692a2dbfdfcabaead5bca25ed2be5 /sysdeps/i386
parent907a1bacf996264c3197342cfc565b1d4f840bfb (diff)
1997-07-22 01:35 Ulrich Drepper <drepper@cygnus.com> * Makerules (+make-deps): Use $(CFLAGS) in run of $(+mkdep) so that optimizing is also selected for dependency generation. * configure.in: Add machine description for TI c[34]x. * inet/Makefile (routines): Remove ntohl and ntohs. * inet/netinet/in.h: Use optimized version of hton? and ntoh? for little endian machines. * sysdeps/alpha/ntohl.s: Removed. * sysdeps/alpha/ntohs.s: Removed. * sysdeps/generic/ntohl.c: Removed. * sysdeps/generic/ntohs.c: Removed. * sysdeps/generic/htonl.c: Add aliases for ntohl. * sysdeps/vax/htonl.s: Likewise. * sysdeps/generic/htons.c: Add aliases for ntohs. * sysdeps/vax/htons.s: Likewise. * sysdeps/vax/ntohl.s: Removed. * sysdeps/vax/ntohs.s: Removed. * sysdeps/generic/bits/htontoh.h: New file. * sysdeps/i386/htonl.S: New file. * sysdeps/i386/htons.S: New file. * sysdeps/i386/i486/htonl.S: New file. * sysdeps/i386/fpu/bits/mathinline.h: Correct and optimized compare macros. * sysdeps/mips/dl-machine.h: Remove mips64 dependent parts. * sysdeps/mips/mips64/dl-machine.h: New file. * sysdeps/unix/sysv/linux/Makefile (sysdep_headers): Don't install syscall-list.h. 1997-07-12 Andreas Jaeger <aj@arthur.rhein-neckar.de> * libc.map: Add missing symbol _obstack. 1997-07-14 08:22 H.J. Lu <hjl@gnu.ai.mit.edu> * sysdeps/mips/rtld-parms: New. * sysdeps/unix/sysv/linux/mips/lxstat.h: Moved to * sysdeps/unix/sysv/linux/mips/lxstat.c: ...this. * sysdeps/unix/sysv/linux/mips/sgidef.h: Moved to * sysdeps/unix/sysv/linux/mips/sgidefs.h: ...this. * sysdeps/generic/dl-sysdep.c (_start): Change to ENTRY_POINT. 1997-07-17 08:39 H.J. Lu <hjl@gnu.ai.mit.edu> * sysdeps/mips/dl-machine.h: Remove extra stuff. 1997-07-06 07:18 Geoff Keating <geoffk@ozemail.com.au> * sysdeps/powerpc/bits/endian.h: Handle multiple endianess. * stdlib/grouping.h: Suppress gcc warning about testing unsigned char for less-than-zero. * stdio-common/printf_fp.c: Likewise. * stdio-common/vfprintf.c: Likewise. * sysdeps/powerpc/add_n.s: New file. * sysdeps/powerpc/sub_n.s: New file. * sysdeps/powerpc/lshift.s: Ported XCOFF->ELF (from GMP). * sysdeps/powerpc/mul_1.s: Ported XCOFF->ELF (from GMP). * sysdeps/powerpc/addmul_1.s: Ported XCOFF->ELF (from GMP). * sysdeps/powerpc/submul_1.s: Ported XCOFF->ELF (from GMP). * sysdeps/powerpc/rshift.s: Ported XCOFF->ELF (from GMP). * math/libm-test.c (cos_test, sin_test, sincos_test): Use precomputed pi/6 rather than having gcc calculate it, otherwise tests give inaccurate result due to inaccurate input. * math/libm.map: Add __fe_*_env constants to list of exported symbols. * sysdeps/libm-ieee754/s_isinf.c: Simplify, make faster. * sysdeps/libm-ieee754/s_isinff.c: Simplify, make faster. * sysdeps/libm-ieee754/s_atan2f.c: Correct value of pi to be correct round-to-nearest value. * sysdeps/libm-ieee754/e_log.c: Make sure exceptions are raised. * sysdeps/libm-ieee754/e_log10.c: Likewise. * sysdeps/libm-ieee754/e_log10f.c: Likewise. * sysdeps/libm-ieee754/e_logf.c: Likewise. * sysdeps/libm-ieee754/s_log1p.c: Likewise. Also use correct -Inf. * sysdeps/libm-ieee754/s_log1pf.c: Likewise. Also use correct -Inf. * sysdeps/libm-ieee754/s_log2.c: Likewise. * sysdeps/libm-ieee754/s_log2f.c: Likewise. 1997-07-15 21:54 Thorsten Kukuk <kukuk@vt.uni-paderborn.de> * nis/nss_compat/compat-grp.c: Fix "buffer to small" problems and memory leaks. * nis/nss_compat/compat-pwd.c: Likewise. * nis/nss_compat/compat-spwd.c: Likewise. * nis/nss_nis/nis-alias.c: Likewise. * nis/nss_nis/nis-ethers.c: Likewise. * nis/nss_nis/nis-grp.c: Likewise. * nis/nss_nis/nis-hosts.c: Likewise. * nis/nss_nis/nis-network.c: Likewise. * nis/nss_nis/nis-proto.c: Likewise. * nis/nss_nis/nis-pwd.c: Likewise. * nis/nss_nis/nis-rpc.c: Likewise. * nis/nss_nis/nis-service.c: Likewise. * nis/nss_nis/nis-spwd.c: Likewise. * nis/nss_nisplus-alias.c: Likewise. * nis/nss_nisplus-ethers.c: Likewise. * nis/nss_nisplus-grp.c: Likewise. * nis/nss_nisplus-hosts.c: Likewise. * nis/nss_nisplus-netgrp.c: Likewise. * nis/nss_nisplus-network.c: Likewise. * nis/nss_nisplus-proto.c: Likewise. * nis/nss_nisplus-pwd.c: Likewise. * nis/nss_nisplus-rpc.c: Likewise. * nis/nss_nisplus-service.c: Likewise. * nis/nss_nisplus-spwd.c: Likewise. * nis/nss_nisplus-parse.c: If buffer to small, give -1 back. 1997-07-20 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/m68k/dl-machine.h (elf_machine_rela): Mention program name in warning message. * sysdeps/powerpc/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/sparc/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/sparc64/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/i386/dl-machine.h (elf_machine_rel): Print program name first. 1997-07-20 19:33 Thorsten Kukuk <kukuk@vt.uni-paderborn.de> * libc.map: Add _null_auth and _seterr_reply. * sunrpc/clnt_udp.c (clntudp_call): If xargs is NULL, don't encode it.
Diffstat (limited to 'sysdeps/i386')
-rw-r--r--sysdeps/i386/bits/htontoh.h79
-rw-r--r--sysdeps/i386/dl-machine.h5
-rw-r--r--sysdeps/i386/fpu/bits/mathinline.h24
-rw-r--r--sysdeps/i386/htonl.S39
-rw-r--r--sysdeps/i386/htons.S38
-rw-r--r--sysdeps/i386/i486/htonl.S37
6 files changed, 207 insertions, 15 deletions
diff --git a/sysdeps/i386/bits/htontoh.h b/sysdeps/i386/bits/htontoh.h
new file mode 100644
index 0000000000..590b509875
--- /dev/null
+++ b/sysdeps/i386/bits/htontoh.h
@@ -0,0 +1,79 @@
+/* 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 _NETINET_IN_H
+# error "Don't include this file directly, use <netinet/in.h>"
+#endif
+
+#if defined __GNUC__ && __GNUC__ >= 2
+/* We can use inline assembler instructions to optimize the code. */
+
+/* To swap the bytes in a word the i486 processors and up provide the
+ `bswap' opcode. On i386 we have to use three instructions. */
+# if !defined __i486__ && !defined __pentium__ && !defined __pentiumpro__
+
+extern __inline u_int32_t
+__ntohl (u_int32_t netlong)
+{
+ register u_int32_t hostlong;
+
+ __asm__ ("rorw $8, %w0; rorl $16, %0; rorw $8, %w0"
+ : "=r" (hostlong)
+ : "0" (netlong));
+
+ return hostlong;
+}
+
+# else
+
+extern __inline u_int32_t
+__ntohl (u_int32_t netlong)
+{
+ register u_int32_t hostlong;
+
+ __asm__ ("bswap %0" : "=r" (hostlong) : "0" (netlong));
+
+ return hostlong;
+}
+
+# endif
+
+/* For a short word we have a simple solution. */
+extern __inline u_int16_t
+__ntohs (u_int16_t netshort)
+{
+ register u_int16_t hostshort;
+
+ __asm__ ("rorw $8, %w0" : "=r" (hostshort) : "0" (netshort));
+}
+
+
+/* The other direction can be handled with the same functions. */
+extern __inline u_int32_t
+__htonl (u_int32_t hostlong)
+{
+ return __ntohl (hostlong);
+}
+
+extern __inline u_int16_t
+__htons (u_int16_t hostshort)
+{
+ return __ntohs (hostshort);
+}
+
+#endif /* GNU CC */
diff --git a/sysdeps/i386/dl-machine.h b/sysdeps/i386/dl-machine.h
index a83356fce1..0388cbe510 100644
--- a/sysdeps/i386/dl-machine.h
+++ b/sysdeps/i386/dl-machine.h
@@ -276,9 +276,8 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
strtab = ((void *) map->l_addr
+ map->l_info[DT_STRTAB]->d_un.d_ptr);
- _dl_sysdep_error ("Symbol `", strtab + refsym->st_name,
- "' in `",
- _dl_argv[0] ?: "<program name unknown>",
+ _dl_sysdep_error (_dl_argv[0] ?: "<program name unknown>",
+ ": Symbol `", strtab + refsym->st_name,
"' has different size in shared object, "
"consider re-linking\n", NULL);
}
diff --git a/sysdeps/i386/fpu/bits/mathinline.h b/sysdeps/i386/fpu/bits/mathinline.h
index 42dae92a2a..4228959d23 100644
--- a/sysdeps/i386/fpu/bits/mathinline.h
+++ b/sysdeps/i386/fpu/bits/mathinline.h
@@ -30,42 +30,42 @@
# define isgreater(x, y) \
({ int result; \
__asm__ ("fucompp; fnstsw; andb $0x45, %%ah; setz %%al;" \
- "andl $0xff, %0" \
- : "=a" (result) : "t" (x), "u" (y) : "cc"); \
+ "andl $0x01, %0" \
+ : "=a" (result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
result; })
# define isgreaterequal(x, y) \
({ int result; \
__asm__ ("fucompp; fnstsw; testb $0x05, %%ah; setz %%al;" \
- "andl $0xff, %0" \
- : "=a" (result) : "t" (x), "u" (y) : "cc"); \
+ "andl $0x01, %0" \
+ : "=a" (result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
result; })
# define isless(x, y) \
({ int result; \
__asm__ ("fucompp; fnstsw; xorb $0x01, %%ah; testb $0x45, %%ah;" \
- "setz %%al; andl $0xff, %0" \
- : "=a" (result) : "t" (x), "u" (y) : "cc"); \
+ "setz %%al; andl $0x01, %0" \
+ : "=a" (result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
result; })
# define islessequal(x, y) \
({ int result; \
__asm__ ("fucompp; fnstsw; xorb $0x01, %%ah; testb $0x05, %%ah;" \
- "setz %%al; andl $0xff, %0" \
- : "=a" (result) : "t" (x), "u" (y) : "cc"); \
+ "setz %%al; andl $0x01, %0" \
+ : "=a" (result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
result; })
# define islessgreater(x, y) \
({ int result; \
__asm__ ("fucompp; fnstsw; testb $0x44, %%ah; setz %%al;" \
- "andl $0xff, %0" \
- : "=a" (result) : "t" (x), "u" (y) : "cc"); \
+ "andl $0x01, %0" \
+ : "=a" (result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
result; })
# define isunordered(x, y) \
({ int result; \
- __asm__ ("fucompp; fnstsw; sahf; setp %%al; andl $0xff, %0" \
- : "=a" (result) : "t" (x), "u" (y) : "cc"); \
+ __asm__ ("fucompp; fnstsw; sahf; setp %%al; andl $0x01, %0" \
+ : "=a" (result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
result; })
#endif
diff --git a/sysdeps/i386/htonl.S b/sysdeps/i386/htonl.S
new file mode 100644
index 0000000000..73dd1e9bea
--- /dev/null
+++ b/sysdeps/i386/htonl.S
@@ -0,0 +1,39 @@
+/* Change byte order in word. For Intel 80386.
+ 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. */
+
+#include <sysdep.h>
+#include "asm-syntax.h"
+
+/*
+ INPUT PARAMETERS:
+ word (sp + 4)
+*/
+
+ .text
+ENTRY (__htonl)
+ movl 4(%esp), %eax
+ rorw $8, %ax
+ rorl $16, %eax
+ rorw $8, %ax
+ ret
+END (__htonl)
+
+strong_alias (__htonl, __ntohl)
+weak_alias (__htonl, htonl)
+weak_alias (__ntohl, ntohl)
diff --git a/sysdeps/i386/htons.S b/sysdeps/i386/htons.S
new file mode 100644
index 0000000000..5d0f59c92b
--- /dev/null
+++ b/sysdeps/i386/htons.S
@@ -0,0 +1,38 @@
+/* Change byte order in word. For Intel 80x86, x >= 3.
+ 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. */
+
+#include <sysdep.h>
+#include "asm-syntax.h"
+
+/*
+ INPUT PARAMETERS:
+ word (sp + 4)
+*/
+
+ .text
+ENTRY (__htons)
+ movl 4(%esp), %eax
+ andl $0xffff, %eax
+ rorw $8, %ax
+ ret
+END (__htons)
+
+strong_alias (__htons, __ntohs)
+weak_alias (__htons, htons)
+weak_alias (__ntohs, ntohs)
diff --git a/sysdeps/i386/i486/htonl.S b/sysdeps/i386/i486/htonl.S
new file mode 100644
index 0000000000..cf3a94fc76
--- /dev/null
+++ b/sysdeps/i386/i486/htonl.S
@@ -0,0 +1,37 @@
+/* Change byte order in word. For Intel 80x86, x >= 4.
+ 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. */
+
+#include <sysdep.h>
+#include "asm-syntax.h"
+
+/*
+ INPUT PARAMETERS:
+ word (sp + 4)
+*/
+
+ .text
+ENTRY (__htonl)
+ movl 4(%esp), %eax
+ bswap %eax
+ ret
+END (__htonl)
+
+strong_alias (__htonl, __ntohl)
+weak_alias (__htonl, htonl)
+weak_alias (__ntohl, ntohl)