summaryrefslogtreecommitdiffstats
path: root/lib/libc/amd64
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Add rfork_thread(3).alc2003-10-132-1/+102
|
* Fix fabs(). This commit brought to you by the letter 'l'.peter2003-09-261-1/+1
| | | | | | | | | (fstp stores a mem32 value, fstpl stores a mem64 value) This fixes ghostscript for 'make release' on amd64. Ghostscript for some reason thinks it is a good idea to use -fno-builtin, which means it is vulnerable to bugs in libc that are normally hidden by the builtin gcc functions. Oops.
* Sigh. I can't win anything. Use addq rather than addl with %rsp.peter2003-09-041-1/+1
|
* Apply same basic fix for getcontext(2) as for i386. Store the returnpeter2003-09-042-2/+56
| | | | | | value for getcontext() in a preserved register rather than on the stack. The second time around, the stack value would likely have changed so we can't depend on it for the return value.
* Fix some minor whitespace botchespeter2003-09-041-1/+1
|
* Add the mlockall() and munlockall() system calls.bms2003-08-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | - All those diffs to syscalls.master for each architecture *are* necessary. This needed clarification; the stub code generation for mlockall() was disabled, which would prevent applications from linking to this API (suggested by mux) - Giant has been quoshed. It is no longer held by the code, as the required locking has been pushed down within vm_map.c. - Callers must specify VM_MAP_WIRE_HOLESOK or VM_MAP_WIRE_NOHOLES to express their intention explicitly. - Inspected at the vmstat, top and vm pager sysctl stats level. Paging-in activity is occurring correctly, using a test harness. - The RES size for a process may appear to be greater than its SIZE. This is believed to be due to mappings of the same shared library page being wired twice. Further exploration is needed. - Believed to back out of allocations and locks correctly (tested with WITNESS, MUTEX_PROFILING, INVARIANTS and DIAGNOSTIC). PR: kern/43426, standards/54223 Reviewed by: jake, alc Approved by: jake (mentor) MFC after: 2 weeks
* Set mc_len to sizeof(mcontext_t), otherwise it is an invalid context.davidxu2003-07-261-0/+1
|
* Instantiate explicit callable versions of the machine/ieeefp.h inlinespeter2003-07-229-1/+67
| | | | for the use of non-GCC compilers and C++ code.
* Turn off the libc/quad functions since they are not needed for amd64peter2003-07-221-0/+9
| | | | and just cause lots of warnings.
* Add amd64 versions of makecontext() and signalcontext() neededdeischen2003-07-193-1/+208
| | | | | for libkse (makecontext() is also needed for libthr). These probably will need some tweaking.
* This is unusable on amd64. Remove it before it causes more confusion.peter2003-06-131-53/+0
| | | | | | It is only possible to do this on an ABI that has a compulsory frame pointer, which the amd64 ABI does not. Thus, it is only possible to implement this as a compiler builtin.
* Use C99 compatible ASM statements.obrien2003-06-101-1/+1
| | | | | (untested, but existing state breaks http://triangle.rtp.freebsd.org/~des/tinderbox-CURRENT-amd64-amd64.brief)
* Cosmetic; record offsets used within jmpbufpeter2003-06-023-30/+30
|
* Fix sigsetjmp(). It helps if we do not try to save the old signal maskpeter2003-06-021-0/+1
| | | | to a random memory location. Perl works a lot better with this.
* Repair PIC mode. It seems I was a bit too excited about thepeter2003-05-247-15/+89
| | | | implications of native PC relative addressing.
* Update ldexp.c for amd64.peter2003-05-102-7/+1
|
* Add a comment describing why it's important for the values in thisdas2003-05-081-0/+7
| | | | | | file to be correct, and how to generate them automatically. Caused much pain and suffering for: peter
* SIG_SETMASK is 3, not 1. Sigh.peter2003-05-081-1/+1
|
* Fix an embarresing transcription error from i386 to amd64. Put the argumentspeter2003-05-082-13/+12
| | | | | to sigprocmask(2) int the correct order. *blush*. For sigsetjmp(), match up the pushq/popq in the non-savemask case.
* Tidy up modf.S and make it actually work. It wasn't extractingpeter2003-05-081-16/+13
| | | | | the value out of ST(0) before copying it to %xmm0. Also remove bogus stack frame and work in the red zone.
* Fix typo, even though this is unused.peter2003-05-081-1/+1
|
* Like ia64, amd64 has got a 16 byte sized and aligned 'long double'.peter2003-05-081-1/+2
| | | | Obtained from: re (blanket amd64)
* Turn off alloca.S - it cannot possibly work like this since on AMD64, gccpeter2003-05-071-1/+1
| | | | | | | doesn't use stack frames. It uses offsets relative to %rsp, not %rbp. So we cannot just change %rsp like this. Approved by: re (blanket amd64)
* Actually use the correct values for AMD64. It is a 64 bit platform,peter2003-05-071-0/+4
| | | | configure gdtoa as such.
* Convert the i386 alloca(3) to the x86-64 ISA.obrien2003-05-011-0/+53
| | | | Alignment hack from: NetBSD
* Delete i386_* syscall wrappers and manpages. Rename Ovfork.S to vfork.S.peter2003-04-301-12/+2
|
* Update for AMD64 after repocopy from i386/sys/*. This means:peter2003-04-306-105/+35
| | | | | | | - strip out the nasty PIC_PROLOGUE/EPILOGUE stuff, since we dont have to lose a register in PIC mode anymore (we use %rip-relative addressing). - update for C register argument passing conventions. - convert 32 bit to 64 bit register sizes etc.
* I have no idea why the reboot(2) syscall wrapper ends with iret, butpeter2003-04-301-1/+1
| | | | update it to be iretq for completeness.
* Update for AMD64. Depend on %rdi (first syscall argument) being preservedpeter2003-04-301-4/+3
| | | | across a "syscall"-style syscall
* Update for AMD64 (repocopied from i386/sys/Ovfork.S - why is it O?)peter2003-04-301-5/+4
| | | | | Depend on %rsi being preserved across the "syscall"-style syscall and strip out the PIC stuff (this cpu has full PC-relative addressing, at last!)
* Update for AMD64 contexts. Note that this still has some x87-style FPUpeter2003-04-303-105/+112
| | | | | instructions here, these may need to be updated for SSE. (Repocopied from i386/gen)
* Reduce the SRCS to what compilespeter2003-04-301-3/+3
|
* Update for AMD64 (repocopied from i386/net). We can depend on havingpeter2003-04-304-10/+6
| | | | | the bswap instruction (yay!). Update for register parameter passing instead of i386 style stack based param passing.
* Update for AMD64-style syscalls. Repocopied from i386/SYS.h.peter2003-04-301-7/+4
| | | | | | | | | | Note that the syscall instruction clobbers %rcx, which is inconvenient because it is the fourth syscall argument, so we use %r10 (another scratch register) for the 4th syscall arg instead (I picked %r10 to be the same as NetBSD). int 0x80 is still possible though, and it uses %rcx as usual. Note that the syscall style syscall does *NOT* preserve all the registers, unlike int 0x80. We do not preserve the scratch registers except for %rdi and %rsi. int 0x80 does preserve everything but the return values.
* Floating point libc functions traditionally written in ASM.obrien2003-04-302-0/+113
| | | | | | | AMD64 does away with the x87 in 64-bit long mode, so we have to play the SSE/SSE2 game now. Obtained from: NetBSD/x86-64
* Add __ldtoa(), a wrapper around gdtoa() to make it look like dtoa().das2003-04-051-0/+5
| | | | | | | In support of this, add some MD macros to assist in converting long doubles to the format expected by gdtoa(). Reviewed by: silence on standards@
* Replace our ancient dtoa/strtod implementation with the gdtoadas2003-03-122-0/+13
| | | | | | | | | | | | | | | | | | package, a more recent, generalized set of routines. Among the changes: - Declare strtof() and strtold() in stdlib.h. - Add glue to libc to support these routines for all kinds of ``long double''. - Update printf() to reflect the fact that dtoa works slightly differently now. As soon as I see that nothing has blown up, I will kill src/lib/libc/stdlib/strtod.c. Soon printf() will be able to use the new routines to output long doubles without loss of precision, but numerous bugs in the existing code must be addressed first. Reviewed by: bde (briefly), mike (mentor), obrien
* o Implement C99 classification macros isfinite(), isinf(), isnan(),mike2003-02-121-0/+2
| | | | | | | | | isnormal(). The current isinf() and isnan() are perserved for binary compatibility with 5.0, but new programs will use the macros. o Implement C99 comparison macros isgreater(), isgreaterequal(), isless(), islessequal(), islessgreater(), isunordered(). Submitted by: David Schultz <dschultz@uclink.Berkeley.EDU>
* Implement fpclassify():mike2003-02-082-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | o Add a MD header private to libc called _fpmath.h; this header contains bitfield layouts of MD floating-point types. o Add a MI header private to libc called fpmath.h; this header contains bitfield layouts of MI floating-point types. o Add private libc variables to lib/libc/$arch/gen/infinity.c for storing NaN values. o Add __double_t and __float_t to <machine/_types.h>, and provide double_t and float_t typedefs in <math.h>. o Add some C99 manifest constants (FP_ILOGB0, FP_ILOGBNAN, HUGE_VALF, HUGE_VALL, INFINITY, NAN, and return values for fpclassify()) to <math.h> and others (FLT_EVAL_METHOD, DECIMAL_DIG) to <float.h> via <machine/float.h>. o Add C99 macro fpclassify() which calls __fpclassify{d,f,l}() based on the size of its argument. __fpclassifyl() is never called on alpha because (sizeof(long double) == sizeof(double)), which is good since __fpclassifyl() can't deal with such a small `long double'. This was developed by David Schultz and myself with input from bde and fenner. PR: 23103 Submitted by: David Schultz <dschultz@uclink.Berkeley.EDU> (significant portions) Reviewed by: bde, fenner (earlier versions)
* libc_r wasn't so tied to libc for 22 months.ru2002-11-181-2/+0
|
* Disconnect the userland get/set/swapcontext() functions fromdeischen2002-11-161-2/+2
| | | | | | | | | libc. I want to keep these in some version for the thread library/ies, but don't know whether to have them repo-copied to libc_r or renamed and kept in libc. Change the name of an alpha macro that was changed with the system call commit.
* Re-apply the previously backed-out commit that fixes the problem wherearchie2002-10-311-1/+1
| | | | | | | | HUGE_VAL is not properly aligned on some architectures. The previous fix now works because the two versions of 'math.h' (include/math.h and lib/msun/src/math.h) have since been merged into one. PR: bin/43544
* Revert previous commit to unbreak world until we figure out thearchie2002-09-201-1/+1
| | | | right way to do it.
OpenPOWER on IntegriCloud