#
336767 |
|
27-Jul-2018 |
dim |
MFC r327400 (by eadler):
cacos(3): correct spelling of 'I'
In some cases we had 'i' instead of 'I'.
PR: 195517 Submitted by: stephen
MFC r329259 (by eadler):
msun: signed overflow in atan2
As a component of atan2(y, x), the case of x == 1.0 is farmed out to atan(y). The current implementation of this comparison is vulnerable to signed integer underflow (that is, undefined behavior), and it's performed in a somewhat more complicated way than it need be. Change it to not be quite so cute, rather directly comparing the high/low bits of x to the specific IEEE-754 bit pattern that encodes 1.0.
Note that while there are three different e_atan* files in the relevant directory, only this one needs fixing. e_atan2f.c already compares against the full bit pattern encoding 1.0f, while e_atan2l.cuses bitwise-ands/ors/nots and so doesn't require a change.
Closes #130
Submitted by: Jeff Walden (@jswalden github PR #130) Reviewed by: bde
MFC r334721 (by cem):
clog.3, complex.3: Fix typos and igor style issues
PR: 228783 Reported by: Karsten <freebsd-bugzilla AT kkoenig.net>
MFC r336299 (by mmacy):
msun: add ld80/ld128 powl, cpow, cpowf, cpowl from openbsd
This corresponds to the latest status (hasn't changed in 9+ years) from openbsd of ld80/ld128 powl, and source cpowf, cpow, cpowl (the complex power functions for float complex, double complex, and long double complex) which are required for C99 compliance and were missing from FreeBSD. Also required for some numerical codes using complex numbered Hamiltonians.
Thanks to jhb for tracking down the issue with making weak_reference compile on powerpc.
When asked to review, bde said "I don't like it" - but provided no actionable feedback or superior implementations.
Discussed with: jhb Submitted by: jmd Differential Revision: https://reviews.freebsd.org/D15919
MFC r336563:
Recommit r336497: Fix powl, cpow, cpowf, and cpowl imports from OpenBSD
This is a follow-up to r336299.
* lib/msun/Makefile: . Remove polevll.c
* lib/msun/ld80/e_powl.c: . Copy contents of polevll.c to here. This is the only consumer of these functions. Make functions 'static inline'. . Make reducl a 'static inline' function.
* lib/msun/man/exp.3: . Remove BUGS section that no longer applies.
* lib/msun/src/math_private.h: . Remove prototypes of __p1evll() and __polevll()
* lib/msun/src/s_cpow.c: * lib/msun/src/s_cpowf.c: * lib/msun/src/s_cpowl.c . Include math_private.h. . Use the CMPLX macro from either C99 or math_private.h (depends on compiler support) instead of the problematic use of complex I.
Submitted by: Steve Kargl <sgk@troutmask.apl.washington.edu> PR: 229876
|
#
334654 |
|
05-Jun-2018 |
kib |
MFC r333577: Add implementations for clog(3), clogf(3), and clogl(3).
PR: 216863
|
#
324006 |
|
26-Sep-2017 |
dim |
Synchronize most of libm with head as of r323004. This excludes a few arch-specific updates for powerpcspe, mips and riscv, for which support has not been merged yet.
Bump __FreeBSD_version for the addition of cacoshl, cacosl, casinhl, casinl, catanl, catanhl, sincos, sincosf, and sincosl.
MFC r305382 (by bde):
Add asm versions of fmod(), fmodf() and fmodl() on amd64. Add asm versions of fmodf() amd fmodl() on i387.
fmod is similar to remainder, and the C versions are 3 to 9 times slower than the asm versions on x86 for both, but we had the strange mixture of all 6 variants of remainder in asm and only 1 of 6 variants of fmod in asm.
MFC r305384 (by bde):
Disconnect the "optimized" asm variants of cos(), sin() and tan() from the build on i386. Leave them in the source tree for regression tests.
The asm functions were always much less accurate (by a factor of more than 10**18 in the worst case). They were faster on old CPUs. But with each new generation of CPUs they get relatively slower. The double precision C version's average advantage is about a factor of 2 on Haswell.
The asm functions were already intentionally avoided in float and long double precision on i386 and in all precisions on amd64. Float precision and amd64 give larger advantages to the C version. The long double precision C code and compilers' understanding of long double precision are not so good, so the i387 is still slightly faster for long double precision, except for the unimportant subcase of huge args where the sub-optimal C code now somehow beats the i387 by about a factor of 2.
MFC r305385 (by bde):
Oops, the previous i386 version of e_fmodf.S and e_fmodl.S was actually the amd64 version.
MFC r306409 (by emaste):
libm: fix some unused variable (rcsid) and dangling else warnings
s_{fabs,fmax,logb,scalb}{,f,l}.c may be built elsewhere with a higher WARNS setting.
Reviewed by: ed Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D8061
MFC r306410 (by emaste):
libm: simplify i387 subdir logic with make's :S substitution
MFC r306527 (by emaste):
libm: remove unused variables for LDBL_MANT_DIG != 113
Sponsored by: The FreeBSD Foundation
MFC r306709 (by emaste):
libm: remove unused variables
Sponsored by: The FreeBSD Foundation
MFC r307066 (by br):
Don't use fmaxl/fminl on platforms with no long double support, use fmax/fmin instead.
This fixes fmaxmin test failure on MIPS64.
Reviewed by: emaste Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision: https://reviews.freebsd.org/D8216
MFC r308172 (by emaste):
libm: add braces around initialization of subobjects
This cleans up a warning when building libm at higher WARNS levels and makes the intent more clear. By the C standard the values are assigned to subobject members in order so this change introduces no functional change. (6.7.9 20)
Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D8333
MFC r313761 (by mmokhi):
Add casinl() cacosl() catanl() casinhl() cacoshl() catanhl() APIs to msun to improve C11 conformance.
PR: 216850 216851 216852 216856 216857 216858 Submitted by: mmokhi Reported by: sgk@troutmask.apl.washington.edu Reviewed by: bde, mat, theraven Approved by: bde (src committer), mat (mentor) Differential Revision: https://reviews.freebsd.org/D9491
MFC r313863 (by mmokhi):
Fix building of r313761 on platforms that `long double` is alias of `double` (MIPS, etc)
PR: 216850 216851 216852 216856 216857 216858 Reported by: emsate Reviewed by: bde emaste hselasky Approved by: bde emaste hselasky Differential Revision: https://reviews.freebsd.org/D9491
MFC r313864 (by mmokhi):
Add documentations related to new APIs of r313761
PR: 216850 216851 216852 216856 216857 216858 Submitted by: sgk@troutmask.apl.washington.edu Reported by: sgk@troutmask.apl.washington.edu Reviewed by: bde emaste hselasky Approved by: bde emaste hselasky Differential Revision: https://reviews.freebsd.org/D9491
MFC r314950 (by ngie):
Don't expect :test_large_inputs to fail with i386 anymore
Recent changes (maybe a side-effect of the ATF-ification in r314649) invalidate the failure expectation.
PR: 205446 Sponsored by: Dell EMC Isilon
MFC r317349 (by pfg):
msun: Remove trailing space in Sunsoft copyright statement.
Submittedby: kargl
MFC r319047 (by mmel):
Implement sincos, sincosf, and sincosl. The primary benefit of these functions is that argument reduction is done once instead of twice in independent calls to sin() and cos().
* lib/msun/Makefile: . Add s_sincos[fl].c to the build. . Add sincos.3 documentation. . Add appropriate MLINKS.
* lib/msun/Symbol.map: . Expose sincos[fl] symbols in dynamic libm.so.
* lib/msun/man/sincos.3: . Documentation for sincos[fl].
* lib/msun/src/k_sincos.h: . Kernel for sincos() function. This merges the individual kernels for sin() and cos(). The merger offered an opportunity to re-arrange the individual kernels for better performance.
* lib/msun/src/k_sincosf.h: . Kernel for sincosf() function. This merges the individual kernels for sinf() and cosf(). The merger offered an opportunity to re-arrange the individual kernels for better performance.
* lib/msun/src/k_sincosl.h: . Kernel for sincosl() function. This merges the individual kernels for sinl() and cosl(). The merger offered an opportunity to re-arrange the individual kernels for better performance.
* lib/msun/src/math.h: . Add prototytpes for sincos[fl]().
* lib/msun/src/math_private.h: . Add RETURNV macros. This is needed to reset fpsetprec on I386 hardware for a function with type void.
* lib/msun/src/s_sincos.c: . Implementation of sincos() where sin() and cos() were merged into one routine and possibly re-arranged for better performance.
* lib/msun/src/s_sincosf.c: . Implementation of sincosf() where sinf() and cosf() were merged into one routine and possibly re-arranged for better performance.
* lib/msun/src/s_sincosl.c: . Implementation of sincosl() where sinl() and cosl() were merged into one routine and possibly re-arranged for better performance.
PR: 215977, 218300 Submitted by: Steven G. Kargl <sgk@troutmask.apl.washington.edu> Differential Revision: https://reviews.freebsd.org/D10765
MFC r321457 (by ngie):
Mark :reduction as an expected failure
It fails with clang 5.0+.
PR: 220989 Reported by: Jenkins
MFC r322418 (by rlibby):
lib/msun: avoid referring to broken LDBL_MAX
LDBL_MAX is broken on i386: https://lists.freebsd.org/pipermail/freebsd-numerics/2012-September/000288.html
Gcc has produced +Infinity for LDBL_MAX on i386 and amd64 with -m32 for some time, and newer versions of gcc are now warning that the "floating constant exceeds range of 'long double'". Avoid this by referring to half the value of LDBL_MAX instead.
Reviewed by: bde Approved by: markj (mentor) Sponsored by: Dell EMC Isilon
MFC r322435 (by rlibby):
Revert r322418, LDBL_MAX_EXP unsuitable for macro pasting on some arches
Either need a different way to spell HALF_LDBL_MAX, or a different way to spell LDBL_MAX_EXP, or a different approach.
Reported by: ian
MFC r322921 (by ngie):
Revert r321457
It doesn't fail after ^/head@r322855 (the releng_50 clang merge).
PR: 220989
|
#
302408 |
|
07-Jul-2016 |
gjb |
Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle. Prune svn:mergeinfo from the new branch, as nothing has been merged here.
Additional commits post-branch will follow.
Approved by: re (implicit) Sponsored by: The FreeBSD Foundation |
#
271651 |
|
15-Sep-2014 |
kargl |
* Makefile: . Hook e_lgammal[_r].c to the build. . Create man page links for lgammal[-r].3.
* Symbol.map: . Sort lgammal to its rightful place. . Add FBSD_1.4 section for the new lgamal_r symbol.
* ld128/e_lgammal_r.c: . 128-bit implementataion of lgammal_r().
* ld80/e_lgammal_r.c: . Intel 80-bit format implementation of lgammal_r().
* src/e_lgamma.c: . Expose lgammal as a weak reference to lgamma for platforms where long double is mapped to double.
* src/e_lgamma_r.c: . Use integer literal constants instead of real literal constants. Let compiler(s) do the job of conversion to the appropriate type. . Expose lgammal_r as a weak reference to lgamma_r for platforms where long double is mapped to double.
* src/e_lgammaf_r.c: . Fixed the Cygnus Support conversion of e_lgamma_r.c to float. This includes the generation of new polynomial and rational approximations with fewer terms. For each approximation, include a comment on an estimate of the accuracy over the relevant domain. . Use integer literal constants instead of real literal constants. Let compiler(s) do the job of conversion to the appropriate type. This allows the removal of several explicit casts of double values to float.
* src/e_lgammal.c: . Wrapper for lgammal() about lgammal_r().
* src/imprecise.c: . Remove the lgamma.
* src/math.h: . Add a prototype for lgammal_r().
* man/lgamma.3: . Document the new functions.
Reviewed by: bde
|
#
268593 |
|
13-Jul-2014 |
kargl |
* Makefile: . Add s_erfl.c to building libm. . Add MLINKS for erfl.3 and erfcl.3.
* Symbol.map: . Move erfl and erfcl to their proper location.
* ld128/s_erfl.c: . Implementations of erfl and erfcl in the IEEE 754 128-bit format.
* ld80/s_erfl.c: . Implementations of erfl and erfcl in the Intel 80-bit format.
* man/erf.3: . Document the new functions. . While here, remove an incomplete sentence.
* src/imprecise.c: . Remove the stupidity of mapping erfl and erfcl to erf and erfc.
* src/math.h: . Move the declarations of erfl and erfcl to their proper place.
* src/s_erf.c: . For architectures where double and long double are the same floating point format, use weak references to map erfl to erf and ercl to erfc.
Reviewed by: bde (many earlier versions)
|
#
260067 |
|
29-Dec-2013 |
kargl |
* Makefile: . Hook coshl, sinhl, and tanhl into libm. . Create symbolic links for corresponding manpages. . While here remove a nearby extraneous space.
* Symbol.map: * src/math.h: . Move coshl, sinhl, and tanhl to their proper locations.
* man/cosh.3: * man/sinh.3: * man/tanh.3: . Update the manpages.
* src/e_cosh.c: * src/e_sinh.c: * src/s_tanh.c: . Add weak reference for LBDL_MANT_DIG==53 targets.
* src/imprecise.c: . Remove the coshl, sinhl, and tanhl kludge.
* src/e_coshl.c: . ld80 and ld128 implementation of coshl().
* src/e_sinhl.c: . ld80 and ld128 implementation of sinhl().
* src/s_tanhl.c: . ld80 and ld128 implementation of tanhl().
Obtained from: bde (mostly), das and kargl
|
#
255499 |
|
12-Sep-2013 |
dim |
After r255294, building lib/msun's symbol map (using clang as the preprocessor) gives the following error:
--- Version.map --- <stdin>:287:4: error: invalid preprocessing directive # Implemented as weak aliases for imprecise versions ^ 1 error generated.
Change the comment to a C-style one, to prevent this error.
Approved by: re (hrs)
|
#
255294 |
|
06-Sep-2013 |
theraven |
Add stub implementations of the missing C++11 math functions. These are weak and so can be replaced by other versions in applications that choose to do so, and will give a linker warning when used so that applications that rely on the extra precision can avoid them.
Note that since the C/C++ specs only guarantee that long double has precision equal to double, code that actually relies on these functions having greater precision is unportable at best and broken at worst.
|
#
251599 |
|
10-Jun-2013 |
das |
Add implementations of acoshl(), asinhl(), and atanhl(). This is a merge of the work done by bde and myself.
|
#
251343 |
|
03-Jun-2013 |
kargl |
ld80 and ld128 implementations of expm1l(). This code started life as a fairly faithful implementation of the algorithm found in
PTP Tang, "Table-driven implementation of the Expm1 function in IEEE floating-point arithmetic," ACM Trans. Math. Soft., 18, 211-222 (1992).
Over the last 18-24 months, the code has under gone significant optimization and testing.
Reviewed by: bde Obtained from: bde (most of the optimizations)
|
#
251292 |
|
03-Jun-2013 |
das |
Add logl, log2l, log10l, and log1pl.
Submitted by: bde
|
#
251121 |
|
30-May-2013 |
das |
I'm happy to finally commit stephen@'s implementations of cacos, cacosh, casin, casinh, catan, and catanh. Thanks to stephen@ and bde@ for working on these.
Submitted by: stephen@ Reviewed by: bde
|
#
238722 |
|
23-Jul-2012 |
kargl |
Compute the exponential of x for Intel 80-bit format and IEEE 128-bit format. These implementations are based on
PTP Tang, "Table-driven implementation of the exponential function in IEEE floating-point arithmetic," ACM Trans. Math. Soft., 15, 144-157 (1989).
PR: standards/152415 Submitted by: kargl Reviewed by: bde, das Approved by: das (mentor)
|
#
226458 |
|
17-Oct-2011 |
das |
Add c{cos,sin,tan}{,h}{,f} functions. This is joint work with bde and kargl.
|
#
226218 |
|
10-Oct-2011 |
das |
Provide external definitions of all of the standardized functions in fenv.h that are currently inlined.
The definitions are provided in fenv.c via 'extern inline' declaractions. This assumes the compiler handles 'extern inline' as specified in C99, which has been true under FreeBSD since 8.0.
The goal is to eventually remove the 'static' keyword from the inline definitions in fenv.h, so that non-inlined references all wind up pointing to the same external definition like they're supposed to. I am deferring the second step to provide a window where newly-compiled apps will still link against old math libraries. (This isn't supported, but there's no need to cause undue breakage.)
Reviewed by: stefanf, bde
|
#
219576 |
|
12-Mar-2011 |
kargl |
Take two. Add the missing file that should have been committed with r219571 and re-enable building of cbrtl.
Implement the long double version for the cube root function, cbrtl. The algorithm uses Newton's iterations with a crude estimate of the cube root to converge to a result.
Reviewed by: bde Approved by: das
|
#
219572 |
|
12-Mar-2011 |
kargl |
Temporary disable the building of cbrtl until I can determine why svn will not allow one to commit a new file.
Approved by: das (implicit)
|
#
219571 |
|
12-Mar-2011 |
kargl |
Implement the long double version for the cube root function, cbrtl. The algorithm uses Newton's iterations with a crude estimate of the cube root to converge to a result.
Reviewed by: bde Approved by: das
|
#
219365 |
|
07-Mar-2011 |
das |
Remove part of an uncommitted change that snuck into the last commit.
|
#
219359 |
|
07-Mar-2011 |
das |
Add cexp() and cexpf().
Reviewed by: bde (earlier version)
|
#
216211 |
|
05-Dec-2010 |
das |
Add log2() and log2f().
|
#
209110 |
|
12-Jun-2010 |
das |
Introduce __isnanf() as an alias for isnanf(), and make the isnan() macro expand to __isnanf() instead of isnanf() for float arguments. This change is needed because isnanf() isn't declared in strict POSIX or C99 mode.
Compatibility note: Apps using isnan(float) that are compiled after this change won't link against an older libm.
Reported by: Florian Forster <octo@verplant.org>
|
#
181377 |
|
07-Aug-2008 |
das |
Implement cproj{,f,l}().
|
#
181074 |
|
31-Jul-2008 |
das |
Add implementations of acosl(), asinl(), atanl(), atan2l(), and cargl().
Reviewed by: bde sparc64 testing resources from: remko
|
#
179882 |
|
19-Jun-2008 |
das |
Implement fmodl. Document fmodl and fix some errors in the fmod manpage.
|
#
177766 |
|
30-Mar-2008 |
das |
Hook remquol() and remainderl() up to the build.
|
#
177761 |
|
30-Mar-2008 |
das |
Implement csqrtl().
|
#
177760 |
|
30-Mar-2008 |
das |
Hook hypotl() and cabsl() up to the build.
|
#
176722 |
|
01-Mar-2008 |
das |
Hook up sqrtl() to the build.
|
#
176388 |
|
18-Feb-2008 |
das |
Add tgammaf() as a simple wrapper around tgamma().
|
#
176361 |
|
17-Feb-2008 |
das |
Hook up sinl(), cosl(), and tanl() to the build.
|
#
175462 |
|
18-Jan-2008 |
das |
Hook up exp2l() and related docs to the build.
|
#
175309 |
|
14-Jan-2008 |
das |
Implement rintl(), nearbyintl(), lrintl(), and llrintl(). Thanks to bde@ for feedback and testing of rintl().
|
#
174732 |
|
17-Dec-2007 |
das |
Remove z_abs(). The z_*() functions were in libf77, and for some reason someone thought it would be a good idea to copy z_abs() to libm in 1994. However, it's never been declared or documented anywhere, and I'm reasonably confident that nobody uses it.
Discussed with: bde, deischen, kan
|
#
174698 |
|
17-Dec-2007 |
das |
Add logbl(3) to libm.
|
#
174684 |
|
16-Dec-2007 |
das |
Implement and document nan(), nanf(), and nanl(). This commit 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.
|
#
174618 |
|
15-Dec-2007 |
das |
1. Add csqrt{,f}(3). 2. Put carg{,f}(3) under the FBSD_1.1 namespace where it belongs (requested by kan@)
|
#
174584 |
|
14-Dec-2007 |
das |
Typo in previous commit
|
#
174583 |
|
14-Dec-2007 |
das |
Symbol.map additions for carg and cargf. (They're in C99, so I didn't add a new version for them.)
|
#
169092 |
|
29-Apr-2007 |
deischen |
Use C comments since we now preprocess these files with CPP.
|
#
165855 |
|
07-Jan-2007 |
das |
Implement modfl().
|
#
165837 |
|
06-Jan-2007 |
das |
Remove modf from libm's symbol map. It's actually in libc for hysterical raisins.
|
#
157196 |
|
27-Mar-2006 |
deischen |
Add symbol versioning to libm.
|