summaryrefslogtreecommitdiffstats
path: root/lib/libc/ia64/gen
Commit message (Collapse)AuthorAgeFilesLines
* Replace the ldexp() implementation in libc with a renamed copy of thedas2005-01-221-137/+0
| | | | | | | | | | | | | | | | scalbn() implementation from libm. (The two functions are defined to be identical, but ldexp() lives in libc for backwards compatibility.) The old ldexp() implementation... - was more complicated than this one - set errno instead of raising FP exceptions - got some corner cases wrong (e.g. ldexp(1.0, 2000) in round-to-zero mode) The new implementation lives in libc/gen instead of libc/$MACHINE_ARCH/gen, since we don't need N copies of a machine-independent file. The amd64 and i386 platforms retain their fast and correct MD implementations and override this one.
* Make profiling actually work. The gcc compiler emits a call to themarcel2004-08-252-4/+79
| | | | | | | | | | | | | _mcount() stub when profiling is enabled. Emit this code sequence for assembly routines as welli (MCOUNT definition in <machine/asm.h>. We do not pass the GOT entry however as the 4th argument, because it's not used. The _mcount() stub calls __mcount(), which does the actual work. Define _MCOUNT_DECL to define __mcount. We do not have an implementation of mcount(), so we define MCOUNT as empty, but have a weak alias to _mcount() in _mcount.S. Note that the _mcount() stub in the kernel is slightly different from the stub in userland. This is because we do not have to worry about nested routines in the kernel.
* Add support for TLS in statically linked programs.dfr2004-08-152-1/+36
|
* 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-57/+1
| | | | for subnormals with one implementation that works.
* Implement the classification macros isfinite(), isinf(), isnan(), anddas2004-07-092-70/+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
* Fix some aliasing problems.das2004-02-161-6/+14
|
* Add required headers.nectar2004-01-062-0/+4
|
* Virtual addresses in headers of ELF files for dynamic objects needmarcel2003-11-081-6/+9
| | | | to be relocated before they can be used as pointers.
* The FP status register allows for 6 traps to be masked. One of them,marcel2003-10-222-3/+3
| | | | | | | | | | | | the denormal/unnormal trap, is not a standard IEEE trap. We did not exclude it from being returned by fpgetmask(), nor did we make sure that fpsetmask() didn't clobber it. Since the non-IEEE trap is not part of fp_except_t, users of ifpgetmask()/fpsetmask() would be confronted with unexpected behaviour, one of which is a SIGFPE for denormal/unnormal FP results. This commit makes sure that we don't leak the denormal/unnormal mask bit in fp_except_t and also that we don't clobber it.
* o There are 6 trap disable bits in ar.fpsr, not five. Even though wemarcel2003-08-092-4/+4
| | | | | | | | | | | | | didn't provide a constant for one of them (non-IEEE denormal trap), in an attempt to not support it probably, it's not we are left with the lower 5 bits. o Properly mask the passed or returned fp_except_t. Not doing so causes instant core dumps by trying to write an invalid value to ar.fpsr. Now that we're masking, stop using exclusive-or to invert bits. This fixes the illegal instruction fault encountered when building mozilla.
* Revert previous commit. We don't use setjmp()/longjmp() for contextmarcel2003-07-251-4/+2
| | | | | | switching anymore, so there's no need to save and restore GP. This change breaks threaded applications linked against libc_r. Pull the tier 2 card again: relink. This will link against libthr instead.
* Implement signalcontext(). Needed by libpthread (aka libkse).marcel2003-06-242-1/+123
|
* o Fix a cut-n-paste bug. We were clobbering rp with gp...marcel2003-06-021-2/+2
| | | | | | o Make sure the arguments to ctx_wrapper() are loaded from the backing store by forcing an underflow. Do this by making all registers in the register frame local.
* Rough implement of makecontext() needed to support libthr.marcel2003-05-312-1/+122
| | | | | | | | | | | | | | o Up to 8 arguments are allowed. This is the number of arguments passed in registers. Subsequent registers are passed on the stack. Trying to deal with this is not easy in C and likely forces us to use assembly code. Let's avoid that for now. There's no indication that more than 8 arguments is a strong requirement (Linux also has an 8 argument limit). o We expect that the stack base is 16-byte aligned and the stack size is a multiple of 16-byte. We bomb out if this is not the case. We probably want to be less strict by enforcing it ourselves. For now it's better to not hide gross alignment bogons by silently correcting it.
* Fix threaded applications on ia64 that are linked dynamicly. We didmarcel2003-03-051-3/+5
| | | | | | | | | | | | | | | | | not save (restore) the global pointer (GP) in the jmpbuf in setjmp (longjmp) because it's not needed in general. GP is considered a scratch register at callsites and hence is always restored after a call (when it's possible that the call resolves to a symbol in a different loadmodule; otherwise GP does not have to be saved and restored at all), including calls to setjmp/longjmp. There's just one problem with this now that we use setjmp/longjmp for context switching: A new context must have GP defined properly for the thread's entry point. This means that we need to put GP in the jmpbuf and consequently that we have to restore is in longjmp. This automaticly requires us to save it as well. When setjmp/longjmp isn't used for context switching, this can be reverted again.
* ABI breaker: Move the J_SIGMASK field in the jmpbuf beforemarcel2003-03-051-2/+2
| | | | | | | | | | | the J_SIG0 field. While here, rename J_SIG0 to J_SIGSET and remove J_SIG1. The main reason for this change is that the 128-bit sigset_t is now aligned on a 16-byte boundary, which allows us to use 16-byte atomic loads and stores on CPUs that support it. The removal of J_SIG1 is done to avoid confusion: it is never accessed and should not be. Renaming J_SIG0 to J_SIGSET is the icing on the cake that's better done now than later.
* Use __FBSDID.obrien2003-03-0314-20/+36
|
* ia64 actually uses 80-bit long doubles and must support big and littlemike2003-02-261-0/+9
| | | | | | endian at compile-time. Reviewed by: das
* o Implement C99 classification macros isfinite(), isinf(), isnan(),mike2003-02-121-0/+5
| | | | | | | | | 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-081-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* Implement missing fpgetround() and fpsetround().marcel2003-01-113-2/+84
|
* Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,schweikh2003-01-012-2/+2
| | | | especially in troff files.
* Sort SRCS.marcel2002-11-161-5/+4
|
* o Fix _longjmp() to return 1 when the return value is given as 0.marcel2002-11-141-52/+25
| | | | | | | | | | | | | o Remove the unwanted smartness in _longjmp() where it compares the current ar.bspstore with the saved ar.bspstore and restores ar.rnat based on it. This either avoids saving ar.rnat in the jmp_buf or is the consequence of not saving ar.rnat. All this complexity breaks libc_r where we use longjmp() to switch to different threads and the current ar.bspstore has no relation to the saved ar.bspstore. Thus: we save ar.rnat in setjmp() and simply restore ar.bspstore and ar.rnat in longjmp(). This code needs a cleanup.
* ia64 ABI breaker:marcel2002-11-113-38/+6
| | | | | | | | | | | | | Don't force 16-byte alignment at run-time. Do it at compile-time. This saves us the pointer fiddling by the setjmp functions and reduces complexity. While here, increase the jmp_buf by 16 bytes to an even 512 bytes. Coincidentally, due to the way alignment was handled prior to this change, the jmp_buf has not changed in size, but only in how the space is used. Prior to this change the 16 bytes were reserved for enforcing alignment; now they are reserved by us for future extensions. Therefore, this ABI breaker is relatively save: the failure is always an alignment trap.
* 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.
* Fix a problem with the definition of HUGE_VAL causing the gcc warningarchie2002-09-191-1/+1
| | | | | | "cast increases required alignment of target type" on some platforms. Reviewed by: bde
* Implement _Unwind_FindTableEntry(). This function is part of GCCmarcel2002-04-132-0/+130
| | | | | for some configurations, but not for FreeBSD (yet?). Have one in libc in the mean time.
* Fix the style of the SCM ID's.obrien2002-03-227-9/+21
| | | | I believe have made all of libc .c's as consistent as possible.
* Remove 'register' keyword.obrien2002-03-212-3/+3
|
* Implement fpsetmask() and fpgetmask().dfr2001-11-033-1/+83
|
* Compensate for the way that _setjmp aligns the start of jmp_buf.dfr2001-10-262-5/+23
|
* Implement setjmp, longjmp, sigsetjmp and siglongjmp.dfr2001-10-203-104/+53
|
* Add __divdf3(), __divsf3() and __infinity[].dfr2001-10-204-1/+296
| | | | Obtained from: Intel (for the divide code)
* Implement _setjmp()/_longjmp().dfr2001-09-041-125/+345
| | | | Obtained from: Intel's EFI toolkit
* Removed duplicate VCS ID tags, as per style(9).ru2001-08-133-6/+0
|
* Make this compile. Still need to write/borrow a working setjmp.dfr2001-03-061-0/+1
|
* Remove _THREAD_SAFE and make libc thread-safe by default bydeischen2001-01-244-32/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | adding (weak definitions to) stubs for some of the pthread functions. If the threads library is linked in, the real pthread functions will pulled in. Use the following convention for system calls wrapped by the threads library: __sys_foo - actual system call _foo - weak definition to __sys_foo foo - weak definition to __sys_foo Change all libc uses of system calls wrapped by the threads library from foo to _foo. In order to define the prototypes for _foo(), we introduce namespace.h and un-namespace.h (suggested by bde). All files that need to reference these system calls, should include namespace.h before any standard includes, then include un-namespace.h after the standard includes and before any local includes. <db.h> is an exception and shouldn't be included in between namespace.h and un-namespace.h namespace.h will define foo to _foo, and un-namespace.h will undefine foo. Try to eliminate some of the recursive calls to MT-safe functions in libc/stdio in preparation for adding a mutex to FILE. We have recursive mutexes, but would like to avoid using them if possible. Remove uneeded includes of <errno.h> from a few files. Add $FreeBSD$ to a few files in order to pass commitprep. Approved by: -arch
* Return zero from setjmp() and _setjmp() for now.dfr2000-10-162-0/+5
|
* Initial libc port for ia64.dfr2000-10-1417-0/+1840
OpenPOWER on IntegriCloud