summaryrefslogtreecommitdiffstats
path: root/lib/msun
Commit message (Collapse)AuthorAgeFilesLines
* Synchronize most of libm with head as of r323004. This excludes a fewdim2018-02-2437-448/+1768
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 (cherry picked from commit 68896d08c13fabea18690d4c5369de8a5e24ba82)
* MFC r319157:ngie2017-06-011-1/+2
| | | | | | | | fma_test: mute a warning about unreachable code on amd64 by restructuring the #ifdef block to only handle the rest of the logic in the loop in the #else case. CID: 1346844
* MFC r319158:ngie2017-06-011-1/+1
| | | | | | | | logarithm_test: assert that feclearexcept succeeds This helps ensure that test preconditons are fulfilled. CID: 1346572
* MFC r318259:dim2017-05-162-2/+2
| | | | | | | | | Silence a -Wunused warning about the junk variable being used to raise an inexact floating point exception. The variable cannot be eliminated, unfortunately, otherwise the desired addition triggering the exception will be emitted neither by clang, nor by gcc. Reviewed by: Steve Kargl, bde
* MFC r315034asomers2017-04-021-0/+2
| | | | | | | | | | | | | Document that the msun tests require WARNS=0 ATF tests have a default WARNS of 0, unlike other usermode programs. This change is technically a noop, but it documents that the msun tests don't work with any warnings enabled, at least not on all architectures. Reviewed by: ngie MFC after: 3 weeks Sponsored by: Spectra Logic Corporation Differential Revision: https://reviews.freebsd.org/D9933
* MFC r314951:ngie2017-03-161-0/+7
| | | | | | | | | | | Expect :test_zero_input to fail on amd64 The clang 4.x+ upgrade now causes this testcase to fail, but only on amd64. More investigation will be done to determine the cause. PR: 217528
* MFC r314650:ngie2017-03-1218-214/+210
| | | | | | | | | | Fix warnings in lib/msun/tests/... to help pave way for WARNS?= 6. - Staticize variables. - Use nitems liberally. Wherever nitems is used, use unsigned integers - Remove unused variables (argc, argv, etc) This fixes most issues -- some issues remain in logarithm_test though.
* MFC r305283,r314649:ngie2017-03-122-48/+56
| | | | | | | | | | | | | | | | | | | r305283: Skip :test_large on i386 More assertions are failing on ^/head now. PR: 205446 r314649: Convert lib/msun/ctrig_test from TAP to ATF This is being done as a precursor for work needed to annontate failing testcases with clang 4.0+. PR: 217528
* MFC r313713:ngie2017-02-211-1/+2
| | | | | | | | | Handle clang 4.x+ with the compile-time exception added in r312213 It also fails the assertions noted in bug 208703 PR: 208703 PR: 217084
* MFC r312008:ngie2017-02-121-1/+6
| | | | | | | | | | | | | Upgrade NetBSD tests to 01.11.2017_23.20 snapshot This contains some new testcases in /usr/tests/...: - .../lib/libc - .../lib/libthr - .../lib/msun - .../sys/kern Tested on: amd64, i386
* MFC r303841,r312012,r312213:ngie2017-02-042-12/+20
| | | | | | | | | | | | | | | | | | | | | | | | | r303841 (by bdrewery): Revert r298434 which should be fixed by r301287, r301394, and r301403. PR: 208703, 208963 r312012: fmaxmin_test still fails with clang 3.9.x.. bypass the test PR: 208703 r312213: Turn COMPILER_VERSION/COMPILER_TYPE make check into a compile-time check of the clang version This works around breakage on ^/stable/10 when running installworld from a ^/stable/10 host where the test wouldn't be compiled on the first go-around and would be missing when make installworld is run. PR: 208703
* MFC r309298: libm: remove duplicate version script entriesemaste2016-12-091-5/+0
| | | | | | | These symbols already appear in the common lib/msun/Symbol.map. Duplicate entries produce an error with LLVM's LLD linker. Sponsored by: The FreeBSD Foundation
* MFC r305358:ngie2016-12-031-0/+3
| | | | | | | | | | | | | | | | | | | | | Update contrib/netbsd-tests with new content from NetBSD This updates the snapshot from 09/30/2014 to 08/11/2016 This brings in a number of new testcases from upstream, most notably: - bin/cat - lib/libc - lib/msun - lib/libthr - usr.bin/sort lib/libc/tests/stdio/open_memstream_test.c was moved to lib/libc/tests/stdio/open_memstream2_test.c to accomodate the new open_memstream test from NetBSD. Tested on: amd64 (VMware fusion VM; various bare metal platforms); i386 (VMware fusion VM); make tinderbox
* MFC r305380:bde2016-09-191-0/+6
| | | | | | Fix missing fmodl() on arches with 53-bit long doubles. PR: 199422, 211965
* Fix frexpl() declaration to not include the field name.trasz2016-06-091-1/+1
| | | | MFC after: 1 month
* Make armv6 hard float abi by default. Kill armv6hf.imp2016-05-182-2/+4
| | | | | | | Allow CPUTYPE=soft to build the current soft-float abi libraries. Add UPDATING entry to announce this. Approved by: re@ (gjb)
* Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installedngie2016-05-041-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | after r298107 Summary of changes: - Replace all instances of FILES/TESTS with ${PACKAGE}FILES. This ensures that namespacing is kept with FILES appropriately, and that this shouldn't need to be repeated if the namespace changes -- only the definition of PACKAGE needs to be changed - Allow PACKAGE to be overridden by callers instead of forcing it to always be `tests`. In the event we get to the point where things can be split up enough in the base system, it would make more sense to group the tests with the blocks they're a part of, e.g. byacc with byacc-tests, etc - Remove PACKAGE definitions where possible, i.e. where FILES wasn't used previously. - Remove unnecessary TESTSPACKAGE definitions; this has been elided into bsd.tests.mk - Remove unnecessary BINDIRs used previously with ${PACKAGE}FILES; ${PACKAGE}FILESDIR is now automatically defined in bsd.test.mk. - Fix installation of files under data/ subdirectories in lib/libc/tests/hash and lib/libc/tests/net/getaddrinfo - Remove unnecessary .include <bsd.own.mk>s (some opportunistic cleanup) Document the proposed changes in share/examples/tests/tests/... via examples so it's clear that ${PACKAGES}FILES is the suggested way forward in terms of replacing FILES. share/mk/bsd.README didn't seem like the appropriate method of communicating that info. MFC after: never probably X-MFC with: r298107 PR: 209114 Relnotes: yes Tested with: buildworld, installworld, checkworld; buildworld, packageworld Sponsored by: EMC / Isilon Storage Division
* lib: minor spelling fixes in comments.pfg2016-05-012-2/+2
| | | | No functional change.
* Completely disable fmaxmin_test (follow up to r297952)ngie2016-04-211-3/+9
| | | | | | | | | | COMPILER_TYPE/COMPILER_VERSION doesn't get passed down properly at buildworld/installworld with older build hosts MFC after: never PR: 208703, 208963 Reported by: Jenkins Sponsored by: EMC / Isilon Storage Division
* MFHgjb2016-04-161-0/+5
|\ | | | | | | Sponsored by: The FreeBSD Foundation
| * Disable fmaxmin_test when compiling it with clang 3.8.0ngie2016-04-141-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The testcase always fails today due to how C11 7.6.1/2 is interpreted with clang 3.8.0 when combined with "#pragma STDC FENV_ACCESS ON". This testcase passes with clang <3.8.0 and gcc, so continue testing it with those compiler combinations More intelligent discussion on the issue is in the PR MFC after: never PR: 208703 Sponsored by: EMC / Isilon Storage Division
| * Fix appending -O0 to CFLAGSngie2016-04-111-3/+3
| | | | | | | | | | | | | | | | | | The previous method would completely nerf CFLAGS once bsd.progs.mk had recursed into the per-PROG logic and make the CFLAGS for tap testcases to -O0, instead of appending to CFLAGS for all of the tap testcases. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
* | MFHgjb2016-04-121-3/+3
| | | | | | | | Sponsored by: The FreeBSD Foundation
* | MFHgjb2016-04-041-2/+0
|\ \ | |/ | | | | Sponsored by: The FreeBSD Foundation
| * Implement (ACFLAGS|CFLAGS|CXXFLAGS).SRC globally.bdrewery2016-03-261-2/+0
| | | | | | | | Sponsored by: EMC / Isilon Storage Division
* | MFHgjb2016-03-101-0/+21
|\ \ | |/ | | | | Sponsored by: The FreeBSD Foundation
| * DIRDEPS_BUILD: Connect MK_TESTS.bdrewery2016-03-091-0/+21
| | | | | | | | Sponsored by: EMC / Isilon Storage Division
* | MFHgjb2016-03-061-0/+4
|\ \ | |/ | | | | Sponsored by: The FreeBSD Foundation
| * Merge ^/head r296007 through r296368.dim2016-03-031-0/+5
| |\
| * \ Merge ^/head r294777 through r294960.dim2016-01-271-0/+52
| |\ \
| * | | Disable building the csqrt_test test on arm64, it hits an assert inandrew2016-01-111-0/+4
| | | | | | | | | | | | | | | | llvm 3.8.
* | | | MFHgjb2016-03-021-0/+5
|\ \ \ \ | | |_|/ | |/| | | | | | Sponsored by: The FreeBSD Foundation
| * | | Make FPSCR definition endian clean.nwhitehorn2016-02-261-0/+5
| | |/ | |/| | | | | | | | | | | | | | | | PR: 207526 Submitted by: Simon Byrne Obtained from: Julia MFC after: 1 month
* | | Remove libc, librtld_db, libthr packages, and further increasegjb2016-02-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the constraints on what needs to be installed in a specific to maintain consistency during upgrades. Create a new clibs package containing libraries that are needed as a bare minimum for consistency. With much help and input from: kib Sponsored by: The FreeBSD Foundation
* | | First pass through library packaging.gjb2016-02-041-0/+1
| | | | | | | | | | | | Sponsored by: The FreeBSD Foundation
* | | First pass to fix the 'tests' packages.gjb2016-02-021-0/+3
|/ / | | | | | | Sponsored by: The FreeBSD Foundation
* | Add fenv.c for RISC-V. Copied from MIPS.br2016-01-261-0/+52
|/
* Use j instead of a hardcoded index (9) and increment it afterngie2015-12-231-1/+2
| | | | | | | | running the NaNs testcases MFC after: 3 days Pointyhat to: ngie Sponsored by: EMC / Isilon Storage Division
* Integrate the remaining tools/regression/lib/msun testcases into thengie2015-12-208-1/+1978
| | | | | | | | FreeBSD test suite under lib/msun/tests MFC after: 3 weeks X-MFC with: r292328 Sponsored by: EMC / Isilon Storage Division
* Integrate a number of testcases from tools/regression/lib/msunngie2015-12-1615-1/+3427
| | | | | | | | | | | | | | into the FreeBSD test suite There's no functional change with these testcases; they're purposely being left in TAP format for the time being Other testcases which crash on amd64/i386 as-is have not been integrated yet (they need to be retested on a later version of CURRENT, as I haven't used i386 in some time) MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division
* Start support for the RISC-V 64-bit architecture developed by UC Berkeley.br2015-12-112-0/+234
| | | | | | | | | | | | | | | RISC-V is a new ISA designed to support computer research and education, and is now become a standard open architecture for industry implementations. This is a minimal set of changes required to run 'make kernel-toolchain' using external (GNU) toolchain. The FreeBSD/RISC-V project home: https://wiki.freebsd.org/riscv. Reviewed by: andrew, bdrewery, emaste, imp Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision: https://reviews.freebsd.org/D4445
* Don't override LIB*DIR variables from src.libnames.mk.bdrewery2015-12-011-5/+4
| | | | | | | | In some cases switch to the LIB*SRCDIR value. These recently were defined in r291327 and r291619. Sponsored by: EMC / Isilon Storage Division
* META MODE: Prefer INSTALL=tools/install.sh to lessen the need for xinstall.host.bdrewery2015-11-251-1/+0
| | | | | | | | This both avoids some dependencies on xinstall.host and allows bootstrapping on older releases to work due to lack of at least 'install -l' support. Sponsored by: EMC / Isilon Storage Division
* Bump .Ddngie2015-11-091-1/+1
|
* Document powl(3)ngie2015-11-092-6/+12
| | | | | PR: 191751 Sponsored by: EMC / Isilon Storage Division
* We have long double on arm64, and the tests pass so enable them.andrew2015-10-311-1/+3
| | | | Sponsored by: ABT Systems Ltd
* Refactor the test/ Makefiles after recent changes to bsd.test.mk (r289158) andngie2015-10-121-4/+0
| | | | | | | | | | | | netbsd-tests.test.mk (r289151) - Eliminate explicit OBJTOP/SRCTOP setting - Convert all ad hoc NetBSD test integration over to netbsd-tests.test.mk - Remove unnecessary TESTSDIR setting - Use SRCTOP where possible for clarity MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Divison
* In libm's exp2(3), avoid left-shifting a negative integer, which isdim2015-08-091-2/+2
| | | | | | | undefined. Replace it with the intended value, in a defined way. Reviewed by: bde MFC after: 3 days
* .ie is not supposed to be used in manpagesbapt2015-07-141-6/+2
| | | | Submitted by: carsten.kunze@arcor.de
* Fix compilation when the armv6 world is being compiled without hw floatingian2015-06-241-1/+1
| | | | | | point support. The fenv-vfp.c file overrides -mfloat-abi so it can use floating point instructions if it detects support at runtime. Make it also override -mfpu in case the user has set -mfpu=none.
OpenPOWER on IntegriCloud