summaryrefslogtreecommitdiffstats
path: root/lib/libc/amd64
Commit message (Collapse)AuthorAgeFilesLines
* Add an alternative view of the bits in an 80-bit long double (64+16bde2008-01-171-1/+6
| | | | | | | | | | | | | | | | | | | | instead of 32+32+15+1) on all arches that have such long doubles (amd64, ia64 and i386). Large objects should be be accessed in large units, and the 32+32+15+1[+padding] decomposition asks for almost the opposite of that, sometimes resulting in very slow accesses depending on how well the compiler ignores what we ask for and converts to the best units for the given machine. E.g., on Athlons, there is a 10-20 cycle penalty for accessing the middle 32-bit word immediately after an 80-bit store. Whether actually using the alternative view is better is very machine- dependent. A 32+32+16 view is probably best with old 32-bit systems and gcc through 4.2.1. The compiler should mostly avoid the view and generate best accesses, but gcc-4.2.1 is far from doing that. I think 64+16 is best for now. Similarly for doubles -- they should be using 64+0 especially on 64-bit machines, but fdlibm uses 32+32 extensively for them. Fortunately, in 64-bit mode for doubles, gcc already ignores the 32+32-bit view and generates best accesses in many cases.
* Since nan() is supposed to work the same as strtod("nan(...)", NULL),das2007-12-181-3/+0
| | | | | | | | | | | | my original implementation made both use the same code. Unfortunately, this meant libm depended on a vendor header at compile time and previously- unexposed vendor bits in libc at runtime. Hence, I just wrote my own version of the relevant vendor routine. As it turns out, mine has a factor of 8 fewer of lines of code, and is a bit more readable anyway. The strtod() and *scanf() routines still use vendor code. Reviewed by: bde
* Export gdtoa's __ULto{x,Q}_D2A routine in a private namespace sodas2007-12-161-0/+3
| | | | libm can use it.
* Arrange so that the NaN returned by strtod("nan", NULL) is the same asdas2007-12-161-4/+4
| | | | the NaN returned by strtod("nan()", NULL).
* In scanf, round according to the current rounding mode.das2007-12-031-1/+1
|
* Classify mmap, lseek, pread, pwrite, truncate, ftruncate as pseudopeter2007-07-041-3/+5
| | | | | | | | | | syscalls, unless WITHOUT_SYSCALL_COMPAT is defined. The default case will have the .c wrappers still. If you define WITHOUT_SYSCALL_COMPAT, the .c wrappers will go away and libc will make direct syscalls. After 7-stable starts, the direct syscall method will be default. Approved by: re (kensmith)
* Adjust the syscall stub macros to be consistent in their meaning. Inpeter2007-07-041-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | particular: SYSCALL() makes a syscall, with errno handling, and continues execution directly after the macro in the non-error case. RSYSCALL() is just like SYSCALL(), but returns after success. Both SYSCALL(name) and RSYSCALL(name) export "__sys_name" as a strong symbol, with "_name" and "name" as weak aliases. PSEUDO() is just like RSYSCALL(), but skipping the "name" weak alias. It still does "__sys_name" and "_name". Change i386 to add errno handling to PSEUDO. The same for amd64 and sparc64, with appear to have copied the behavior. ia64 was correct (as was alpha). Just remove some apparently unused variants of the macros. (untested!) I believe powerpc is correct. Fix arm to not export "name" from the PSEUDO case. Remove apparently extra unused variants. (untested!) The errno problem manifested on i386/amd64/sparc64 by having "PSEUDO" classified syscalls return without setting errno. eg: "addr = mmap()" could return with "addr" = 22 instead of setting errno to 22 and returning -1. Approved by: re (kensmith)
* Some libc symbol map cleanups.deischen2007-05-311-4/+0
| | | | | | | | | | | | | | | | | | | | | net: endhostdnsent is named _endhostdnsent and is private to netdb family of functions. posix1e: acl_size.c has been never compiled in, so there's no "acl_size". rpc: "getnetid" is a static function. stdtime: "gtime" is #ifdef'ed out in the source. some symbols are specific only to some architectures, e.g., ___tls_get_addr is only defined on i386. __htonl, __htons, __ntohl and __ntohs are no longer functions, they are now (internal) defines in <machine/endian.h>. Submitted by: ru
* Remove .mcount from gmon's Symbol map and add it to the appropriatedeischen2007-05-131-0/+1
| | | | | | | arch. It can be named differently depending on the arch (.mcount, _mcount). Submitted by: marius
* Use C comments since we now preprocess these files with CPP.deischen2007-04-291-12/+16
|
* Import amd64 assembly implementations of div(3) family from NetBSD.jkim2007-04-044-0/+51
| | | | Obtained from: NetBSD
* Remove silly n that crept inimp2007-01-091-1/+1
|
* Per Regents of the University of Calfornia letter, remove advertisingimp2007-01-0916-65/+1
| | | | | | clause. # If I've done so improperly on a file, please let me know.
* The distinction between quiet and signaling NaN formats isdas2007-01-031-0/+21
| | | | | machine-dependent; these files tell the latest version of gdtoa what to do.
* Instead of re-implementing hton[ls] and friends for each arch, add a new MIcognet2006-11-065-206/+0
| | | | | | | file, net/ntoh.c, which just implement them using the inline functions from <sys/endian.h>. Suggested by: bde
* Desupport the undocumented NO_QUAD option, just don't compileru2006-03-161-5/+0
| | | | the quad support on 64-bit platforms.
* Add each directory's symbol map file to SYM_MAPS.deischen2006-03-131-0/+1
|
* Add symbol maps and initial symbol version definitions to libc.deischen2006-03-131-0/+73
| | | | Reviewed by: davidxu
* Optimize the instruction alignment.alc2005-04-231-2/+1
|
* Do not try to store 64 bits into 32 bit errno variable. With the changed libckan2005-04-211-1/+1
| | | | | data layout, this was corrupting _PathLocale variable leading to programs dumping core in non-default locales.
* Add a machine-specific, optimized implementation of strcat.alc2005-04-102-1/+166
| | | | | | PR: 73111 Submitted by: Ville-Pertti Keinonen <will@iki.fi> (taken from NetBSD) MFC after: 3 weeks
* Eliminate a conditional branch and as a side-effect eliminate a branch toalc2005-04-101-5/+4
| | | | | | | | a return instruction. (The latter is discouraged by the Opteron optimization manual because it disables branch prediction for the return instruction.) Reviewed by: bde
* Add a machine-specific, optimized implementation of strcpy.alc2005-04-102-1/+113
| | | | | | PR: 73111 Submitted by: Ville-Pertti Keinonen <will@iki.fi> (taken from NetBSD) MFC after: 3 weeks
* Add a machine-specific, optimized implementation of strcmp.alc2005-04-092-1/+75
| | | | | | PR: 73111 Submitted by: Ville-Pertti Keinonen <will@iki.fi> (taken from NetBSD) MFC after: 3 weeks
* Add machine-specific, optimized implementations of bcmp and memcmp.alc2005-04-083-1/+67
| | | | | | PR: 73111 Submitted by: Ville-Pertti Keinonen <will@iki.fi> (taken from NetBSD) MFC after: 3 weeks
* Eliminate unneeded instructions that are a vestige of mechanicalalc2005-04-081-10/+4
| | | | translation from i386.
* Eliminate an unneeded instruction that is a vestige of mechanicalalc2005-04-071-7/+5
| | | | translation from i386.
* Add machine-specific, optimized implementations of bcopy, bzero, memcpy,alc2005-04-076-0/+212
| | | | | | | | memmove, and memset. PR: 73111 Submitted by: Ville-Pertti Keinonen <will@iki.fi> (taken from NetBSD) MFC after: 3 weeks
* Remove fpsetsticky(). This was added for SysV compatibility, but duedas2005-03-152-9/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to mistakes from day 1, it has always had semantics inconsistent with SVR4 and its successors. In particular, given argument M: - On Solaris and FreeBSD/{alpha,sparc64}, it clobbers the old flags and *sets* the new flag word to M. (NetBSD, too?) - On FreeBSD/{amd64,i386}, it *clears* the flags that are specified in M and leaves the remaining flags unchanged (modulo a small bug on amd64.) - On FreeBSD/ia64, it is not implemented. There is no way to fix fpsetsticky() to DTRT for both old FreeBSD apps and apps ported from other operating systems, so the best approach seems to be to kill the function and fix any apps that break. I couldn't find any ports that use it, and any such ports would already be broken on FreeBSD/ia64 and Linux anyway. By the way, the routine has always been undocumented in FreeBSD, except for an MLINK to a manpage that doesn't describe it. This manpage has stated since 5.3-RELEASE that the functions it describes are deprecated, so that must mean that functions that it is *supposed* to describe but doesn't are even *more* deprecated. ;-) Note that fpresetsticky() has been retained on FreeBSD/i386. As far as I can tell, no other operating systems or ports of FreeBSD implement it, so there's nothing for it to be inconsistent with. PR: 75862 Suggested by: bde
* Define LDBL_NBIT to be a mask indicating the position of the integerdas2005-03-071-1/+2
| | | | | | | | bit in a long double. For architectures that don't have such a bit, LDBL_NBIT is 0. This makes it possible to say `mantissa & ~LDBL_NBIT' in places that previously used an #ifdef to select the right expression. The optimizer should dispense with the extra arithmetic when LDBL_NBIT is 0.
* Update my email address.das2005-02-061-1/+1
|
* Eliminate gdtoa.mk and move its contents to ${MACHINE_ARCH}/Makefile.inc.das2005-01-152-5/+4
| | | | | The purpose of having a separate file involved an abandoned scheme that would have kept contrib/gdtoa out of the include path for the rest of libc.
* Fix brk(3). The stack was unbalanced when we jumped to cerror. Oops!peter2004-10-271-0/+1
| | | | | | This causes nasty things like SEGV or a cpu spin when we return. Submitted by: "James R. Van Artsalen" <james@jrv.org>
* For variables that are only checked with defined(), don't provideru2004-10-241-1/+1
| | | | any fake value.
* Add support for TLS in statically linked programs.dfr2004-08-152-1/+39
|
* 1. Use correct alignment mask, -15 != ~15davidxu2004-07-311-2/+2
| | | | 2. Make end of frames
* Set fpu context flags to known values, zero is illegal.davidxu2004-07-281-0/+2
|
* Make FLT_ROUNDS correctly reflect the dynamic rounding mode.das2004-07-192-1/+27
|
* Replace seven nominally MD implementations of frexp() that are brokendas2004-07-182-69/+1
| | | | for subnormals with one implementation that works.
* Implement the classification macros isfinite(), isinf(), isnan(), anddas2004-07-092-76/+1
| | | | | | | | | | | | | | | | | | | | | isnormal() the hard way, rather than relying on fpclassify(). This is a lose in the sense that we need a total of 12 functions, but it is necessary for binary compatibility because we have never bumped libm's major version number. In particular, isinf(), isnan(), and isnanf() were BSD libc functions before they were C99 macros, so we can't reimplement them in terms of fpclassify() without adding a dependency on libc.so.5. I have tried to arrange things so that programs that could be compiled in FreeBSD 4.X will generate the same external references when compiled in 5.X. At the same time, the new macros should remain C99-compliant. The isinf() and isnan() functions remain in libc for historical reasons; however, I have moved the functions that implement the macros isfinite() and isnormal() to libm where they belong. Moreover, half a dozen MD versions of isinf() and isnan() have been replaced with MI versions that work equally well. Prodded by: kris
* Avoid to touch red zone, in libpthread, ucontext may be saved by kernel'sdavidxu2004-06-151-1/+1
| | | | | | | get_mcontext, and libpthread will use signalcontext to deliver signal in userland, it looks same as kernel's send_sig does. Reviewed by: deischen, tjr
* Fix Yet Another 16 byte stack alignment bug. Thankfully, this one ispeter2004-03-312-10/+10
| | | | | | | | | | | solved by a simple 'make world'. The signalcontext function was going to the trouble of generating an even 16 byte alignment, but in fact it needed to be odd aligned to simulate the 8-byte return address having been pushed by the caller. This fixes yet another group of crashes in applications using libpthread. And yet again, it was my fault all along. While here, rename the duplicate internal ctx_wrapper() functions to makectx_wrapper() and sigctx_wrapper() so that traces aren't ambiguous.
* Change the syscall stub branch orders so that the static branch predictionpeter2004-02-224-12/+51
| | | | will assume that syscalls will succeed rather than fail.
* Fix a typo in the !__GNUC__ case and remove an obsolete comment.das2004-02-161-3/+1
|
* Fix some aliasing problems.das2004-02-161-14/+19
|
* Rewrite fabs.S to use pure SSE2 operations. I got the clues how to dopeter2004-02-081-10/+35
| | | | this from looking at code generated by gcc.
* Define LDBL_MANH_SIZE and LDBL_MANL_SIZE to be the sizes of thedas2004-01-181-0/+3
| | | | high and low words of the mantissa in bits, respectively.
* Provide sysarch(2) prototypes in the MD sysarch.h headers. While I'mnectar2004-01-094-12/+4
| | | | | | | | | | at it, use the ANSI C generic pointer type for the second argument, thus matching the documentation. Remove the now extraneous (and now conflicting) function declarations in various libc sources. Remove now unnecessary casts. Reviewed by: bde
* "Fix" makecontext() so that the C code begins execution with itspeter2003-12-051-2/+6
| | | | | | | | | | | | | ABI-required stack alignment. C code expects that the push of the return address disturbed the 16 byte alignment and it will take corrective measures to fix it before making another call. Of course, if its wrong to start with, then all hell breaks loose. Essentially we "fix" this by making the stack alignment odd to start with. This was one of the things that broke on libkse with apps that use floating point/varargs/etc. Approved by: re (scottl)
* Add implementations of amd64_[gs]et_[fg]sbase().peter2003-10-235-0/+158
|
OpenPOWER on IntegriCloud