summaryrefslogtreecommitdiffstats
path: root/lib/msun/ld80
Commit message (Collapse)AuthorAgeFilesLines
* Fix clang warnings.benl2011-06-181-1/+1
| | | | Approved by: philip (mentor)
* Clean up the unneeded cpp macro INLINE_REM_PIO2L.kargl2011-05-301-4/+1
| | | | | Reviewed by: das Approved by: das (mentor)
* Improve the accuracy from a max ULP of ~2000 to max ULP < 0.79kargl2011-04-291-0/+152
| | | | | | | | | | | | | | | | | | | | on i386-class hardware for sinl and cosl. The hand-rolled argument reduction have been replaced by e_rem_pio2l() implementations. To preserve history the following commands have been executed: svn cp src/e_rem_pio2.c ld80/e_rem_pio2l.h mv ${HOME}/bde/ld80/e_rem_pio2l.c ld80/e_rem_pio2l.h svn cp src/e_rem_pio2.c ld128/e_rem_pio2l.h mv ${HOME}/bde/ld128/e_rem_pio2l.c ld128/e_rem_pio2l.h The ld80 version has been tested by bde, das, and kargl over the last few years (bde, das) and few months (kargl). An older ld128 version was tested by das. The committed version has only been compiled tested via 'make universe'. Approved by: das (mentor) Obtained from: bde
* On i386, gcc truncates long double constants to double precisiondas2008-08-021-4/+17
| | | | | | | | | | | | | | | | at compile time regardless of the dynamic precision, and there's no way to disable this misfeature at compile time. Hence, it's impossible to generate the appropriate tables of constants for the long double inverse trig functions in a straightforward way on i386; this change hacks around the problem by encoding the underlying bits in the table. Note that these functions won't pass the regression test on i386, even with the FPU set to extended precision, because the regression test is similarly damaged by gcc. However, the tests all pass when compiled with a modified version of gcc. Reported by: bde
* Add implementations of acosl(), asinl(), atanl(), atan2l(),das2008-07-312-0/+183
| | | | | | | and cargl(). Reviewed by: bde sparc64 testing resources from: remko
* 2 long double constants were missing L suffixes. This helped break tanl()bde2008-02-181-2/+2
| | | | | on !(amd64 || i386). It gave slightly worse than double precision in some cases. tanl() now passes tests of 2^24 values on ia64.
* Fix a typo which broke k_tanl.c on !(amd64 || i386).bde2008-02-181-1/+1
|
* Add kernel functions for 80-bit long doubles. Many thanks to Steve anddas2008-02-173-0/+264
| | | | | | | Bruce for putting lots of effort into these; getting them right isn't easy, and they went through many iterations. Submitted by: Steve Kargl <sgk@apl.washington.edu> with revisions from bde
* Fix exp2*(x) on signaling NaNs by returning x+x as usual.bde2008-02-131-1/+1
| | | | | | | | | | | | | | | This has the side effect of confusing gcc-4.2.1's optimizer into more often doing the right thing. When it does the wrong thing here, it seems to be mainly making too many copies of x with dependency chains. This effect is tiny on amd64, but in some cases on i386 it is enormous. E.g., on i386 (A64) with -O1, the current version of exp2() should take about 50 cycles, but took 83 cycles before this change and 66 cycles after this change. exp2f() with -O1 only speeded up from 51 to 47 cycles. (exp2f() should take about 40 cycles, on an Athlon in either i386 or amd64 mode, and now takes 42 on amd64). exp2l() with -O1 slowed down from 155 cycles to 123 for some args; this is unimportant since the i386 exp2l() is a fake; the wrong thing for it seems to involve branch misprediction.
* Use a better method of scaling by 2**k. Instead of adding to thebde2008-02-071-11/+14
| | | | | | | | | | | | | | | | | | | | | exponent bits of the reduced result, construct 2**k (hopefully in parallel with the construction of the reduced result) and multiply by it. This tends to be much faster if the construction of 2**k is actually in parallel, and might be faster even with no parallelism since adjustment of the exponent requires a read-modify-wrtite at an unfortunate time for pipelines. In some cases involving exp2* on amd64 (A64), this change saves about 40 cycles or 30%. I think it is inherently only about 12 cycles faster in these cases and the rest of the speedup is from partly-accidentally avoiding compiler pessimizations (the construction of 2**k is now manually scheduled for good results, and -O2 doesn't always mess this up). In most cases on amd64 (A64) and i386 (A64) the speedup is about 20 cycles. The worst case that I found is expf on ia64 where this change is a pessimization of about 10 cycles or 5%. The manual scheduling for plain exp[f] is harder and not as tuned. This change ld128/s_exp2l.c has not been tested.
* Implement exp2l(). There is one version for machines with 80-bitdas2008-01-181-0/+291
| | | | | | | | long doubles (i386, amd64, ia64) and one for machines with 128-bit long doubles (sparc64). Other platforms use the double version. I've only done runtime testing on i386. Thanks to bde@ for helpful discussions and bugfixes.
* Since nan() is supposed to work the same as strtod("nan(...)", NULL),das2007-12-181-10/+9
| | | | | | | | | | | | 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
* Implement and document nan(), nanf(), and nanl(). This commitdas2007-12-161-0/+47
adds two new directories in msun: ld80 and ld128. These are for long double functions specific to the 80-bit long double format used on x86-derived architectures, and the 128-bit format used on sparc64, respectively.
OpenPOWER on IntegriCloud