summaryrefslogtreecommitdiffstats
path: root/lib/msun
Commit message (Collapse)AuthorAgeFilesLines
* MFC r269956:andrew2014-10-291-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | From https://sourceware.org/ml/newlib/2014/msg00113.html By Richard Earnshaw at ARM > >GCC has for a number of years provides a set of pre-defined macros for >use with determining the ISA and features of the target during >pre-processing. However, the design was always somewhat cumbersome in >that each new architecture revision created a new define and then >removed the previous one. This meant that it was necessary to keep >updating the support code simply to recognise a new architecture being >added. > >The ACLE specification (ARM C Language Extentions) >(http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.set.swdev/index.html) >provides a much more suitable interface and GCC has supported this >since gcc-4.8. > >This patch makes use of the ACLE pre-defines to map to the internal >feature definitions. To support older versions of GCC a compatibility >header is provided that maps the traditional pre-defines onto the new >ACLE ones. Stop using __FreeBSD_ARCH_armv6__ and switch to __ARM_ARCH >= 6 in the couple of places in tree. clang already implements ACLE. Add a define that says we implement version 1.1, even though the implementation isn't quite complete.
* MFC r257770 r257818 r257823 r260066 r260067 r260089 r260145 r268587 r268588tijl2014-09-1829-723/+2140
| | | | | | | | | | | r268589 r268590 r268593 r268597 r269758 r270845 r270847 r270893 r270932 r270947 r271147 Merge libm work by kargl, bde and das from the past few months. Besides optimisations and small bug fixes this includes new implementations for C99 functions expl, coshl, sinhl, tanhl, erfl and erfcl. Approved by: re (kib)
* MFC 262989, 263210, 263230, 263231, 263239, 263242, 263243,ian2014-05-177-10/+398
| | | | | | | | | | | | | | | | | Export _libc_arm_fpu_present as a private symbol to be used by other system libraries, for example libm. On armv6 access both the softfloat and, when available, the vfp to get and set the floating-point environment. Build fenv-vfp.c with the softfp float abi. Without this gcc generates an incorrect assembly file that doesn't allow for vfp instructions. Only build the vfp/softfp switching code on armv6 as we don't support vfp on anything earlier than this. This should fix the armeb and arm builds when using gcc. Add an optimised version of the float and double helper functions.
* MFC r257207, r261161, r261163:ian2014-05-152-42/+63
| | | | | | | | | Update the hard-float version of the fenv functions to use the VFP unit. Any other floating-point unit is unsupported on ARM. Use __fenv_static for all static inline functions. Correctly shift the mask when masking/unmasking exceptions.
* MFC r262613:dim2014-03-261-0/+1
| | | | | | | | | | | | | | | | | | | | | Merge the projects/clang-sparc64 branch back to head. This brings in several updates from the llvm and clang trunks to make the sparc64 backend fully functional. Apart from one patch to sys/sparc64/include/pcpu.h which is still under discussion, this makes it possible to let clang fully build world and kernel for sparc64. Any assistance with testing this on actual sparc64 hardware is greatly appreciated, as there will unavoidably be bugs left. Many thanks go to Roman Divacky for his upstream work on getting the sparc64 backend into shape. MFC r262985: Repair a few minor mismerges from r262261 in the clang-sparc64 project branch. This is also to minimize differences with upstream.
* After r255294, building lib/msun's symbol map (using clang as thedim2013-09-121-1/+1
| | | | | | | | | | | | | | 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)
* On ARM EABI double precision floating point values are stored in theandrew2013-09-071-1/+1
| | | | | | endian the CPU is in, i.e. little-endian on most ARM cores. This allows ARMv4 and ARMv5 boards to boot with the ARM EABI.
* Add stub implementations of the missing C++11 math functions.theraven2013-09-063-0/+79
| | | | | | | | | | 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.
* * Whitespace.kargl2013-08-281-1/+1
|
* * s_erf.c:kargl2013-08-272-99/+71
| | | | | | | | | | | | | | | | | | | | | | . Use integer literal constants instead of double literal constants. * s_erff.c: . Use integer literal constants instead of casting double literal constants to float. . Update the threshold values from those carried over from erf() to values appropriate for float. . New sets of polynomial coefficients for the rational approximations. These coefficients have little, but positive, effect on the maximum error in ULP in the four intervals, but do improve the overall speed of execution. . Remove redundant GET_FLOAT_WORD(ix,x) as hx already contained the contents that is packed into ix. . Update the mask that is used to zero-out lower-order bits in x in the intervals [1.25, 2.857143] and [2.857143, 12]. In tests on amd64, this change improves the maximum error in ULP from 6.27739 and 63.8095 to 3.16774 and 2.92095 on these intervals for erffc(). Reviewed by: bde
* Restore the longer form of the _Generic. The short form does not work in C++.theraven2013-07-291-2/+11
|
* Reenable the isnan(double) / isinf(double) declarations when targeting C89 + ↵theraven2013-07-291-0/+15
| | | | SUSv2 mode.
* Cleaner support for type qualifiers.theraven2013-07-131-11/+2
| | | | Submitted by: Pasi Parviainen
* Ensure that the _Generic() macro in math.h works with qualified types.theraven2013-07-131-17/+26
| | | | tgmath.h contains the same bugs and so should be fixed in the same way.
* Fix the build with C++ where __builtin_types_compatible_p is not allowed.theraven2013-07-121-2/+3
|
* Fix some typoes in math.h cleanup.theraven2013-07-111-3/+3
|
* Cleanups to math.h that prevent namespace conflicts with C++.theraven2013-07-111-28/+49
| | | | | Reviewed by: bde MFC after: 3 days
* Make the order of operations for lib/msun more clear.eadler2013-06-242-2/+2
| | | | | | | Tested with md5 sum of object code Reported by: swildner@DragonFlyBSD.org Submitted by: bde
* Add implementations of acoshl(), asinhl(), and atanhl(). This is adas2013-06-1012-48/+344
| | | | merge of the work done by bde and myself.
* Style fixes.das2013-06-054-54/+58
| | | | Submitted by: bde
* Add man links for expl(3) and expm1l(3).das2013-06-041-2/+2
|
* Change a comma to a semicolon.kargl2013-06-031-3/+2
| | | | | | Remove a blank line that crept into the declarations. Fix a comment to show a sign on a NaN.
* ld80 and ld128 implementations of expm1l(). This code started lifekargl2013-06-036-4/+373
| | | | | | | | | | | | | | 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)
* Fix two comments that got lost in the disentanglement of the larger diff.kargl2013-06-031-1/+6
|
* ld80/s_expl.c:kargl2013-06-032-8/+11
| | | | | | | | | | | | | | * Use integral numerical constants, and let the compiler do the conversion to long double. ld128/s_expl.c: * Use integral numerical constants, and let the compiler do the conversion to long double. * Use the ENTERI/RETURNI macros, which are no-ops on ld128. This however makes the ld80 and ld128 identical. Reviewed by: bde (as part of larger diff)
* Micro-optimization: move the unary mius operator to operatekargl2013-06-032-3/+3
| | | | | | on a literal constant. Obtained from: bde
* Add a comment to note that bde supplied most, if not all,kargl2013-06-031-0/+2
| | | | of the optimizations.
* ld80/s_expl.c:kargl2013-06-032-13/+9
| | | | | | | | | | | | | | | | * In the special case x = -Inf or -NaN, use a micro-optimization to eliminate the need to access u.xbits.man. * Fix an off-by-one for small arguments |x| < 0x1p-65. ld128/s_expl.c: * In the special case x = -Inf or -NaN, use a micro-optimization to eliminate the need to access u.xbits.manh and u.xbits.manl. * Fix an off-by-one for small arguments |x| < 0x1p-114. Obtained from: bde
* ld80/s_expl.c:kargl2013-06-032-27/+55
| | | | | | | | | | | | | | * Update the evaluation of the polynomial. This allows the removal of the now unused variables t23 and t45. ld128/s_expl.c: * Update the evaluation of the polynomial and the intermediate result t. This update allows several numerical constants to be written as double rather than long double constants. Update the constants as appropriate. Obtained from: bde
* Rename a few P2, P3, ... coefficients to A2, A3, ... missed inkargl2013-06-031-3/+3
| | | | my previous commit.
* Update a comment to reflect that we are using an endpoint ofkargl2013-06-032-2/+2
| | | | an interval instead of a midpoint.
* Add a u suffix to the IEEEl2bits unions o_threshold and u_threshold,kargl2013-06-031-4/+7
| | | | | | | and use macros to access the e component of the unions. This allows the portions of the code in ld80 to be identical to the ld128 code. Obtained from: bde
* Introduce the macro LOG2_INTERVAL, which is log2(number of intervals).kargl2013-06-032-2/+5
| | | | | | | Use the macroi as a micro-optimization to convert a subtraction and division to a shift. Obtained from: bde
* Whitespace.kargl2013-06-032-4/+4
|
* * Rename the polynomial coefficients from P2, P3, ... to A2, A3, ....kargl2013-06-032-25/+24
| | | | | | | | | | The names now coincide with the name used in PTP Tang's paper. * Rename the variable from s to tbl to better reflect that this is a table, and to be consistent with the naming scheme in s_exp2l.c Reviewed by: bde (as part of larger diff)
* * Style(9). Start non-Copyright fancy formatted comments with /**.kargl2013-06-031-1/+1
| | | | Reviewed by: bde (as part of larger diff)
* ld80/s_expl.c:kargl2013-06-032-2/+2
| | | | | | | | | | | * Update Copyright years to include 2013. ld128/s_expl.c: * Correct and update Copyright years. This code originated from the ld80 version, so it should reflect the same time period. Reviewed by: bde (as part of larger diff)
* Add logl, log2l, log10l, and log1pl.das2013-06-0311-18/+1809
| | | | Submitted by: bde
* I'm happy to finally commit stephen@'s implementations of cacos,das2013-05-308-15/+1186
| | | | | | | | cacosh, casin, casinh, catan, and catanh. Thanks to stephen@ and bde@ for working on these. Submitted by: stephen@ Reviewed by: bde
* Style(9)kargl2013-05-271-1/+1
| | | | | Approved by: das (implicit) Reported by: jh
* * Update polynomial coefficients.kargl2013-05-271-33/+30
| | | | | | | | * Use ENTERI/RETURNI to allow the use of FP_PE on i386 target. Reviewed by: das (and bde a long time ago) Approved by: das (mentor) Obtained from: bde (polynomial coefficients)
* Fix some regressions caused by the switch from gcc to clang. The fixesdas2013-05-2720-40/+53
| | | | | | | | | | are workarounds for various symptoms of the problem described in clang bugs 3929, 8100, 8241, 10409, and 12958. The regression tests did their job: they failed, someone brought it up on the mailing lists, and then the issue got ignored for 6 months. Oops. There may still be some regressions for functions we don't have test coverage for yet.
* Merge the 386 and amd64 versions of the fenv.h, to make cc -m32kib2013-04-213-286/+164
| | | | | | | compilations which use fenv.h work. Reviewed by: tjil Sponsored by: The FreeBSD Foundation
* Only define isnan, isnanf, __isnan and __isnanf in libc.so, not indim2012-11-101-3/+4
| | | | | | | | | | | libc.a and libc_p.a. In addition, define isnan in libm.a and libm_p.a, but not in libm.so. This makes it possible to statically link executables using both isnan and isnanf with libc and libm. Tested by: kargl MFC after: 1 week
* Fix typo; s/ouput/outputkevlo2012-11-071-1/+1
|
* Revert r241756imp2012-10-221-62/+0
|
* Revert r241755imp2012-10-221-51/+0
|
* Document the method used to compute expf. Taken from exp, withimp2012-10-191-0/+62
| | | | changes to reflect differences in computation between the two.
* Document the methods used to compute logf. Taken and edited from theimp2012-10-191-0/+51
| | | | | double version, with adaptations for the differences between it and the float version.
* mdoc: avoid nested displays.joel2012-10-141-32/+35
|
OpenPOWER on IntegriCloud