This patch ues exp, exp2, log, log2, and pow from arm optimized
routines. For pow on x86_64, although slight slower it simplifies
the code required on both bionic and arm-optimized-routines (so
there is no need to select and export the symbol based on
architecture).
Performance-wise the improvements are:
x86_64 throughput latency
exp 1.16x 1.16x
log 1.08x 0.95x
exp2 1.27x 1.55x
log2 1.40x 1.43x
pow 0.77x 0.89x *
* I tried to check if AVX2/FMA but without success.
aarch64 throughput latency
exp 2.33x 2.16x
exp2 1.99x 1.50x
log 1.79x 1.43x
log2 2.15x 1.80x
pow 3.81x 3.07x
Test: ran bionic tests on static mode.
Change-Id: Ib16bf3280c5329fd257a3b3f0b6c4f2f3cb34deb
This reverts commit 253a830631 and moves
us forward to a revision that contains fixes for the problem with the
previous attempt.
This also makes sincos(3)/sincosf(3)/sincosl(3) available to `_BSD_SOURCE`
as well as `_GNU_SOURCE`.
The new FreeBSD libm code requires the FreeBSD `__CONCAT` macro, and all
our existing callers are FreeBSD too, so update that.
There's also an assumption that <complex.h> drags in <math.h> which isn't
true for us, so work around that with `-include` in the makefile. This
then causes clang to recognize a bug -- returning from a void function --
in our fake (LP32) sincosl(3), so fix that too.
Bug: http://b/111710419
Change-Id: I84703ad844f8afde6ec6b11604ab3c096ccb62c3
Test: ran tests
This includes an ld128 powl, plus the clog* and cpow* families.
Also teach the NOTICE generator to strip SPDX-License-Identifier lines.
Bug: N/A
Test: ran tests
Change-Id: Ic8289d1253666a19468a4088884cf7540f1ec66d
Some of this code is used in the NDK libandroid_support now, as a static
library, so just being HIDDEN in the ELF sense isn't sufficient.
Rename digittoint to __libm_digittoint so we don't trample anyone's toes.
Also remove imprecise_powl and imprecise_tgammal. It turns out (to my
surprise) that we don't even have ld128 implementations of powl and tgammal,
so even LP64 was just using the "fake_long_double.c" hack in effect. Since
that's the case, let's *actually* do that because then we're not polluting
with the internal names in addition to the aliases.
Bug: N/A
Test: readelf
Change-Id: I273cc8fdc7ce53f9b8dfd4ef7796e358fe901837
Don't enable the inlines when building libm itself. Otherwise clang gets
upset by seeing both an inline and a non-inline definition.
This reverts commit c5deb0f883.
Change-Id: If7abdb351f5a5549d6a331b33af408e8fcfa9868
- promoted IEEEld2bits to fpmath since most of the where the same for
diffrent archs
- removed _fpmath
- reinstated weak_references
- moved isfinite and isnormal to libc
- clean up fake_long_doubles
- clean up some useless ifdefs
- added missing nexttoward* tests
Bug: 14134235
Change-Id: I95639c4885653fe47fd7dc0570ee5bb3389bbc6b
Also move isinf and isnan into libc like everyone else.
Also move fpclassify to libc like the BSDs (but unlike glibc). We need
this to be able to upgrade our float/double/long double parsing to gdtoa.
Also add some missing aliases. We now have all of:
isnan, __isnan, isnanf, __isnanf, isnanl, __isnanl,
isinf, __isinf, isinff, __isinff, isinfl, __isinfl,
__fpclassify, __fpclassifyd, __fpclassifyf, __fpclassifyl.
Bug: 13469877
Change-Id: I407ffbac06c765a6c5fffda8106c37d7db04f27d
* reworked amd64/_fpmath.h and arm64/_fpmath.h to support 128-bit long
doubles.
* improved tests to cover long double cases
* made modfl an alias for LP32
Tests pass on x86, x86_64, arm, arm64 and mips.
Bug: 12921273
Change-Id: Ibe39acde57972447a8950fa45b1e702acc68ebeb
The aarch64 toolchain doesn't support them, and we were already implementing
most of the fake long-double functions differently anyway.
Change-Id: I4a2f2df81972ee9c34ddfe96cec81b126506d881
This doesn't usually matter because there's a weak reference; you'd
miss this if you stopped using s_logb.c though.
Change-Id: I912fceae327a378031cd24a64aefa9dfd84f7f90
This brings us up to date with FreeBSD HEAD, fixes various bugs, unifies
the set of functions we support on ARM, MIPS, and x86, fixes "long double",
adds ISO C99 support, and adds basic unit tests.
It turns out that our "long double" functions have always been broken
for non-normal numbers. This patch fixes that by not using the upstream
implementations and just forwarding to the regular "double" implementation
instead (since "long double" on Android is just "double" anyway, which is
what BSD doesn't support).
All the tests pass on ARM, MIPS, and x86, plus glibc on x86-64.
Bug: 3169850
Bug: 8012787
Bug: https://code.google.com/p/android/issues/detail?id=6697
Change-Id: If0c343030959c24bfc50d4d21c9530052c581837