summaryrefslogtreecommitdiffstats
path: root/lib/libc/amd64
Commit message (Collapse)AuthorAgeFilesLines
* Make sure that stack is 16-byte aligned before calling a function,kib2011-11-022-0/+6
| | | | | | | | | as it is required by amd64 ABI. Add a comment for the places were the stack is accidentally properly aligned already. PR: amd64/162214 Submitted by: yamayan <yamayan kbh biglobe ne jp> MFC after: 1 week
* Replace a proliferation of buggy MD implementations of modf() with adas2011-10-213-93/+1
| | | | | | | working MI one. The MI one only needs to be overridden on machines with non-IEEE754 arithmetic. (The last supported one was the VAX.) It can also be overridden if someone comes up with a faster one that actually passes the regression tests -- but this is harder than it sounds.
* Remove incorrect attribution.gnn2011-07-211-1/+1
| | | | | | Approved by: re (kib) Pointed out by: brueffer Pointy hat to: gnn
* Make both stpcpy and strcpy be assembly language implementationsgnn2011-07-213-20/+60
| | | | | | | | | on amd64. Submitted by: Guillaume Morin (guillaume at morinfr.org) Reviewed by: kib, jhb Approved by: re (bz) MFC after: 1 month
* Remove duplicate .note.GNU-stack section declaration. bcopy alreadykib2011-02-041-2/+0
| | | | | | made the neccessary provisions. Reported by: arundel
* Add section .note.GNU-stack for assembly files used by 386 and amd64.kib2011-01-0729-0/+57
|
* Retire the amd64 and i386 specific inline assembly versions of ldexp.c,dim2010-09-301-68/+0
| | | | | | | | as they are slower than the generic version in C, at least on modern hardware. This leaves us with just five implementations. Suggested by: bde Approved by: rpaulo (mentor)
* Apply the same workaround for clang to amd64's version of ldexp.c (as indim2010-09-291-3/+9
| | | | | | | | | | | | | r212976): order the incoming arguments to fscale as st(0), st(1), and mark temp2 volatile (only in case of compilation with clang) to force clang to pop it correctly. No binary change when compiled with gcc. This fixes ldexp() when compiled with clang on amd64, which makes drand48() and friends work correctly again, and this in turn fixes perl's tempfile(). Reported by: Renato Botelho, Derek Tattersall Approved by: rpaulo (mentor)
* Mark uname(), getdomainname() and setdomainname() with COMPAT_FREEBSD4.ed2008-11-091-2/+1
| | | | | | | | | | | | | | | | | | | | | Looking at our source code history, it seems the uname(), getdomainname() and setdomainname() system calls got deprecated somewhere after FreeBSD 1.1, but they have never been phased out properly. Because we don't have a COMPAT_FREEBSD1, just use COMPAT_FREEBSD4. Also fix the Linuxolator to build without the setdomainname() routine by just making it call userland_sysctl on kern.domainname. Also replace the setdomainname()'s implementation to use this approach, because we're duplicating code with sysctl_domainname(). I wasn't able to keep these three routines working in our COMPAT_FREEBSD32, because that would require yet another keyword for syscalls.master (COMPAT4+NOPROTO). Because this routine is probably unused already, this won't be a problem in practice. If it turns out to be a problem, we'll just restore this functionality. Reviewed by: rdivacky, kib
* We've been lax about matching END() macros in asm code for some time. Thispeter2008-11-0227-4/+46
| | | | | | | is used to set the ELF size attribute for functions. It isn't normally critical but some things can make use of it (gdb for stack traces). Valgrind needs it so I'm adding it in. The problem is present on all branches and on both i386 and amd64.
* Two FP-related setjmp/longjmp changes:das2008-06-282-2/+20
| | | | | | | | | | | | | | | 1. Save and restore the control part of the MXCSR in addition to the i387 control word to ensure that the two are consistent. Note that standards don't require longjmp to restore either control word, and none of Linux, MacOS X 10.3 and earlier, NetBSD, OpenBSD, or Solaris do it. However, it is historical FreeBSD behavior, and bde points out that it is needed to make longjmping out of a signal handler work properly, given the way FreeBSD clobbers the FPU state on signal handler entry. 2. Don't clobber the FPU exception flags in longjmp. C99 requires them to remain unchanged.
* 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.
OpenPOWER on IntegriCloud